statvfs (BPX1STV, BPX4STV) — Get the file system status

Function

The statvfs callable service obtains status information about a file system that is specified by a file pathname from the desired file system.

Requirements

Operation Environment
Authorization: Supervisor state or problem state, any PSW key
Dispatchable unit mode: Task
Cross memory mode: PASN = HASN
AMODE (BPX1STV): 31-bit
AMODE (BPX4STV): 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 BPX1STV,(Pathname_length,
              Pathname,
              Status_area_length,
              Status_area,
              Return_value,
              Return_code,
              Reason_code)

AMODE 64 callers use BPX4STV with the same parameters.

Parameters

Pathname_length
Supplied parameter
Type:
Integer
Length:
Fullword

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

Pathname
Supplied parameter
Type:
Character string
Character set:
Printable characters
Length:
Pathname_length

The name of a field, of length Pathname_length, that specifies a file pathname in the file system about which status is desired.

Status_area_length
Supplied parameter
Type:
Integer
Length:
Fullword

The name of a fullword that contains the length of the area to which the service returns status information.

Status_area
Parameter supplied and returned
Type:
Structure
Length:
Specified by the Status_area_length parameter

The name of an area of length Status_area_length to which the service returns the status information for the file system. The BPXYSSTF macro maps this area. For information on this macro, see BPXYSSTF — Map response structure for file system status.

Return_value
Returned parameter
Type:
Integer
Length:
Fullword

The name of a fullword in which the statvfs service returns the length of the status written to the Status_area if the request is successful, or -1 if it is not successful.

Return_code
Returned parameter
Type:
Integer
Length:
Fullword
The name of a fullword in which the statvfs service stores the return code. The statvfs 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 statvfs service can return one of the following values in the Return_code parameter:
Return_code Explanation
EACCES The calling process does not have permission to search some component of the Pathname prefix.
EAGAIN Information is temporarily unavailable. This can occur if the mount process for the file system is not complete.
EINVAL Parameter error; for example, Status_area_length is too small. The following reason code can accompany the return code: JRBuffTooSmall.
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.
ENAMETOOLONG Pathname is longer than 1023 characters, or a component of the pathname is longer than 255 characters.
ENOENT No file named Pathname was found, or no pathname was specified. The following reason code can accompany the return code: JRFileNotThere.
ENOTDIR Some component of the Pathname prefix is not a directory.
Reason_code
Returned parameter
Type:
Integer
Length:
Fullword

The name of a fullword in which the statvfs service stores the reason code. The statvfs 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. Provided that the passed Status_area_length is not less than or equal to zero, it is not considered an error if the Status_area_length is not sufficient to hold all the requested information. (That is, future expansion is allowed for.) As much information as will fit is written to Status_area, and this amount is returned.
  2. The amount of valid data that is returned in the Status_area is indicated by the Return_value. This allows for differences in the release levels of z/OS UNIX and the physical file systems.

Related services

Characteristics and restrictions

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

Examples

For an example using this callable service, see BPX1STV (statvfs) example.