mtcp_setsockopt 3 2017-02-02 "Linux" "mOS Library Functions Manual"
NAME
mtcp_setsockopt - set options on mTCP/mOS sockets
SYNOPSIS
#include <mtcp_api.h> "int mtcp_setsockopt(mctx_t " mctx ", int " sockid ", int " level ", int " optname ", const void *" optval ", socklen_t " optlen );
DESCRIPTION
mtcp_setsockopt () manipulate options for the socket referred to by the "sockid" descriptor. These options may exist at multiple protocol levels. When manipulating socket options, the level at which the options resides and the name of the option must be specified. A user can use "SOL_MONSOCKET" "level" to adjust options for monitoring sockets. The arguments "optval" and "optlen" are used to set options values for mtcp_setsockopt(). SOL_MONSOCKET socket level can be used by mtcp_setsockopt() to set a number of attributes pertaining to the socket.

25

"MOS_CLIBUF"
Dynamically adjust the size of the TCP receive ring buffer of the emulated client stack. The optval contains the size of the buffer that needs to be set as int, while optlen is equal to sizeof(int).
"MOS_SVRBUF"
Dynamically adjust the size of the TCP receive ring buffer of the emulated client stack. The optval contains the size of the buffer that needs to be set as int, while optlen is equal to sizeof(int). """""""""""""""""""""""""""""""""""""""""""""""""""""""""""
RETURN VALUE
Returns 0 on success; -1 on failure. In case of failure, "errno" is set appropriately. """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
ERRORS

10 "EACCES" "mctx" is not valid.

10 "EBADF" "sockid" is not a valid socket descriptor.

10 "ENOTSOCK" The socket referred to by "sockid" is not valid.

10 "ENOSYS" Either the "level" or the "optname" is not implemented.

10 "EPERM" Permission to access a socket option is denied.

10 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"""".SH CONFORMING TO
""""POSIX.1-2001.
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

AUTHORS
mOS development team <[email protected]> """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
SEE ALSO
mtcp_socket (), mtcp_getsockopt () """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
COLOPHON
This page is part of mOS release 0.3 "docs" section. A description of the project, and information about reporting bugs, can be found at \%http://mos.kaist.edu/. """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""