* Copyright (c) 1980 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid
[] = "@(#)fstab.c 5.2 (Berkeley) 3/9/86";
#endif LIBC_SCCS and not lint
static char line
[BUFSIZ
+1];
static FILE *fs_file
= 0;
fsdigit(backp
, string
, end
)
for (cp
= string
; *cp
&& isdigit(*cp
); cp
++) {
while (*cp
&& *cp
!= end
)
cp
= fgets(line
, 256, fs_file
);
cp
= fsdigit(&fs
->fs_freq
, cp
, ':');
cp
= fsdigit(&fs
->fs_passno
, cp
, '\n');
if ((fs_file
= fopen(FSTAB
, "r")) == NULL
) {
if ((fs_file
== 0) && (setfsent() == 0))
return ((struct fstab
*)0);
nfields
= fstabscan(&fs
);
if (nfields
== EOF
|| nfields
!= 5)
return ((struct fstab
*)0);
register struct fstab
*fsp
;
if (setfsent() == 0) /* start from the beginning */
return ((struct fstab
*)0);
while((fsp
= getfsent()) != 0)
if (strcmp(fsp
->fs_spec
, name
) == 0)
return ((struct fstab
*)0);
register struct fstab
*fsp
;
if (setfsent() == 0) /* start from the beginning */
return ((struct fstab
*)0);
while ((fsp
= getfsent()) != 0)
if (strcmp(fsp
->fs_file
, name
) == 0)
return ((struct fstab
*)0);
register struct fstab
*fs
;
return ((struct fstab
*)0);
while ((fs
= getfsent()) != 0)
if (strcmp(fs
->fs_type
, type
) == 0)
return ((struct fstab
*)0);