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


vn_srx — Send or receive CSM buffers

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

Function

The vn_srx operation sends or receives data using CSM (Communications Storage Manager) buffers.

Environment on entry and exit

See Environment for PFS operations.

Input parameter format

vn_srx      (Token_structure,
             OSI_structure,
             Audit_structure,
             Open_flags,
             User_IO_structure,
             Return_value,
             Return_code,
             Reason_code)

Parameters

Token_structure
Supplied parameter
Type:
TOKSTR
Length:
Specified by TOKSTR.ts_hdr.cblen.

The Token_structure represents the file (vnode) that is being operated on. It contains the PFS's initialization token, mount token, and file token. Refer to LFS/PFS control block structure for a discussion of this structure, and to the TOKSTR typedef in BPXYPFSI in Interface structures for C language servers and clients for its mapping.

OSI_structure
Supplied and returned parameter
Type:
OSI
Length:
Specified by OSI.osi_hdr.cblen.

The OSI_structure contains information that is used by the OSI operations that may be called by the PFS. See OSI services for more information.

It also contains MVS-specific information that needs to be passed to the PFS, including SMF accounting fields, a work area, a recovery area, and an optional pointer to an output ATTR structure. For more details on the OSI structure, see The OSI structure.

This area is mapped by the OSI typedef in BPXYPFSI in Interface structures for C language servers and clients.

Audit_structure
Supplied parameter
Type:
CRED
Length:
Specified by CRED.cred_hdr.cblen.

The Audit_structure contains information that is used by the security product for access checks and auditing. It is passed to most SAF routines that are invoked by the PFS.

Refer to Security responsibilities and considerations for a discussion of security processing, and to the CRED typedef in BPXYPFSI in Interface structures for C language servers and clients for the mapping of this structure.

Open_flags
Supplied parameter
Type:
Structure
Length:
Fullword

A fullword that contains the bits that are associated with the socket. The defined values for this field are mapped by fcntl.h.

User_IO_structure
Supplied and returned parameter
Type:
UIO
Length:
Specified by UIO.u_hdr.cblen.

An area that contains the parameters for the I/O that is to be performed. This area is mapped by the UIO typedef in the BPXYVFSI header file (see Interface structures for C language servers and clients). See "Specific processing notes" for information about how the fields in this structure are processed.

Return_value
Returned parameter
Type:
Integer
Length:
Fullword
A fullword in which the vn_srx operation returns the results of the operation, as one of the following values:
Return_value
Meaning
-1
The operation was not successful. The Return_code and Reason_Code values must be filled in by the PFS when Return_value is -1.
0 or greater
The operation was successful. The value represents the number of bytes that were transferred.
Return_code
Returned parameter
Type:
Integer
Length:
Fullword

A fullword in which the vn_srx operation stores the return code. The vn_srx operation returns Return_code only if Return_value is -1. See z/OS UNIX System Services Messages and Codes for a complete list of supported return code values.

The vn_srx operation should support at least the following error values:
Return_code Explanation
EFAULT A buffer address that was specified is not in addressable storage.
EINVAL An incorrect parameter was specified.
EWOULDBLOCK A socket that has been defined as nonblocking cannot complete its operation without blocking.
Reason_code
Returned parameter
Type:
Integer
Length:
Fullword

A fullword in which the vn_srx operation stores the reason code. The vn_srx operation returns Reason_code only if Return_value is -1. Reason_code further qualifies the Return_code value. These reason codes are documented by the PFS.

Implementation notes

Overview of vn_srx processing

The Communications Storage Manager (CSM) provides a facility that allows programs to avoid data moves on a communications session by transferring buffer ownership instead of copying the buffer contents. See z/OS Communications Server: CSM Guide for more information about CSM.

The controlling parameters of the vn_srx operation are passed in a msghdrx structure, which is pointed to from the UIO. Included in the msghdrx is a pointer to an array of structures, each of which points to a data buffer that is obtained from CSM. For more information about the msghdrx structure and the semantics of this operation, see srx_np (BPX1SRX, BPX4SRX) — Send or receive CSM buffers on a socket in z/OS UNIX System Services Programming: Assembler Callable Services Reference.

The vn_srx call can be used on either connected or unconnected sockets.

Specific processing notes
  • The following UIO fields are provided by the LFS:
    UIO.u_hdr.cbid
    Contains UIO_ID (from the BPXYVFSI header file)
    UIO.u_hdr.cblen
    Specifies the length of the user_IO_structure
    UIO.u_buffaddr
    Specifies the address of a primary address space copy of the caller's msghdrx structure
    UIO.u_buffalet
    Specifies the ALET, 0, of the msghdrx structure
    UIO.u_count
    Specifies the length of the msghdrx structure that is being passed
    UIO.u_asid
    Specifies the ASID of the caller
    UIO.u_rw
    Specifies whether the request is a read (0) or a write (1)
    UIO.u_key
    Specifies the storage key of the caller
  • The msghdrx structure is defined in bpxysrxh.h.
  • The user's msghdrx is copied into the kernel by the LFS, and this copy is passed to the PFS. This kernel msghdrx, with any changes that are made by the PFS, is copied back to the user after the operation.
  • The use of Msghdrx_length=0 in BPX1SRX to determine support for this operation is handled by the LFS, and not passed down to the PFS.
Serialization provided by the LFS

The vn_srx operation is invoked with an exclusive latch held on the vnode.

Security calls to be made by the PFS
None.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014