sock_do_teststor() — Check for attempt to access storage outside

Standards

Standards / Extensions C or C++ Dependencies
z/OS® UNIX both  

Format

#define _OPEN_SYS_SOCK_EXT
#include <sys/socket.h>

void sock_do_teststor(int onoff);

General description

The sock_do_teststor call is used to check for calls that attempt to access storage outside the caller's address space.
Parameter
Description
onoff
A parameter that can be set to zero or nonzero.

If onoff is set to a nonzero value, for either inbound or outbound sockets, both the address of the message buffer and the message buffer are checked for addressability for each bulk mode socket call. The EFAULT error condition is set if there is an addressing problem. If onoff is set to 0, address checking is not done by the socket library program. If an error occurs when onoff is 0, normal runtime error handling reports the exception condition.

To improve response time, you can disable this checking when your program has been tested.

As an alternative to calling sock_do_teststor, with onoff set to a nonzero value, you can include the statement SOCKTESTSTOR in the file /etc/resolv.conf or data set tcpip.TCPIP.DATA. When the process is started, all the programs using bulk mode sockets for this process will validate the storage for the caller's parameters.

Returned value

sock_do_teststor() returns no values.

Related information