#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.
SOLIB_OPT_SOCKFD_TBL_INIT_COUNT The number of times allocation table of socket descriptor is initialized. get only.
SOLIB_OPT_SOCKBUF_CONSUMPTION Socket buffer consumption by the application. get only.
optval Destination of the option value. Cannot be NULL.

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 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.
SO_EFAULT Failed to get socket buffer consumption due to an internal error.


Retrieves an option value of the 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/13 Converted text to html list.
2014/02/06 Added SOLIB_OPT_SOCKBUF_CONSUMPTION option, took over the description about SOLIB_OPT_SOCKFD_TBL_INIT_COUNT from the man page of SOSetLibOpt.
2012/10/09 Added Errors section.
2012/08/28 Initial version.