Warning: main(/www/www/htdocs/style/globals.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/s/setsockopt.html on line 1

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/globals.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/s/setsockopt.html on line 1

Warning: main(/www/www/htdocs/style/header.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/s/setsockopt.html on line 8

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/header.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/s/setsockopt.html on line 8

setsockopt()

Set options associated with a socket

Synopsis:

#include <sys/types.h>
#include <sys/socket.h>

int setsockopt( int s,
                int level,
                int optname, 
                const void * optval,
                socklen_t optlen );

Arguments:

s
The file descriptor of the socket that the option is to be applied on, as returned by socket().
level
The protocol layer that the option is to be applied to. In most cases, it's a socket-level option and is indicated by SOL_SOCKET.
optname
The option for the socket file descriptor.
optval
A pointer to the value of the option (in most cases, whether the option is to be turned on or off). If no option value is to be returned, optval may be NULL.

Most socket-level options use an int parameter for optval. Others, such as the SO_LINGER, SO_SNDTIMEO, and SO_RCVTIMEO options, use structures that also let you get data associated with the option.

optlen
A pointer to the length of the value of the option. This argument is a value-result parameter; you should initialize it to indicate the size of the buffer pointed to by optval.

Library:

libsocket

Use the -l socket option to qcc to link against this library.

Description:

The setsockopt() function sets the options associated with a socket.

See getsockopt() for more detailed information.

Returns:

0
Success.
-1
An error occurred (errno is set).

Errors:

EBADF
Invalid file descriptor s.
EDOM
Value was set out of range.
EFAULT
The address pointed to by optval isn't in a valid part of the process address space.
EINVAL
No optval value was specified.
ENOPROTOOPT
The option is unknown at the level indicated.

Classification:

POSIX 1003.1

Safety:
Cancellation point Yes
Interrupt handler No
Signal handler No
Thread Yes

See also:

ICMP, IP, TCP, and UDP protocols

getsockopt(), socket()


Warning: main(/www/www/htdocs/style/footer.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/s/setsockopt.html on line 201

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/footer.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/s/setsockopt.html on line 201