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.

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

rn_retseg Returns a memory segment to the region from which it was allocated.<br />

#include <br />

unsigned long rn_retseg(<br />

unsigned long rnid, /* region identifier */<br />

void *seg_addr /* segment address */<br />

)<br />

Description<br />

Arguments<br />

Return Value<br />

Error Codes<br />

This system call returns a memory segment back to the region from which it was<br />

allocated. The pSOS+ Region Manager then performs whatever compaction is<br />

possible, and puts the resulting free memory block in the region's free list for future<br />

allocation.<br />

The segment address specified must be identical to the one returned by the original<br />

rn_getseg() call. Otherwise, the pSOS+ kernel will reject the segment.<br />

rnid Specifies the segment’s region of origin.<br />

seg_addr Specifies the starting address of the segment, as returned by<br />

rn_getseg().<br />

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

Hex Mnemonic Description<br />

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

0x06 ERR_OBJID rnid is incorrect; failed validity<br />

check.<br />

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

failed validity check.<br />

0x23 ERR_NOTINRN Segment does not belong to this<br />

region.<br />

<strong>pSO<strong>System</strong></strong> <strong>System</strong> <strong>Calls</strong> 1-117<br />

1

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

Saved successfully!

Ooh no, something went wrong!