vfsmount.2 (2010 09)
v
vfsmount(2) vfsmount(2)
(TO BE OBSOLETED)
NAME
vfsmount - mount a file system
SYNOPSIS
#include <sys/mount.h>
int vfsmount(int type,
const char *dir,
int flags,
caddr_t data);
Remarks
This routine is included only for compatibility with past releases. It works only with UFS (HFS), NFS,
and CDFS file systems. For maximum portability and improved functionality, new applications should
use the mount() system call (see mount (2)).
DESCRIPTION
The
vfsmount() system call attaches a file system to a directory. After a successful return, references
to directory dir 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 con-
tents are inaccessible while the file system is mounted.
type indicates the type of the file system. It must be one of the types described below.
vfsmount() does
not check that the file system is actually of type type ;iftype is incorrect,
vfsmount() may cause the
process to hang. To prevent such problems,
statfsdev() (see statfsdev (3C)) should be called before
vfsmount() to check the file system type, which statfsdev() places in the f_fsid[1] field of the
statfs structure that it returns.
The flags argument determines whether the file system can be written to. It also controls whether pro-
grams from the mounted file system are allowed to have set-user-ID execution. Physically write-protected
and magnetic tape file systems must be mounted read-only. Failure to do so results in a return of −1by
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-user-ID programs not permitted.
data is a pointer to a structure containing arguments specific to the value contained in type . The follow-
ing values for type are defined in
<sys/mount.h>
:
MOUNT_CDFS Mount a local CD-ROM file system. data points to a structure of the following for-
mat:
struct cdfs_args {
char *fspec;
};
fspec points to the name of the block special file that is to be mounted.
MOUNT_UFS Mount a local HFS file system. data points to a structure of the following format:
struct ufs_args {
char *fspec;
int flags;
};
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 of mount() (see mount(2)).
flags points to a bit map that sets options. The following values of the bits are
defined in
<sys/mount.h>:
MS_DELAY Specify that the writes to disks are to be delayed till the buffer
needs to be reused. This is the default.
MS_BEHIND Specify that the writes to disks are to be done asynchronously,
where possible, without waiting for completion.
MS_BEHIND and MS_DELAY are mutually exclusive.
HP-UX 11i Version 3: September 2010 − 1 − Hewlett-Packard Company 1