/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (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
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include <locale.h>
#include <stdio.h>
#include <time.h>
#include <signal.h>
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
#include <errno.h>
#include <fslib.h>
extern int daylight;
static int roflag = 0;
static int optsize = 0;
/*
* differs between what the user mount command expects and what the
* kernel module can grok, we transmogrify the mount option string
* for such options. Others are copied through as-is.
*/
#define ARG_PCFS_TIMEZONE 0
/*
* While constructing the mount option string, we need to append
* comma separators if there have been previous options copied over
* from the input string. This takes care of it.
*/
static int
{
return (0);
}
int
{
char *mnt_special;
char *mnt_mountp;
int c;
char *myname;
char *tzval;
extern int optind;
extern char *optarg;
int error = 0;
int verbose = 0;
int qflg = 0;
int optcnt = 0;
int tzdone = 0;
switch (c) {
case 'V':
case 'v':
verbose++;
break;
case '?':
error++;
break;
case 'r':
roflag++;
break;
case 'm':
mflg |= MS_NOMNTTAB;
break;
case 'o':
exit(2);
}
while (*in_arg != '\0') {
case ARG_PCFS_TIMEZONE:
goto invalarg;
"TZ=%s", tzval);
tzdone = 1;
break;
default:
/*
* Remove empty suboptions
* (happens on sequences of commas)
*/
if (*curarg == '\0')
break;
curarg) == 0)
goto invalarg;
}
}
break;
case 'O':
mflg |= MS_OVERLAY;
break;
case 'q':
qflg = 1;
break;
}
}
char *optptr;
if (optptr)
}
}
/*
* don't hint at options yet (none are really supported)
*/
"Usage: %s [generic options] [-o suboptions] "
"special mount_point\n"), typename);
"\tpcfs-specific suboptions are:\n"
"\t clamptime,noclamptime\n"
"\t hidden,nohidden\n"
"\t atime,noatime\n"
"\t foldcase,nofoldcase\n"
"\t timezone=<valid TZ string>"));
exit(32);
}
/*
* Pass timezone information to the kernel module so that
* FAT timestamps, as per spec, can be recorded in local time.
*/
tzset();
/*
* We perform this validation only in case the user of
* mount(1m) specified the "timezone=..." option. That's
* because we don't want PCFS mounts to fail due to a
* botched $TZ environment variable. If the admin's
* environment contains garbage, it'll just parse as
* GMT (timezone=0).
*/
goto invalarg;
}
goto invalarg;
if (roflag)
myname);
exit(2);
}
if (verbose) {
}
"mount: %s is already mounted or %s is busy\n"),
"mount: %s is not a DOS filesystem.\n"),
} else {
perror("mount");
}
exit(32);
}
return (0);
return (2);
}