TCP/IP Programming Manual
exceptions to this rule are accept_nw2, recvfrom_nw, recvfrom_nw64_,send_nw2,
send_nw2_64_, sendto_nw, sendto_nw64_, t_recvfrom_nw, t_recvfrom_nw64_,
t_sendto_nw and t_sendto_nw64_, which have different sets of parameters.
In addition, a nowait I/O operation is never performed synchronously, and the error
EWOULDBLOCK is never returned. After performing a nowait I/O operation, your program must
check for completion by issuing a call to the AWAITIOX or FILE_AWAITIO64_ procedure call.
The examples in Figure 1 (page 33) summarize the procedural differences between 4.3 BSD UNIX
nonblocking I/O and NonStop operating system nowait I/O.
In 4.3 BSD UNIX, the application tests (polls) a socket (f1) by using the select call check whether
I/O activity, in this case receiving data, can occur on the socket. If the socket can receive data,
the application issues the recv call; otherwise, the application continues processing, then again
issues the select call to poll the socket.
In the NonStop operating-system environment, the application issues the recv_nw call on a socket
(f1) to attempt to receive data on a socket. The application continues processing, then calls
AWAITIOX to determine if the recv_nw call has completed.
Figure 1 4.3 BSD UNIX Nonblocking I/O Compared to Guardian Nowait I/O
Differences Between UNIX and NonStop Server Implementations
The NonStop server socket routines also differ from the 4.3 BSD UNIX socket routines in the following
ways:
• The select routine is not supported. Instead, use the nowait I/O capability to test I/O
completion by issuing the AWAITIO[X] call on specific sockets.
• Include files are in the $SYSTEM.ZTCPIP subvolume, rather than in the /usr/include directory.
• The NonStop operating system does not have a facility corresponding to UNIX signals.
Therefore, the NonStop TCP/IP, Parallel Library TCP/IP, and NonStop TCP/IPv6 software
returns the error EHAVEOOB to indicate that urgent (out-of-band) data is pending. Whenever
this error occurs, your program must clear the out-of-band data before proceeding, by calling
either recv or recv_nw with flags set to MSG_OOB.
• The I/O Control operations available for sockets are restricted. Although most of the socket
I/O Control operations are available, SIOCGIFCONF and FIONBIO are not supported. Those
I/O Control operations available are accessed through the socket_ioctl function. For a
complete list of the I/O Control operations supported, see Table 16 (page 199).
Programming Using the Guardian Sockets Interface 33










