mount -- Mount a File System

SYNOPSIS

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

 int mount(const char *mountPoint, char *fileSystem, char *fileSysType,
           mtm_t mountMode, int parmLength, char *parm);
 

DESCRIPTION

mount specifies a mount point for a file system, making it available within the hierarchical file system. Mounts must be requested by a superuser, and only one mount point may be specified for each file system.
mountPoint
specifies the mount point directory.
fileSystem
specifies the null-terminated name of the file system to be mounted. fileSystem is a 1- to 44-character MVS data set name that is specified as all uppercase letters.
fileSysType
specifies the type of the file system. The type is a maximum length of 8 characters and must match the TYPE operand of a FILESYSTYP statement in the BPXPRMxx parmlib member for the file system. The normal fileSysType is "HFS". Refer to MVS/ESA Initialization and Tuning Reference (SC28-1452) for more information on BPXPRMxx.
mountMode
determines the file system mode:
MTM_RDONLY
Read-only file system
MTM_RDWR
Read/Write file system
parmLength
specifies the length of the parm argument, up to a maximum of 1024 characters.
parm
is a parameter that is passed to the mounting file system specified by fileSysType. The content and format of parm is determined by the file system.

The parmLength and parm parameters are ignored when mounting a hierarchical file system (HFS) data set.

RETURN VALUE

mount returns 0 if the mount is successful and a -1 if it fails.

PORTABILITY

The mount function may be useful in OpenEdition applications; however, it is not defined by the POSIX.1 standard and should not be used in portable applications.

EXAMPLE

The following code fragment illustrates the use of mount to establish a mount point in the hierarchical file system.
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <stdio.h>

 main()
 {
    char *mountPoint = "/usr";
    char *HFS = "POSIX.FILE.SYSTEM";
    char *mountType[9] = "HFS     ";
    .
    .
    .
    if (mount(mountPoint, HFS, mountType, MTM_RDWR, 0, NULL) != 0)
       perror("error mounting file system");
    .
    .
    .
 }
 

RELATED FUNCTIONS

umount, w_getmntent, w_statfs


Copyright (c) 1998 SAS Institute Inc. Cary, NC, USA. All rights reserved.