fpathconf (BPX1FPC, BPX4FPC) — Determine configurable path name variables using a descriptor

Function

The fpathconf callable service determines the current values of a configurable limit or option (variable) that is associated with a file or directory.

Requirements

Operation Environment
Authorization: Supervisor state or problem state, any PSW key
Dispatchable unit mode: Task
Cross memory mode: PASN = HASN
AMODE (BPX1FPC): 31-bit
AMODE (BPX4FPC): 64-bit
ASC mode: Primary address space control (ASC) 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

The syntax is as follows:

AMODE 64 callers use BPX4FPC with the same parameters.

Parameters

File_descriptor
Supplied parameter
Type:
Integer
Length:
Fullword

The name of a fullword that contains the file descriptor of the file.

Name
Supplied parameter
Type:
Integer
Length:
Fullword
The name of a fullword that contains a value that indicates which configurable limit or option (variable) is to be returned in the Return_value. Use the BPXYPFC macro (see BPXYPCF — Command values for pathconf and pathconf) to specify the path name variable you want returned. The following table shows the variables that can be returned:
Variable returned Description
PC_CHOWN_RESTRICTED The change ownership ( chown (BPX1CHO, BPX4CHO) — Change the owner or group of a file or directory) function is restricted to processes with appropriate privileges (see Authorization). The group ID (GID) of a file can be changed only to the effective group ID of the process, or to one of its supplementary group IDs.
PC_LINK_MAX The maximum value of a file's link count.
PC_MAX_CANON The maximum number of bytes in a terminal canonical input line.
PC_MAX_INPUT The minimum number of bytes for which space will be available in a terminal input queue. This is the maximum number of bytes a portable application may require to be typed as input before it reads them.
PC_NAME_MAX The maximum number of bytes in a file name (not a string length; the count excludes a terminating null).
PC_NO_TRUNC Path name components longer than 255 bytes generate an error.
PATH_MAX The maximum number of bytes in a path name (not a string length; the count excludes a terminating null).
PIPE_BUF The maximum number of bytes that can be written atomically when writing to a pipe.
_POSIX_VDISABLE Terminal special characters maintained by the system can be disabled using this character value. For information on querying and setting these special characters, see tcgetattr (BPX1TGA, BPX4TGA) — Get the attributes for a terminal or tcsetattr (BPX1TSA, BPX4TSA) — Set the attributes for a terminal.
PC_ACL The security product supports access control lists.
PC_ACL_ENTRIES_MAX The maximum number of entries that can be placed in an access control list for the specified file.
Return_value
Returned parameter
Type:
Integer
Length:
Fullword

The name of a fullword in which the fpathconf service returns the current value of the Pathname variable that corresponds to the Name specified, or -1 if the request is not successful.

If the named Pathname variable does not have a limit for the specified file, Return_value is set to -1 and the Return_code and Reason_code remain unchanged.

If PC_CHOWN_RESTRICTED is specified for Name, and PC_CHOWN_RESTRICTED is active, Return_value is set to 1.

If PC_CHOWN_RESTRICTED is specified for Name, and PC_CHOWN_RESTRICTED is not active, Return_value is set to 0.

If PC_NO_TRUNC is specified for Name, and PC_NO_TRUNC is active, Return_value is set to 1.

If PC_NO_TRUNC is specified for Name, and PC_NO_TRUNC is not active, Return_value is set to 0.

If PC_ACL is specified for Name, and PC_ACL is supported, Return_value is set to 1.

If PC_ACL is specified for Name, and PC_ACL is not supported, Return_value is set to 0.

Return_code
Returned parameter
Type:
Integer
Length:
Fullword

The name of a fullword in which the fpathconf service stores the return code. The fpathconf service returns Return_code only if Return_value is -1. For a complete list of possible return code values, see z/OS UNIX System Services Messages and Codes.

If the named Pathname variable does not have a limit for the specified file, Return_value is -1 and Return_code is unchanged. Otherwise, the fpathconf service can return one of the following values in the Return_code parameter:
Return_code Explanation
EBADF The File_descriptor argument is not a valid file descriptor.
EINVAL Refer to the usage notes for situations in which this is returned.
Reason_code
Returned parameter
Type:
Integer
Length:
Fullword

The name of a fullword where the fpathconf service stores the reason code. The fpathconf 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. If Name refers to MAX_CANON, MAX_INPUT, or _POSIX_VDISABLE, the following applies:
    • If File_descriptor does not refer to a terminal file, the function returns -1 in Return_value and sets the Return_code to EINVAL.
  2. If Name refers to NAME_MAX, PATH_MAX, or _POSIX_NO_TRUNC, the following applies:
    • If File_descriptor does not refer to a directory, the function still returns the requested information using the parent directory of the specified file.
  3. If Name refers to PC_PIPE_BUF, the following applies:
    • If File_descriptor refers to a pipe or a FIFO, the value returned applies to the referred-to object itself. If File_descriptor refers to a directory, the value returned applies to any FIFOs that exist or that can be created within the directory. If File_descriptor refers to any other type of file, the function returns -1 in Return_value and sets the Return_code to EINVAL.
  4. If Name refers to PC_LINK_MAX, the following applies:
    • If File_descriptor refers to a directory, the value returned applies to the directory.

Characteristics and restrictions

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

Examples

For an example using this callable service, see BPX1FPC (fpathconf) example.