umask (BPX1UMK, BPX4UMK) — Set the file mode creation mask

Function

The umask callable service changes the file mode creation mask of a process. The file mode creation mask is used by the security package to turn off permission bits in the mode parameter that is specified. Bit positions that are set in the file mode creation mask are cleared in the mode of the created file.

Requirements

Operation Environment
Authorization: Supervisor or problem state, any PSW key
Dispatchable unit mode: Task
Cross memory mode: PASN = HASN
AMODE (BPX1UMK): 31-bit
AMODE (BPX4UMK): 64-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 BPX1UMK,(File_mode_creation_mask,
              Return_value)

AMODE 64 callers use BPX4UMK with the same parameters.

Parameters

File_mode_creation_mask
Supplied parameter
Type:
Structure
Length:
Fullword

The name of a fullword that contains the file mode creation mask. This mask turns off permission bits in a file's mode. File_mode_creation_mask is mapped by the BPXYMODE macro (see BPXYMODE — Map the mode constants of the file services).

Return_value
Returned parameter
Type:
Integer
Length:
Fullword

The name of a fullword in which the umask service returns the previous value of the file mode creation mask. This fullword has the same mapping as the File_mode_creation_mask parameter.

Usage notes

  1. The umask service changes the process's file creation mask. This mask controls file permission bits that are set whenever the process creates a file. File permission bits that are turned on in the file creation mask are turned off in the file permission bits of files that are created by the process. For example, if a call to the open (BPX1OPN, BPX4OPN) service specifies a "mode" argument with file permission bits, the process's file creation mask affects that argument: Bits that are on in the mask are turned off in the "mode" argument, and therefore in the mode of the created file.
  2. Only the file permission bits of the new mask are used. For example, the type of file field in File_Mode cannot be masked.

Related services

Characteristics and restrictions

There are no restrictions on the use of the umask service.

Examples

For an example using this callable service, see BPX1UMK (umask) example.