NFSMOUNT(2)

NAME
nfsmount - mount an NFS file system

SYNOPSIS
nfsmount(addr, fh, dir, rwflag, hard)
struct sockaddr_in *addr;
fhandle_t *fh;
char *dir;
int rwflag;
int hard;

DESCRIPTION
Mount an NFS(4) file system on the directory dir. addr is the UDP(4) address of the server that owns the file system to mount. fh is a file handle, obtained from the server, to identify the root directory on the server that is being mounted.

The rwflag argument determines whether the file system can be written on; if it is 0 writing is allowed, otherwise no writing is done.

The hard argument determines whether the remote file system is mounted hard or soft. A soft mount causes an error to be returned when a remote access times out. Hard mounts cause the access to retry until the server responds. A value of 1 indicates a hard mount.

RETURN VALUE
nfsmount returns 0 if the action occurred, -1 if some error occurred.

ERRORS
nfsmount will fail when one of the following occurs:

[EPERM]
    The caller is not the super-user or the path name given for dir contains characters with the high bit set.

[ENAMETOOLONG]
    The path name for dir is too long.

[ELOOP]
    Dir contains a symbolic link loop.

[ETIMEDOUT]
    The server at addr is not accessible. This can only happen if the hard flag is set.

[ENOTDIR]
    A component of the path prefix in dir is not a directory.

[EBUSY]
    Another process currently holds a reference to fh.

[ENOENT]
    Dir does not exist.

[EACCES]
    Search permission is denied for a component of the path prefix of dir.

[EFAULT]
    Dir points outside the process's allocated address space.

[EIO]
    An I/O error occurred while reading from or writing to the file system.

SEE ALSO
mount(2), unmount(2), mount(8)