Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ vfsmount(2) — HP-UX 6.20

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

mount(2)

umount(2)

mount(1M)

VFSMOUNT(2)  —  HP-UX

NAME

vfsmount − mount a file system

SYNOPSIS

#include <sys/types.h>
#include <sys/mount.h>

int vfsmount(type, dir, flags, data)
int type;
char *dir;
int flags;
caddr_t data;

DESCRIPTION

Vfsmount attaches a file system to a directory.  After a successful return, references to directory dir will refer to the root directory of the newly mounted file system.  Dir is a pointer to a null-terminated string containing a path name.  Dir must exist already, and must be a directory.  Its old contents are inaccessible while the file system is mounted.  Vfsmount differs from mount(2) in its ability to mount other than just a local file system.

Type indicates the type of the file system.  It must be one of the types described below. 

The flags argument determines whether the file system can be written on (functionally identical to the rwflag argument in mount(2) in this regard). It also controls whether programs from the mounted file system are allowed to have set-uid execution. Physically write-protected and magnetic tape file systems must be mounted read-only.  Failure to do so will result in a return of -1 by vfsmount and a value of EIO in errno.  The following values for the flags argument are defined in <sys/mount.h>:

M_RDONLY Mount done as read-only. 

M_NOSUID Execution of set-uid programs not permitted. 

Data is a pointer to a structure that contains arguments specific to the value contained in type. The following value for type is defined in <sys/mount.h>:

MOUNT_UFS
Mount a local file system. Data points to a structure of the following format:

struct ufs_args {
char    *fspec;
};

Fspec points to the name of the block special file that is to be mounted.  This is identical in use and function to the first argument for mount(2).

NETWORKING FEATURES

NFS

An additional value for the type argument is supported. 

MOUNT_NFS
Mount an NFS file system. Data points to a structure of the following format:

#include<nfs/nfs.h>
#include<netinet/in.h>
struct nfs_args {
struct sockaddr_in  *addr;
fhandle_t*fh;
intflags;
intwsize;
intrsize;
inttimeo;
intretrans;
char*hostname;
};

Addr points to a local socket address structure (see inet(7)), which is used by the system to communicate with the remote file server.

Fh points to a structure containing a file handle, an abstract data type that is used by the remote file server in serving a NFS request.

Flags is a bit map that sets options and indicates which of the following fields contain valid information.  The following values of the bits are defined in <nfs/nfs.h>:

NFSMNT_SOFT Specify whether the mount is a soft mount or a hard mount.  If set, the mount is soft and will cause requests to be retried retrans number of times.  Otherwise, the mount is hard and requests will be tried forever. 

NFSMNT_WSIZE Set the write size. 

NFSMNT_RSIZE Set the read size. 

NFSMNT_TIMEO Set the initial timeout value. 

NFSMNT_RETRANS
Set the number of request retries.

NFSMNT_HOSTNAME
Set a hostname.

NFSMNT_INT Set the option to have interruptible I/O to the mounted file system. 

Wsize can be used to advise the system on the maximum number of data bytes to use for a single outgoing protocol (such as UDP) message.  This value must be greater than 0.  The default is 8192. 

Rsize can be used to advise the system on the maximum number of data bytes to use for a single incoming protocol (such as UDP) message.  This value must be greater than 0.  The default is 8192. 

Timeo can be used to advise the system on the time to wait between NFS request retries.  This is in units of 0.1 seconds.  This value must be greater than 0.  The default is 7. 

Retrans can be used to advise the system on the number of times the system will resend a request.  This value must be 0 or greater.  The default is 4. 

Hostname is a name for the file server that can be used when any messages are given concerning the server.  The string can be of length from 0 to 32 characters. 

RETURN VALUE

Upon successful completion, vfsmount returns a value of 0.  Otherwise, no file system is mounted, a value of -1 is returned and errno is set to indicate the error. 

ERRORS

Vfsmount will fail when one of the following occurs:

[EBUSY] Dir is not a directory, or another process currently holds a reference to it. 

[EBUSY] No space remains in the mount table. 

[EBUSY] The super block for the file system had a bad magic number or an out-of-range block size. 

[EBUSY] Not enough memory was available to read the cylinder group information for the file system. 

[EFAULT] Data or dir points outside the allocated address space of the process. 

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

[ELOOP] Too many symbolic links were encountered in translating the path name of file system referred to by data or dir.

[ENAMETOOLONG]
The path name of the file system referred to by data or dir was too long. 

[ENOENT] The file system referred to by data or dir does not exist. 

[ENOENT] The file system referred to by data does not exist. 

[ENOTBLK] The file system referred to by data is not a block device.  This is for a local mount. 

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

[ENOTDIR] A component of the path prefix of the file system referred to by data or dir is not a directory. 

[ENXIO] The major device number of the file system referred to by data is out of range (this indicates no device driver exists for the associated hardware). 

[EPERM] The caller is not the super-user. 

DEPENDENCIES

NFS

ERRORS
Vfsmount will fail when one of the following occurs:

[EFAULT] A pointer in the data structure points outside the process’s allocated address space. 

[EINVAL] A value in a field of data is out of proper range. 

[EREMOTE] An attempt was made to remotely mount a file system that was already mounted from another remote node. 

WARNINGS
Using vfsmount to mount a NFS file system requires many previous activities to establish communications with the file server.  Instead, it is recommended that users use the mount(1M) command because it can vary the options of the mount as well as can be done using vfsmount directly.  Mount(1M) also maintains the /etc/mnttab file, which lists what file systems are mounted. 

SEE ALSO
getfh(2), inet(7), mountd(1M).

Series 300 Diskless
Vfsmount of a local file system (MOUNT_UFS) is not supported from a diskless node.  Such a call returns an EINVAL error. 

AUTHOR

Vfsmount was developed by HP and Sun Microsystems, Inc. 

SEE ALSO

mount(2), umount(2), mount(1M). 

Hewlett-Packard Company  —  May 11, 2021

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026