demi_setsockopt
- Gets a socket option on a socket I/O queue.
#include <demi/libos.h>
#include <sys/socket.h> /* For SOL_SOCKET. */
int demi_setsockopt(int sockqd, int level, int optname, const void *optval, socklen_t optlen);
demi_getsockopt()
gets the option specified by the optname
argument, at the protocol level specified by the level
argument, to the value pointed to by the optval
argument for the socket I/O queue associated with queue descriptor specified by the socketqd
argument.
Currently the following values for level
are supported:
SOL_SOCKET
- Socket-level options.
Currently the following values for option
are supported:
SO_LINGER
- Linger on/off and linger time in seconds, for queued, unsent data ondemi_close()
.SO_KEEPALIVE
- Whether connections should be kept alive. On Linux, this is a boolean flag. On Windows, this includes a boolean flag, a keep alive time and a keep alive interval.SO_NODELAY
- Nagle algoirthm on/off.
On success, zero is returned. On error, a positive error code is returned.
On error, one of the following positive error codes is returned:
EBADF
- The specifiedsockqd
is invalid.EINVAL
- The specifiedoptval
is invalid.EINVAL
- The specifiedoptlen
is invalid.ENOPROTOOPT
- The specifiedoptname
is not supported.ENOTSUP
- The specifiedlevel
is not supported.
Any behavior that is not documented in this manual page is unintentional and should be reported.
demi_setsockopt()