z/OS UNIX System Services File System Interface Reference
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


v_access (BPX1VAC, BPX4VAC) — Check file accessibility

z/OS UNIX System Services File System Interface Reference
SA23-2285-00

Function

The v_access service verifies that the caller has the requested access permissions to the object that is represented by Vnode_token.

Requirements

Operation Environment
Authorization: Supervisor state or problem state, any PSW key
Dispatchable unit mode: Task
Cross memory mode: PASN = HASN
AMODE (BPX1VAC): 31-bit
AMODE (BPX4VAC): 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 BPX1VAC,(Vnode_token,
              OSS,
              Mode,
              Return_value,
              Return_code,
              Reason_code)

AMODE 64 callers use BPX4VAC with the same parameters.

Parameters

Vnode_token
Supplied parameter
Type:
Token
Length:
8 bytes

The name of an 8-byte area that contains a vnode token that represents the file or directory.

OSS
Supplied and returned parameter
Type:
Structure
Length:
OSS#LENGTH (from the BPXYOSS macro)

The name of an area that contains operating-system-specific parameters. This area is mapped by the BPXYOSS macro (see BPXYOSS — Map operating system specific information).

Mode
Supplied parameter
Type:
Integer
Length:
Fullword

The name of a fullword that contains the permissions to be checked. This area is mapped by the BPXYMODE macro (see Mapping macros in z/OS UNIX System Services Programming: Assembler Callable Services Reference).

The read, write, and execute permissions that are to be checked are set in the Owner permission bits of the Mode (the S_IRUSR, S_IWUSR and S_IXUSR bits).

Return_value
Returned parameter
Type:
Integer
Length:
Fullword

The name of a fullword in which the v_access service returns the results of the access check.

When the request is successful, the permission bits that correspond to the caller's allowed access for each of the input mode bits are returned here. This is in the same format as the input Mode parameter, and is therefore a subset of the input Mode bits.

If the request is not successful, -1 is returned.

Return_code
Returned parameter
Type:
Integer
Length:
Fullword
The name of a fullword in which the v_access service stores the return code. The v_access service returns Return_code only if Return_value is -1. See z/OS UNIX System Services Messages and Codes for a complete list of possible return code values. The v_access service can return the following value in the Return_code parameter:
Return_code Explanation
EINVAL Parameter error; something other than the Owner's permission bits were set.
Reason_code
Returned parameter
Type:
Integer
Length:
Fullword

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

Usage notes

  1. This service is similar to the access() function, but the return of information is handled differently, as follows:
    0
    Access is denied for all of the bits that were on in the Mode parameter.
    Greater then zero
    The permissible access is represented by the non-zero bits that are returned here.
    -1
    The service has failed for some reason other than an access failure.
  2. The caller's real UID and real GID are used to check for the access that is requested.
  3. All access is allowed to symbolic link files, regardless of the file's mode setting. This does not imply anything about whether access to the file that is pointed to by the symbolic link would be granted.
  4. The setting of the AttrLP64times bit in the BPXYATT structure, and not the AMODE of the caller, determines whether 4-byte or 8-byte time fields are used.

Characteristics and restrictions

A process must be registered as a server before it can invoke the v_access service; see v_reg (BPX1VRG, BPX4VRG) — Register a process as a server.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014