06.08.2013 Views

pSOSystem System Calls - Read

pSOSystem System Calls - Read

pSOSystem System Calls - Read

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

setsockopt pNA+ <strong>System</strong> <strong>Calls</strong><br />

setsockopt Sets options on a socket.<br />

#include <br />

long setsockopt(<br />

int s, /* socket descriptor */<br />

int level, /* SOL_SOCKET, IPPROTO_TCP */<br />

/* or IPPROTO_IP */<br />

int optname, /* retrieval access */<br />

char *optval,/* modification data */<br />

int optlen /* sizeof modification data */<br />

)<br />

Description<br />

Arguments<br />

The setsockopt() system call sets options associated with the specified socket.<br />

Socket level, IP protocol level, or TCP protocol level options can be set.<br />

s Specifies the socket whose options are to be set.<br />

level Specifies the level of the option to be set. Must be SOL_SOCKET for<br />

socket level operations, IPPROTO_TCP for TCP protocol level operations,<br />

or IPPROTO_IP for IP protocol level operations. These options<br />

are defined in .<br />

optname Specifies the option to be set and uses a symbolic constant defined<br />

in . The symbolic constants available for each level<br />

are described below.<br />

optval Points to a buffer in which the option's value is specified. Most options<br />

are 32-bit values. A nonzero value means the option should<br />

be set, and a 0 means the option should be turned off.<br />

optlen Specifies the size of the value pointed to by optval.<br />

4-66 <strong>pSO<strong>System</strong></strong> <strong>System</strong> <strong>Calls</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!