4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
31 #pragma ident "%Z%%M% %I% %E% SMI"
38 #include <sys/types.h>
53 static void usage(void);
56 * Given argv[0], return a pointer to the basename of the program.
63 /* first strip trailing '/' characters (exec() allows these!) */
64 str
= arg0
+ strlen(arg0
);
65 while (str
> arg0
&& *--str
== '/')
67 if ((str
= strrchr(arg0
, '/')) != NULL
)
73 main(int argc
, char **argv
)
77 prog
= prog_name(argv
[0]);
79 while ((c
= getopt(argc
, argv
, "fFownx:l:p:k:s:?QW:")) != EOF
) {
86 ckwidth
= atol(optarg
);
106 options
|= DM_WLABEL
;
123 options
|= DM_ELABEL
;
131 signo
= atol(optarg
);
139 if ((optind
+1) != argc
)
142 switch (n
= getvol(argv
[optind
], label
, options
, prompt
)) {
147 (void) fprintf(stderr
,
148 "%s: ERROR: unable to access device <%s>\n",
153 (void) fprintf(stderr
, "%s: ERROR: unknown device <%s>\n",
159 (void) kill(kpid
, signo
);
163 (void) fprintf(stderr
, "%s: ERROR: bad label on <%s>\n",
168 (void) fprintf(stderr
, "%s: ERROR: unknown device error\n",
180 "usage: %s [-owfF] [-x extlabel] [-l [fsname],volname] device\n",
183 "usage: %s [-n] [-x extlabel] [-l [fsname],volname] device\n",