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.

pREPC+ <strong>System</strong> <strong>Calls</strong> malloc<br />

malloc Allocates memory.<br />

#include <br />

void *malloc(<br />

size_t size /* element size */<br />

)<br />

Description<br />

Arguments<br />

Return Value<br />

Error Codes<br />

Notes<br />

The malloc() function allocates memory for an object whose size is specified by<br />

size and whose value is indeterminate. malloc() calls the pSOS+ region manager<br />

to allocate the memory. The caller can be blocked if memory is not available and the<br />

wait option is selected in the pREPC+ Configuration Table. Memory is allocated from<br />

Region 0.<br />

size Specifies the number of bytes to allocate.<br />

This function returns either a pointer to the allocated memory or a null pointer if no<br />

memory is allocated. If an error occurs, errno is set.<br />

Refer to Appendix B.<br />

Callable From<br />

■ Task<br />

<strong>pSO<strong>System</strong></strong> <strong>System</strong> <strong>Calls</strong> 3-95<br />

3

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

Saved successfully!

Ooh no, something went wrong!