manual page distributed with 4.1BSD
[unix-history] / usr / src / lib / libc / gen / getfsent.3
.\" Copyright (c) 1980 Regents of the University of California.
.\" All rights reserved. The Berkeley software License Agreement
.\" specifies the terms and conditions for redistribution.
.\"
.\" @(#)getfsent.3 4.1 (Berkeley) %G%
.\"
.TH GETFSENT 3
.UC 4
.SH NAME
getfsent, getfsspec, getfsfile, setfsent, endfsent \- get file system descriptor file entry
.SH SYNOPSIS
.nf
.B #include <fstab.h>
.PP
.B struct fstab *getfsent()
.PP
.B struct fstab *getfsspec(name)
.B char *name;
.PP
.B struct fstab *getfsfile(name)
.B char *name;
.PP
.B int setfsend()
.PP
.B int endfsent()
.fi
.SH DESCRIPTION
.I Getfsent,
.I getfsspec
and
.I getfsfile
each return a pointer to an object with the
following structure
containing the broken-out
fields of a line in the file system description file,
.I /usr/include/fstab.h.
.RS
.PP
.nf
#define FSNMLG 16
struct fstab{
char fs_spec[FSNMLG];
char fs_file[FSNMLG];
char fs_type[3];
int fs_freq;
int fs_passno;
};
.ft R
.ad
.fi
.RE
.PP
The fields have meanings described in
.IR fstab (5).
.PP
.I Getfsent
reads the next line of the file, opening the file if necessary.
.PP
.I Setfsent
opens and rewinds the file.
.PP
.I Endfsent
closes the file.
.PP
.I Getfsspec
and
.I getfsfile
sequentially search from the beginning
of the file until a matching
special file name or
file system file name is found,
or until EOF is encountered.
.SH FILES
/etc/fstab
.SH "SEE ALSO"
fstab(5)
.SH DIAGNOSTICS
Null pointer
(0) returned on EOF or error.
.SH BUGS
All information
is contained in a static area
so it must be copied if it is
to be saved.