Switch to SpeakEasy.net DSL

The Modular Manual Browser

Home Page
Manual: (OpenBSD-5.7)
Apropos / Subsearch:
optional field

NFSSVC(2)                   BSD System Calls Manual                  NFSSVC(2)

     nfssvc -- NFS services

     #include <&lt;unistd.h>&gt;
     #include <&lt;nfs/nfs.h>&gt;

     nfssvc(int flags, void *argstructp);

     The nfssvc() function is used by NFS daemons to pass information into the
     kernel and also to enter the kernel as a server daemon.  The flags argu-
     ment consists of several bits that show what action is to be taken once
     in the kernel and the argstructp points to one of two structures depend-
     ing on which bits are set in flags.

     To enter an nfsd(8) daemon into the kernel, nfssvc() is called with the
     flag NFSSVC_NFSD and a pointer to a structure:

     struct nfsd_srvargs {
             struct nfsd     *nsd_nfsd;   /* Pointer to in kernel nfsd struct */
             uid_t           nsd_uid;        /* Effective uid mapped to cred */
             u_int32_t       nsd_haddr;      /* IP address of client */
             struct xucred   nsd_cr;         /* Cred. uid maps to */
             int             nsd_authlen;    /* Length of auth string (ret) */
             u_char          *nsd_authstr;   /* Auth string (ret) */
             int             nsd_verflen;    /* and the verifier */
             u_char          *nsd_verfstr;
             struct timeval  nsd_timestamp;  /* timestamp from verifier */
             u_int32_t       nsd_ttl;        /* credential ttl (sec) */

     To add further sockets for processing by the nfsd(8) server daemons the
     master nfsd(8) daemon  calls nfssvc() with the flag NFSSVC_ADDSOCK and a
     pointer to a structure:

     struct nfsd_args {
             int     sock;     /* Socket to serve */
             caddr_t name;     /* Client address for connection based sockets */
             int     namelen;  /* Length of name */

     Normally nfssvc does not return unless the server is terminated by a sig-
     nal when a value of 0 is returned.  Otherwise, -1 is returned and the
     global variable errno is set to specify the error.

     [EPERM]            The caller is not the superuser.

     [EINVAL]           The flag argument consisted of incompatible or other-
                        wise unsupported bits.

     mount_nfs(8), nfsd(8), sysctl(8)

     The nfssvc function first appeared in 4.4BSD.

     The nfssvc system call is designed specifically for the NFS support dae-
     mons and as such is specific to their requirements.  Several fields of
     the argument structures are assumed to be valid and sometimes to be
     unchanged from a previous call, such that nfssvc() must be used with
     extreme care.

BSD                            December 16, 2014                           BSD