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

de_close Closes an I/O device.<br />

#include <br />

unsigned long de_close(<br />

unsigned long dev, /* major/minor device number */<br />

void *iopb, /* I/O parameter block address */<br />

void *retval /* return value */<br />

)<br />

Description<br />

Arguments<br />

Return Code<br />

The de_close() call invokes the device close routine of a pSOS+ device driver<br />

specified by the dev argument. The functionality of the device close routine is<br />

device-specific. For example, an RS-232 device driver close-routine may signal a<br />

modem to hang up to signify the end of the connection.<br />

The de_close() call, when used in conjunction with de_open(), can also be used<br />

to implement mutual exclusion. In this case, de_close() can be used to signal the<br />

end of a critical region for the device operation.<br />

dev Specifies the major and minor device numbers, which are<br />

stored in the upper and lower 16 bits, respectively.<br />

iopb Points to an I/O parameter block, the contents of which are<br />

driver-specific.<br />

retval Points to a variable that receives a driver-specific value<br />

returned by the driver.<br />

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

listed below, other driver-specific errors may be returned.<br />

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

1

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

Saved successfully!

Ooh no, something went wrong!