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


vfs_socket — Create a socket or a socket pair

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

Function

The vfs_socket operation creates one socket or two related sockets.

Environment on entry and exit

See Environment for PFS operations.

Input parameter format

vfs_socket  (Token_structure,
             OSI_structure,
             Audit_structure,
             Domain,
             Type,
             Protocol,
             Array_dimension,
             Vnode_token_array,
             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 system (VFS) that is being operated on. It contains the PFS's initialization token and mount 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.

Domain
Supplied parameter
Type:
Integer
Length:
Fullword

A fullword that contains a number that represents the address family the socket is to be created for. The values defined for this field are mapped by socket.h.

Type
Supplied parameter
Type:
Integer
Length:
Fullword

A fullword that contains a number that represents the socket type. The values defined for this field are mapped by socket.h.

Protocol
Supplied parameter
Type:
Integer
Length:
Fullword

A fullword that contains a number that represents the protocol to be used with the socket.

Array_dimension
Supplied parameter
Type:
Integer
Length:
Fullword

A fullword that specifies the number of Vnode_tokens to get. The allowable values for this field are 1 (for the socket call) and 2 (for the socketpair call).

Vnode_token_array
Returned parameter
Type:
Token
Length:
16 bytes

A two-element array that contains the one or two Vnode_tokens obtained.

Return_value
Returned parameter
Type:
Integer
Length:
Fullword
A fullword in which the vfs_socket operation returns the results of the operation, as one of the following:
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
The operation was successful.
Return_code
Returned parameter
Type:
Integer
Length:
Fullword

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

The vfs_socket operation should support at least the following error values:
Return_code Explanation
EAFNOSUPPORT The address family that is specified by Domain is not supported by this PFS.
EINVAL The socket type that was specified is not supported; or the Array_dimension that was specified is incorrect. If the PFS does not support the socketpair() call, an Array_dimension of 2 is incorrect.
EPROTONOSUPPORT The protocol that was specified is not supported.
Reason_code
Returned parameter
Type:
Integer
Length:
Fullword

A fullword in which the vfs_socket operation stores the reason code. The vfs_socket 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 vfs_socket processing
See Creating, referring to, and closing socket vnodes for general information about sockets.

For more information about the semantics of this operation, refer to the publications that are mentioned in Finding more information about sockets for the socket() and socketpair() functions.

Specific processing notes
If the PFS does not support socketpair(), the LFS simulates this function by creating and connecting two separate sockets. This is done in response to a Return_Code of EINVAL when Array_dimension is two.
Serialization provided by the LFS
The vfs_socket operation is invoked with a shared latch held on the domain of the PFS.
Security calls to be made by the PFS
None.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014