IOCTL

The IOCTL macro is used to control certain operating characteristics for a socket.

Before you issue an IOCTL macro, you must load a value representing the characteristic that you want to control in COMMAND.
Note: IOCTL can only be used with programming languages that support address pointers

Format

Read syntax diagramSkip visual syntax diagramEZASMITYPE=IOCTL,S= numberaddress*indaddr(reg),COMMAND= 'FIONBIO'address*indaddr(reg),REQARG= address*indaddr(reg),RETARG= address*indaddr(reg),ERRNO= address*indaddr(reg),RETCODE= address*indaddr(reg),ECB=address* indaddr( reg),ERROR=address*indaddr(reg),TASK=address*indaddr(reg)

Parameters

S
Input parameter. A value, or the address of a halfword binary number specifying the socket to be controlled.
COMMAND
Input parameter. To control an operating characteristic, set this field to one of the following symbolic names. A value in a bit mask is associated with each symbolic name. By specifying one of these names, you are turning on a bit in a mask which communicates the requested operating characteristic to TCP/IP.
'FIONBIO'
Sets or clears blocking status.
REQARG and RETARG
Point to arguments that are passed between the calling program and IOCTL. The length of the argument is determined by the COMMAND request. REQARG is an input parameter and is used to pass arguments to IOCTL. RETARG is an output parameter and is used for arguments returned by IOCTL.
For the lengths and meanings of REQARG and RETARG see Table 1.
Table 1. IOCTL Macro Arguments
COMMAND/CODE SIZE REQARG SIZE RETARG
FIONBIO X'8004A77E' 4 Set socket mode to: X'00'=blocking; X'01'=nonblocking 0 Not used
ERRNO
Output parameter. A fullword binary field. If RETCODE is negative, ERRNO contains a valid error number. Otherwise, ignore ERRNO.

See ERRNO Values for information about ERRNO return codes.

RETCODE
Output parameter. A fullword binary field that returns one of the following:
Value
Description
0
Successful call
-1
Check ERRNO for an error code
ECB
Input parameter. It points to a 160-byte field containing:
  • A four-byte ECB posted by TCP/IP when the macro completes.
  • A 156-byte storage field used by the interface to save the state information.
Note: This storage must not be modified until the macro function has completed and the ECB has been posted .
ERROR
Input parameter. The location in your program to receive control, if the application programming interface (API) processing module cannot be loaded.
TASK
Input parameter. The location of the task storage area in your program.