mount (BPX1MNT) — Make a file system available

Function

The mount callable service mounts a file system, making the files in it available for use.

Note: There is no 64-bit version of the mount callable service. To get equivalent function, use __mount (BPX2MNT, BPX4MNT) — Make a file system available in 64-bit mode.

Requirements

Operation Environment
Authorization: Supervisor state or problem state, any PSW key
Dispatchable unit mode: Task
Cross memory mode: PASN = HASN
AMODE: 31-bit
ASC mode: Primary mode
Interrupt status: Enabled for interrupts
Locks: Unlocked
Control parameters: All parameters must be addressable by the caller and in the primary address space.

Format

CALL BPX1MNT,(MountPoint_length,
              MountPoint_name,
              File_system_name,
              File_system_type,
              Mount_mode,
              Parm_length,
              Parm,
              Return_value,
              Return_code,
              Reason_code)

Parameters

MountPoint_length
Supplied parameter
Type:
Integer
Length:
Fullword

The name of a fullword that contains the length of MountPoint_name.

MountPoint_name
Supplied parameter
Type:
Character string
Character set:
No restriction
Length:
Specified by the MountPoint_length parameter

The name of a field that contains the name of the mount point. The length of this field is specified in MountPoint_length.

File_system_name
Supplied parameter
Type:
Character string
Character set:
Printable characters
Length:
44 bytes

The name of a 44-character field that identifies the file system to be mounted. The name must be left-justified and padded with blanks.

File_System_type
Supplied parameter
Type:
Character string
Character set:
Printable characters
Length:
8 bytes

The name of a field that contains the 8-character file system type. This corresponds to the type of file system that was defined by a FILESYSTYPE parameter of the BPXPRMxx parmlib member.

Mount_mode
Supplied parameter
Type:
Structure
Length:
Fullword
The name of a fullword that contains binary flags. The flags can indicate:
  • The mount mode (read or read/write)
  • Whether the mount request must complete synchronously
  • Whether SETUID is not allowed
  • NOSECURITY.

This parameter is mapped by the macro BPXYMTM; see BPXYMTM — Map the modes for mount and unmount for details.

Parm_length
Supplied parameter
Type:
Integer
Length:
Fullword

The name of a fullword that contains the length of the file system-specific parameters (Parm). The maximum length is 500 bytes.

Parm
Supplied parameter
Type:
Character string
Character set:
No restriction
Length:
Parm_length bytes

The name of a field, of length Parm_length, that contains the file-system-specific parameters. These have a maximum of 500 bytes.

Return_value
Returned parameter
Type:
Integer
Length:
Fullword

The name of a fullword in which the mount service returns 0 or 1 if the request is successful, or -1 if it is not successful. A Return_value of 1 indicates that the mount will complete asynchronously.

Return_code
Returned parameter
Type:
Integer
Length:
Fullword
The name of a fullword in which the mount service stores the return code. The mount service always returns Return_code if Return_value is -1. See z/OS UNIX System Services Messages and Codes for a complete list of possible return code values. The mount service can return one of the following values in the Return_code parameter:
Return_code Explanation
EBUSY The file system to mount is quiesced; or no more locks are available. The following reason codes can accompany the return code: JROutOfLocks, JRQuiesced.
EINVAL There was a parameter error. Verify the Mount_mode and File_system_type. Other reasons for this error include:
  • The mount point is a root of a file system.
  • The file system is already mounted.
  • parm_length is too long.
  • A mounted file system has a real or alias name that conflicts with this mount request. One of these situations occurred:
    • A file system was previously mounted using an alias data set name, and the corresponding real data set name conflicts with the file system name specified by this mount request.
    • The file system name specified on this mount request is an alias data set name that has a real data set name which conflicts with the name of a previously mounted file system. Resolve the duplicate file system names.
    Resolve the duplicate file system names and reissue the mount request.
The following reason codes can accompany the return code: JROutOfLocks, JRQuiesced, JRIsMountedRealName.
EIO An I/O error occurred.
ELOOP A loop exists in symbolic links that were encountered during resolution of the Pathname argument. This error is issued if more than 24 symbolic links are detected in the resolution of Pathname.
ENOENT The mount point does not exist. The following reason code can accompany the return code: JRMountPt.
ENOMEM There is not enough storage space available to mount this file system.
ENOTDIR The mount point is not a directory. The following reason code can accompany the return code: JRMountPt.
EPERM Insufficient authority to do the mount.
Reason_code
Returned parameter
Type:
Integer
Length:
Fullword

The name of a fullword in which the mount service stores the reason code. The mount service returns Reason_code only if Return_value is -1. Reason_code further qualifies the Return_code value. For the reason codes, see z/OS UNIX System Services Messages and Codes.

Usage notes

  1. The mount service effectively creates a virtual file system. After a file system is mounted, references to the pathname that is mounted refer to the root directory on the mounted file system.
  2. A file system can be mounted at only one point.
  3. The physical file system might complete the mount operation asynchronously, which is indicated by a Return_value of 1. The w_getmntent callable service can then be used to determine if the file system has been mounted.

Related services

Characteristics and restrictions

  1. In order to mount a file system, the caller must be an authorized program, or must be running for a user with appropriate privileges (see Authorization).
  2. Typically, an EBUSY error condition is returned when a file system is quiesced. In a sysplex, however, the mount syscall is suspended until the file system becomes unquiesced.

Examples

For an example using this callable service, see BPX1MNT (mount) example.