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> shr_socket<br />

shr_socket Obtains a new socket descriptor for an existing socket.<br />

#include <br />

int shr_socket(<br />

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

int tid /* task identity */<br />

)<br />

Description<br />

Arguments<br />

Return Value<br />

Error Codes<br />

This system call is used to obtain a new socket descriptor for an existing socket. The<br />

new socket descriptor can be used by the task with the specified ID to reference the<br />

socket in question.<br />

This system call is provided for applications that implement UNIX-style server<br />

programs, which normally incorporate the UNIX fork() call.<br />

s Specifies the existing socket descriptor to be shared.<br />

tid Specifies the task ID of a task that seeks to access the same<br />

socket.<br />

This system call returns a socket descriptor if successful, otherwise it returns -1.<br />

Hex Mnemonic Description<br />

0x5009 EBADS The socket descriptor is invalid.<br />

0x5017 ENFILE An internal table has run out of<br />

space.<br />

0x504B ETID The task ID is not valid.<br />

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

4

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

Saved successfully!

Ooh no, something went wrong!