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_delete pSOS+ <strong>System</strong> <strong>Calls</strong><br />

sm_delete Deletes a semaphore.<br />

#include <br />

unsigned long sm_delete(<br />

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

)<br />

Description<br />

Arguments<br />

Return Value<br />

Error Codes<br />

This system call deletes the semaphore with the specified semaphore ID, and frees<br />

the SMCB to be reused. sm_delete() takes care of cleaning up the semaphore. If<br />

there are tasks waiting, they will be unblocked and given an error code.<br />

The calling task does not have to be the creator (parent) of the semaphore to be<br />

deleted. However, a semaphore must be deleted from the node on which it was<br />

created.<br />

smid Specifies the semaphore ID of the semaphore to be deleted.<br />

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

Hex Mnemonic Description<br />

0x05 ERR_OBJDEL Semaphore has been deleted.<br />

0x06 ERR_OBJID smid incorrect; failed validity check.<br />

0x07 ERR_OBJTYPE Object type doesn’t match object ID;<br />

failed validity check.<br />

0x44 ERR_TATSDEL Informative only; there were tasks<br />

waiting.<br />

0x53 ERR_ILLRSC Semaphore not created from this<br />

node.<br />

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