112 lines
2.7 KiB
Groff
112 lines
2.7 KiB
Groff
'\"macro stdmacro
|
|
.\" @(#)exportent.3 1.4 88/03/01 D/NFS
|
|
.\" @(#)exportent.3 1.9 88/03/01 SMI;
|
|
.TH EXPORTENT 3
|
|
.SH NAME
|
|
exportent, getexportent, setexportent, addexportent, remexportent, endexportent, getexportopt \- get exported file system information
|
|
.SH SYNOPSIS
|
|
.B "#include <stdio.h>
|
|
.br
|
|
.B "#include <exportent.h>
|
|
.PP
|
|
.B "\s-1FILE\s0 \(**setexportent(void);
|
|
.PP
|
|
.B "struct exportent \(**getexportent(\s-1FILE\s0 \(**filep);
|
|
.PP
|
|
.B "int addexportent(\s-1FILE\s0 \(**filep, char \(**dirname, char \(**options);
|
|
.PP
|
|
.B "int remexportent(\s-1FILE\s0 \(**filep, char \(**dirname);
|
|
.PP
|
|
.B "char \(**getexportopt(struct exportent \(**xent, char \(**opt);
|
|
.PP
|
|
.B "void endexportent(\s-1FILE\s0 \(**filep);
|
|
.SH DESCRIPTION
|
|
.LP
|
|
These routines access the exported filesystem information in
|
|
.IR /etc/xtab .
|
|
.LP
|
|
.I setexportent
|
|
opens the export information file and returns
|
|
a file pointer to use with
|
|
.IR getexportent ,
|
|
.IR addexportent ,
|
|
.IR remexportent ,
|
|
and
|
|
.IR endexportent .
|
|
.I getexportent
|
|
reads the next line from
|
|
.I filep
|
|
and returns a pointer to an object with the following structure
|
|
containing the broken-out fields of a line in the file,
|
|
.IR /etc/xtab .
|
|
The fields have meanings described in
|
|
.IR exports (4).
|
|
\s-2\f7
|
|
.in -3
|
|
.nf
|
|
#define ACCESS_OPT ``access'' /* machines that can mount fs */
|
|
#define ROOT_OPT ``root'' /* machines with root access of fs */
|
|
#define RO_OPT ``ro'' /* export read-only */
|
|
#define RW_OPT ``rw'' /* export read-mostly */
|
|
#define ANON_OPT ``anon'' /* uid for anonymous requests */
|
|
#define NOHIDE_OPT ``nohide'' /* visible from upper-exported fs */
|
|
struct exportent {
|
|
char *xent_dirname; /* directory (or file) to export */
|
|
char *xent_options; /* options, as above */
|
|
};
|
|
.fi
|
|
.in
|
|
\f1\s0
|
|
.LP
|
|
.I addexportent
|
|
adds the
|
|
.I exportent
|
|
to the end of the open file
|
|
.IR filep .
|
|
It returns 0 if successful and \-1 on failure.
|
|
.I remexportent
|
|
removes the indicated entry from the list. It also returns 0 on
|
|
success and \-1 on failure.
|
|
.I getexportopt
|
|
scans the
|
|
.I xent_options
|
|
field of the
|
|
.I exportent
|
|
structure for a substring that matches
|
|
.IR opt .
|
|
It returns the string value of
|
|
.IR opt ,
|
|
or
|
|
.SM NULL
|
|
if the option is not found.
|
|
.LP
|
|
.I endexportent
|
|
closes the file.
|
|
.SH NOTE
|
|
The \f3\s-1NOHIDE_OPT\s0\f1 option is specific to IRIX.
|
|
.P
|
|
To compile and link a program that calls these routines,
|
|
follow the procedures for section (3Y) routines as
|
|
described in
|
|
.IR intro (3).
|
|
.SH FILES
|
|
.PD 0
|
|
.TP 20
|
|
/etc/exports
|
|
.TP
|
|
/etc/xtab
|
|
.PD
|
|
.SH SEE ALSO
|
|
exportfs(1M), exports(4).
|
|
.SH DIAGNOSTICS
|
|
.LP
|
|
.SM NULL
|
|
pointer (0) returned on
|
|
.SM EOF
|
|
or error.
|
|
.SH BUGS
|
|
.LP
|
|
The returned
|
|
.I exportent
|
|
structure points to static information that is overwritten in each call.
|