getibmsockopt() — Get IBM specific options associated with a socket
Standards
Standards / Extensions | C or C++ | Dependencies |
---|---|---|
z/OS® UNIX | both |
Format
#define _OPEN_SYS_SOCK_EXT
#include <sys/socket.h>
int getibmsockopt(int s, int level, int optname, char *optval, int *optlen);
General description
Like getsockopt(), the getibmsockopt() gets the options associated with a socket in the AF_INET or AF_INET6 domain. Only SOL_SOCKET is supported. This call is for options specific to the IBM® implementation of sockets. Currently, only the SOL_SOCKET level and the socket options SO_NONBLOCKLOCAL and SO_IGNOREINCOMINGPUSH are supported.
- Parameter
- Description
- s
- The socket descriptor.
- level
- The level for which the option is set.
- optname
- The name of a specified socket option.
- optval
- The pointer to option data.
- optlen
- The pointer to the length of the option data.
The fields b_num_UNITs_sent and b_num_UNITs_received represent cumulative totals for this socket since the time the application was started.
For SO_NONBLOCKLOCAL, optval should point to an integer. getibmsockopt() returns 0 in optval if the socket is in blocking mode, and returns 1 in optval if the socket is in nonblocking mode.
For SO_IGNOREINCOMINGPUSH, optval should point to an integer. getibmsockopt() returns 0 in optval if the option is not set, and returns 1 in optval if the option is set.
Returned value
If successful, getibmsockopt() returns 0.
- Error Code
- Description
- EBADF
- The s parameter is not a valid socket descriptor.
- EFAULT
- Using optval and optlen parameters would result in an attempt to access storage outside the caller's address space.
- ENOPROTOOPT
- The optname parameter is unrecognized, or the level parameter is not SOL_SOCKET.