static char sccsid
[] = "@(#)quotaon.c 4.1 (Melbourne) %G%";
* Turn quota on/off for a filesystem
int aflag
; /* all file systems */
register struct fstab
*fs
;
if (argc
> 0 && strcmp(*argv
, "-v") == 0) {
if (argc
> 0 && strcmp(*argv
, "-a") == 0) {
if (argc
<= 0 || strcmp(*argv
, "on") && strcmp(*argv
, "off")) {
"usage: setquota [-v] [-a] on | off [filesys...]\n");
on
= strcmp(*argv
, "on") == 0;
while ((fs
= getfsent()) != NULL
) {
if (fs
->fs_quotafile
== 0 || *fs
->fs_quotafile
== '\0')
if (fs
->fs_type
== 0 || strcmp(fs
->fs_type
, "rw"))
if (!aflag
&& !oneof(fs
->fs_file
, argv
, argc
))
printf("%s: quotas turned %s\n", fs
->fs_file
,
char quotafile
[MAXPATHLEN
+ 1];
(void) sprintf(quotafile
, "%s/%s", fs
->fs_file
,
i
= setquota(fs
->fs_spec
, quotafile
);
i
= setquota(fs
->fs_spec
, NULL
);
fprintf(stderr
, "setquota: ");
if (strcmp(target
, list
[i
]) == 0)