Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

nfssvc(2) [mojave man page]

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

NAME
nfssvc -- NFS services SYNOPSIS
#include <unistd.h> #include <nfs/nfs.h> int nfssvc(int flags, void *argstructp); DESCRIPTION
The nfssvc() function is used by the NFS server daemon to pass information into and out of the kernel and also to enter the kernel as a server daemon. The flags argument consists of several bits that show what action is to be taken once in the kernel and the argstructp points to any corresponding data that the action may require. nfssvc() is called with the flag NFSSVC_NFSD and a NULL argstructp to enter the kernel as an nfsd(8) daemon. The NFSSVC_NFSD action normally does not return until the NFS server is stopped. The nfsd(8) server daemon calls nfssvc() with the flag NFSSVC_ADDSOCK and a pointer to a struct nfsd_args { int sock; /* Socket to serve */ caddr_t name; /* Client address for connection based sockets */ int namelen; /* Length of name */ }; to pass a server side NFS socket into the kernel for servicing by the nfsd(8) daemons. The nfsd(8) server daemon calls nfssvc() with the flag NFSSVC_EXPORT and a pointer to a struct nfs_export_args { uint32_t nxa_fsid; /* export FS ID */ uint32_t nxa_expid; /* export ID */ char *nxa_fspath; /* export FS path */ char *nxa_exppath; /* export sub-path */ uint32_t nxa_flags; /* export arg flags */ uint32_t nxa_netcount; /* #entries in ex_nets array */ struct nfs_export_net_args *nxa_nets; /* array of net args */ }; to pass exported file system information into the kernel. RETURN VALUES
Upon successful completion, a value of 0 is returned. Otherwise, -1 is returned the global variable errno is set to specify the error. ERRORS
[EPERM] The caller is not the super-user. [EINVAL] The action specified by the flags argument was not valid. [EFAULT] argstructp points to an invalid address. [ENOMEM] A memory allocation failure prevented the action from completing. [EEXIST] An attempt was made to add a UDP socket via the NFSSVC_ADDSOCK action, but the UDP socket has already been added. SEE ALSO
nfsd(8) HISTORY
The nfssvc function first appeared in 4.4BSD. BUGS
The nfssvc system call is designed specifically for the NFS server daemons and as such is specific to their requirements. Several fields of the argument structures are assumed to be valid, such that nfssvc must be used with extreme care. BSD
January 9, 2007 BSD

Check Out this Related Man Page

nfsd(8) 						      System Manager's Manual							   nfsd(8)

NAME
nfsd - The remote NFS compatible server SYNOPSIS
/usr/sbin/nfsd [-t num_tcpthreads] [-u num_udpthreads] The following form of the nfsd command is not recommended and is supported only for backward compatibility: /usr/sbin/nfsd [numthreads] FLAGS
Specifies a number of TCP server threads (per RAD) to spawn. A value of 8 is recommended as a start. Specifies a number of UDP server threads (per RAD) to spawn. A value of 8 is recommended as a start. DESCRIPTION
The nfsd daemon runs on a server machine to service NFS requests from client machines. The daemon spawns a number of server threads that process NFS requests from client machines. At least one server thread must be running for a machine to operate as a server. There are two types of server threads: a server thread that processes NFS requests sent using TCP and a server thread that processes NFS requests sent using UDP. This is necessary because the kernel paths for UDP and TCP NFS messages are different. The -t option specifies the number of TCP threads to run and the -u option specifies the number of UDP threads to run. On systems that support Cache Coherent NUMA, the number of threads is per Resource Affinity Domain (RAD). As you add RADs, the NFS server will automatically scale by creating additional threads. NFS requests are processed by a particular RAD based on the file being accessed; this confines cached information about a file to a single RAD for efficiency. See numa_intro(3) for more information on the NUMA architec- ture. If you use the SysMan Menu to configure NFS, it sets the default at 8 UDP and 8 TCP threads. However, a user can have any number of TCP and UDP nfsd threads running up to a maximum of 128 threads. The optimal number of TCP server threads and UDP server threads depends on many factors. See nfsiod(8) for more information. The server threads are implemented as kernel threads; they are part of Process ID 0, not the nfsd process. The ps axml command displays idle server threads under PID 0. Idle threads will be waiting on nfs_udp_wait or nfs_tcp_wait. Therefore, if 16 server threads are config- ured, only one nfsd process is displayed in the output from the ps command, although 16 server threads are available to handle NFS requests. Files that are larger than 2 gigabytes are exported as 2 gigabyte files when accessed by NFS Version 2. NFS Version 2 is a 32-bit proto- col, therefore, the size and offset fields are 32-bit quantities (on Alpha UFS they are 64-bit quantities). Use caution when accessing files larger than 2 gigabytes from NFS clients. EXAMPLES
In the following example, 16 threads are run (8 for TCP and 8 for UDP): nfsd -t 8 -u 8 FILES
Specifies the command path Specifies the file for logging startup errors (before the server threads are started). Specifies the file for logging NFS errors (after the server threads are started). RELATED INFORMATION
Commands: mount(8), mountd(8), nfsconfig(8), nfsstat(8), portmap(8) System calls: nfssvc(2) delim off nfsd(8)
Man Page