#include <cafe.h>
#include <cafe/network.h>

int SOSetLibOpt (int liboptname, int optval);


liboptname Name of the option for the socket library.
SOLIB_OPT_AVOID_CLOSE_ALL Flag to avoid/allow socket connection abort from the network stack. Get/set.
optval Value to set.

Return Values

int, 0 upon success. Upon failure, -1 is returned and errno is set appropriately.


SO_ELIBNOTREADY Socket library is not initialized.
SO_ENOMEM Insufficient memory in the stack.
SO_EINVAL Specified argument is invalid.
SO_ENORESOURCES Could not obtain resources to configure in the stack.
SO_EBUSY Socket resource manager busy processing requests.
SO_EABORTED Indicates the operation was aborted. For example, this error can be returned for calls blocked on a socket after the socket is closed by another thread.
SO_EUNKNOWN Unknown error.
SO_ERANGEINVALID Internal API error, invalid error code.
SO_EAPIERROR Internal API error.


Applies the given value to the specified option for socket library.

Do Not Call From

Callbacks Do not call this function from any callback function.
Interrupt handler Do not call this function from any interrupt handler.
Exception handler Do not call this function from any exception handler.

See Also


Revision History

2014/02/06 Moved description about SOLIB_OPT_SOCKFD_TBL_INIT_COUNT to the man page of SOGetLibOpt.
2012/10/09 Added Errors section.
2012/09/28 Added SOLIB_OPT_SOCKFD_TBL_INIT_COUNT option.
2012/09/26 SOLIB_OPT_AVOID_CLOSE_ALL option became DEBUG ONLY.
2012/09/21 Modified description of SOLIB_OPT_AVOID_CLOSE_ALL.
2012/08/28 Initial version.