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

de_open Opens an I/O device.<br />

#include <br />

unsigned long de_open(<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_open() call invokes the device open routine of a pSOS+ device driver<br />

specified by the dev argument.<br />

The device open routine can be used to perform functions that need to be done<br />

before the I/O operations can be performed on the device. For example, an<br />

asynchronous serial device driver can reset communication parameters (such as<br />

baud rate and parity) to a known state for the channel being opened.<br />

A device driver can also assign specific duties to the open routine that are not<br />

directly related to data transfer or device operations. For example, a device driver<br />

can use de_open() to enforce exclusive use of the device during several read and/<br />

or write operations.<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-17<br />

1

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

Saved successfully!

Ooh no, something went wrong!