User`s guide
KwikNet TCP/IP Sockets
K
A
DAK
203
Description ...continued
Optionval is a pointer to storage for the option value. The size of each
option is indicated in the option list. Note that
bool is an int result
that is 1 if the option is enabled or 0 if the option is disabled. The type
u/s long indicates a 32-bit value usually represented by an unsigned
long
. The structure linger required by option SO_LINGER is described
in header file KN_SOCK.H.
Optionlen is a pointer to storage for the length of the returned option
value. On entry, the integer at *optionlen must define the maximum
storage available at the location referenced by optionval.
Returns If successful, a value of 0 is returned.
The storage at *optionval contains the option value.
The length of the option value (in bytes) is stored at *optionlen.
On failure, the error status -1 is returned. The storage at *optionval and
*optionlen is unaltered.
The error indicator for socket s is set to define the reason for failure. Use
kn_errno() to retrieve the error code.
EBADF The socket descriptor s is invalid.
ENOPROTOOPT The option is unknown at the level indicated.
EINVAL Parameter optionval or optionlen is invalid or
parameter *optionlen specifies a length that is less
than that required to accommodate the result.
See Also
kn_setsockopt(), kn_socket()