/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2003 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <ctype.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h> /* for getopt(3) */
#include <signal.h>
#include <locale.h>
#include <fslib.h>
#include <errno.h>
static int roflag = 0;
static int mflag = 0;
static int Oflag = 0;
static int qflag = 0;
static int optsize = 0;
static void do_mount(char *, char *, int);
static void rpterr(char *, char *);
static void usage(void);
int
{
int flags = 0;
int c;
#if !defined(TEXT_DOMAIN)
#endif
(void) textdomain(TEXT_DOMAIN);
if (myname) {
myname++;
} else {
}
/* check for proper arguments */
switch (c) {
case 'm':
mflag++;
break;
case 'o':
sizeof (optbuf)) {
gettext("%s: Invalid argument: %s\n"),
return (2);
}
break;
case 'r':
roflag++;
break;
case 'O':
Oflag++;
break;
case 'q':
qflag = 1;
break;
default :
break;
}
}
usage();
if (roflag)
if (optsize > 0) {
struct mnttab m;
m.mnt_mntopts = optbuf;
if (hasmntopt(&m, "m"))
mflag++;
}
/*
* Perform the mount.
* Only the low-order bit of "roflag" is used by the system
* calls (to denote read-only or read-write).
*/
return (0);
}
static void
{
switch (errno) {
case EPERM:
break;
case ENXIO:
break;
case ENOTDIR:
gettext("%s: %s not a directory\n\t"
"or a component of %s is not a directory\n"),
break;
case ENOENT:
gettext("%s: %s or %s, no such file or directory\n"),
break;
case EINVAL:
gettext("%s: %s is not an udfs file system.\n"),
break;
case EBUSY:
gettext("%s: %s is already mounted or %s is busy\n"),
break;
case ENOTBLK:
break;
case EROFS:
gettext("%s: %s write-protected\n"),
break;
case ENOSPC:
gettext("%s: %s is corrupted. needs checking\n"),
break;
default:
}
}
static void
{
char *savedoptbuf;
myname);
exit(2);
}
}
}
static void
usage(void)
{
"mount [-F udfs] [generic options] "
"[-o suboptions] {special | mount_point}\n"));
"\t ro,rw,nosuid,remount,m\n"));
"\t only one of ro, rw can be "
"used at the same time\n"));
"\t remount can be used only with rw\n"));
exit(32);
}