18 *
19 * CDDL HEADER END
20 */
21 /*
22 * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
23 * Copyright 2015 Nexenta Systems, Inc. All rights reserved.
24 */
25
26 #include <sys/stat.h>
27 #include <locale.h>
28 #include <unistd.h>
29 #include <stdlib.h>
30 #include <stdio.h>
31 #include <string.h>
32
33 #include "dconf.h"
34 #include "minfree.h"
35 #include "utils.h"
36
37 static const char USAGE[] = "\
38 Usage: %s [-enuy] [-c kernel | curproc | all ] [-d dump-device | swap ]\n\
39 [-m min {k|m|%%} ] [-s savecore-dir] [-r root-dir] [-z on|off]\n";
40
41 static const char OPTS[] = "einuyc:d:m:s:r:z:";
42
43 static const char PATH_DEVICE[] = "/dev/dump";
44 static const char PATH_CONFIG[] = "/etc/dumpadm.conf";
45
46 int
47 main(int argc, char *argv[])
48 {
49 const char *pname = getpname(argv[0]);
50
51 u_longlong_t minf;
52 struct stat st;
53 int c;
54 int dflag = 0; /* for checking in use during -d ops */
55 int eflag = 0; /* print estimated dump size */
56 int dcmode = DC_CURRENT; /* kernel settings override unless -u */
57 int modified = 0; /* have we modified the dump config? */
58 char *minfstr = NULL; /* string value of -m argument */
59 dumpconf_t dc; /* current configuration */
|
18 *
19 * CDDL HEADER END
20 */
21 /*
22 * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
23 * Copyright 2015 Nexenta Systems, Inc. All rights reserved.
24 */
25
26 #include <sys/stat.h>
27 #include <locale.h>
28 #include <unistd.h>
29 #include <stdlib.h>
30 #include <stdio.h>
31 #include <string.h>
32
33 #include "dconf.h"
34 #include "minfree.h"
35 #include "utils.h"
36
37 static const char USAGE[] = "\
38 Usage: %s [-enuy] [-c kernel | curproc | all ]\n\
39 [-d dump-device | swap | none ] [-m min {k|m|%%} ] [-s savecore-dir]\n\
40 [-r root-dir] [-z on|off]\n";
41
42 static const char OPTS[] = "einuyc:d:m:s:r:z:";
43
44 static const char PATH_DEVICE[] = "/dev/dump";
45 static const char PATH_CONFIG[] = "/etc/dumpadm.conf";
46
47 int
48 main(int argc, char *argv[])
49 {
50 const char *pname = getpname(argv[0]);
51
52 u_longlong_t minf;
53 struct stat st;
54 int c;
55 int dflag = 0; /* for checking in use during -d ops */
56 int eflag = 0; /* print estimated dump size */
57 int dcmode = DC_CURRENT; /* kernel settings override unless -u */
58 int modified = 0; /* have we modified the dump config? */
59 char *minfstr = NULL; /* string value of -m argument */
60 dumpconf_t dc; /* current configuration */
|