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.

sm_ident pSOS+ <strong>System</strong> <strong>Calls</strong><br />

sm_ident Obtains the semaphore identifier of a named semaphore.<br />

#include <br />

unsigned long sm_ident(<br />

char name[4], /* semaphore name */<br />

unsigned long node, /* node selector */<br />

unsigned long *smid /* semaphore ID */<br />

)<br />

Description<br />

Arguments<br />

Return Value<br />

Error Codes<br />

This system call enables the calling task to obtain the semaphore ID of a semaphore<br />

it only knows by name. The semaphore ID can then be used in all other operations<br />

relating to this semaphore.<br />

Most system calls, except sm_create() and sm_ident(), reference a semaphore<br />

by the semaphore ID. sm_create() returns the semaphore ID to the semaphore<br />

creator. For other tasks, one way to obtain the semaphore ID is to use sm_ident().<br />

name Specifies the user-assigned name of the semaphore.<br />

node In multiprocessor systems, is a search order specifier. See<br />

“Multiprocessor Considerations.” In a single node system,<br />

this argument must be 0.<br />

smid Points to the variable where sm_ident() stores the<br />

semaphore ID of the named semaphore.<br />

This system call returns 0 on success, or an error code on failure.<br />

Hex Mnemonic Description<br />

0x04 ERR_NODENO Node specifier out of range.<br />

0x09 ERR_OBJNF Named semaphore not found.<br />

1-126 <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!