static char *sccsid
= "@(#)mount.c 4.3 (Berkeley) %G%";
register struct mtab
*mp
;
mf
= open("/etc/mtab", 0);
read(mf
, (char *)mtab
, NMOUNT
*2*NAMSIZ
);
for (mp
= mtab
; mp
< &mtab
[NMOUNT
]; mp
++)
printf("%s on %s\n", mp
->spec
, mp
->file
);
if (strcmp(argv
[1], "-a") == 0)
fprintf(stdout
,"arg count\n");
if (mountfs(argv
[1], argv
[2], ro
)){
while ( (fsp
= getfsent()) != 0){
if (strcmp(fsp
->fs_file
, "/") == 0)
ro
= !strcmp(fsp
->fs_type
, FSTAB_RO
);
if (ro
==0 && strcmp(fsp
->fs_type
, FSTAB_RW
))
if (mountfs(fsp
->fs_spec
, fsp
->fs_file
, ro
))
register struct fstab
*fsp
;
extern char *sys_errlist
[];
printf("Attempt to mount ");
printf("FAILED: %s\n", sys_errlist
[err
]);
register struct fstab
*fsp
;
register struct fstab
*fsp
;
fsp
->fs_file
, fsp
->fs_spec
,
ro
? "(Read Only)" : "");
register struct mtab
*mp
;
if(mount(spec
, name
, ro
) < 0) {
while(np
> spec
&& *--np
!= '/')
for (mp
= mtab
; mp
< &mtab
[NMOUNT
]; mp
++) {
for (np
= mp
->spec
; np
< &mp
->spec
[NAMSIZ
-1];)
if ((*np
++ = *spec
++) == 0)
for (np
= mp
->file
; np
< &mp
->file
[NAMSIZ
-1];)
if ((*np
++ = *name
++) == 0)
while ((--mp
)->file
[0] == 0);
mf
= creat("/etc/mtab", 0644);
write(mf
, (char *)mtab
, (mp
-mtab
+1)*2*NAMSIZ
);