exportent(3C) DG/UX R4.11MU05 exportent(3C)
NAME
exportent, getexportent, setexportent, addexportent, remexportent,
endexportent, getexportopt - access exported file system information
SYNOPSIS
#include <stdio.h>
#include <exportent.h>
FILE *setexportent()
struct exportent *getexportent(filep)
FILE *filep;
int addexportent(filep, dirname, options)
FILE *filep;
char *dirname;
char *options;
int remexportent(filep, dirname)
FILE *filep;
char *dirname;
char *getexportopt(xent, opt)
struct exportent *xent;
char *opt;
void endexportent(filep)
FILE *filep;
DESCRIPTION
These routines access the exported filesystem information in
/etc/xtab.
setexportent opens the export information file (creating it if it
does not already exist) and returns a file pointer to use with
getexportent, addexportent, remexportent, and endexportent. You must
have appropriate privilege to call setexportent. getexportent reads
the next line from filep and returns a pointer to an object with the
following structure containing the broken-out fields of a line in the
file /etc/xtab:
#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 ANON_OPT ``anon'' /* uid for anonymous requests */
#define WINDOW_OPT ``window'' /* expiration window for credential */
struct exportent {
char *xent_dirname; /* directory (or file) to export */
char *xent_options; /* options, as above */
};
For more information about the fields, see exports(5).
addexportent adds the exportent to the end of the open file filep.
It returns 0 if successful and -1 on failure. remexportent removes
the indicated entry from the list. It also returns 0 on success and
-1 on failure. getexportopt scans the xent_options field of the
exportent structure for a substring that matches opt. It returns the
string value of opt, or NULL if the option is not found.
endexportent closes the file.
ACCESS
You must have appropriate privilege to execute setexportent. On a
generic DG/UX system, appropriate privilege is granted by having an
effective UID of 0 (root). See the appropriate_privilege(5) man page
for more information.
On a system with DG/UX information security, appropriate privilege is
granted by having one or more specific capabilities enabled in the
effective capability set of the user. See cap_defaults(5) for the
default capabilities for this command.
FILES
/etc/exports
/etc/xtab
SEE ALSO
exportfs(1M), exports(4), xtab(4).
DIAGNOSTICS
A NULL pointer (0) or -1 is returned on EOF or error.
NOTES
The returned exportent structure points to static information that is
overwritten in each call.
Licensed material--property of copyright holder(s)