26.02.2014 Views

Getting Started with QNX Neutrino - QNX Software Systems

Getting Started with QNX Neutrino - QNX Software Systems

Getting Started with QNX Neutrino - QNX Software Systems

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Alphabetical listing of connect and I/O functions<br />

© 2009, <strong>QNX</strong> <strong>Software</strong> <strong>Systems</strong> GmbH & Co. KG.<br />

Client functions: lseek(), fseek(), rewinddir()<br />

Messages: _IO_LSEEK<br />

Data structure:<br />

struct _io_lseek {<br />

uint16_t<br />

uint16_t<br />

short<br />

uint16_t<br />

uint64_t<br />

};<br />

type;<br />

combine_len;<br />

whence;<br />

zero;<br />

offset;<br />

typedef union {<br />

struct _io_lseek i;<br />

uint64_t o;<br />

} io_lseek_t;<br />

Description: Handles the client’s lseek() function. Note that a resource manager that<br />

handles directories will also need to interpret the _IO_LSEEK message for directory<br />

operations. The whence and offset parameters are passed from the client’s lseek()<br />

function. The routine should adjust the OCB’s offset parameter after interpreting the<br />

whence and offset parameters from the message and should return the new offset or an<br />

error.<br />

Returns: The status via the helper macro _RESMGR_STATUS, and optionally (if no<br />

error and if not part of a combine message) the current offset.<br />

io_mknod()<br />

int io_mknod (resmgr_context_t *ctp, io_mknod_t *msg,<br />

RESMGR_HANDLE_T *handle, void *reserved)<br />

Classification: Connect<br />

Default handler: none<br />

Helper functions: iofunc_mknod()<br />

Client functions: mknod(), mkdir(), mkfifo()<br />

Messages: _IO_CONNECT, subtype _IO_CONNECT_MKNOD<br />

Data structure:<br />

struct _io_connect {<br />

// internal fields (as described above)<br />

uint16_t path_len;<br />

uint8_t extra_type;<br />

uint16_t extra_len;<br />

char path [1];<br />

};<br />

struct _io_connect_link_reply {<br />

uint32_t reserved1 [2];<br />

uint8_t eflag;<br />

uint8_t reserved2 [3];<br />

uint32_t umask;<br />

uint16_t nentries;<br />

238 Chapter 5 • Resource Managers April 30, 2009

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

Saved successfully!

Ooh no, something went wrong!