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.

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

recvmsg Receives data from a socket.<br />

#include <br />

long recvmsg(<br />

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

struct msghdr *msg, /* packet */<br />

int flags /* packet attributes */<br />

)<br />

Description<br />

Arguments<br />

The recvmsg() system call is used to receive data from a socket. This system call is<br />

similar to recvfrom() but requires fewer input parameters. Refer also to recv()<br />

for more details. Note that the MSG_RAWMEM option is not supported by this call.<br />

s Specifies the socket from which data is received. The behavior of the<br />

system call depends on the socket type. Refer to recv() for more information.<br />

msg Points to the structure msghdr, which is defined in the file <br />

with the following format:<br />

struct msghdr {<br />

char *msg_name; /* optional address */<br />

int msg_namelen; /* size of address */<br />

struct iovec *msg_iov; /* scatter/gather array */<br />

int msg_iovlen; /* # elements in msg_iov */<br />

char *msg_accrights; /* access rights */<br />

int msg_accrightslen; /* size of access rights buffer */<br />

};<br />

This structure cannot be packed. The contents of the msghdr fields<br />

are described below.<br />

msg_name If the socket is unconnected, can specify the<br />

source from which it receives data.<br />

msg_namelen Specifies the length of the buffer pointed to by<br />

msg_name.<br />

<strong>pSO<strong>System</strong></strong> <strong>System</strong> <strong>Calls</strong> 4-51<br />

4

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

Saved successfully!

Ooh no, something went wrong!