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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

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

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

Only the process manager will call this resource manager function.<br />

Note that a side effect of the process manager’s calling this function is that an OCB<br />

will be created (i.e., iofunc_ocb_calloc() will be called), but this should have no<br />

consequences to a properly implemented resource manager.<br />

Returns: The status via the helper macro _RESMGR_STATUS.<br />

io_mount()<br />

int io_mount (resmgr_context_t *ctp, io_mount_t *msg,<br />

RESMGR_HANDLE_T *handle, io_mount_extra_t *extra)<br />

Classification: Connect<br />

Default handler: none<br />

Client functions: mount(), umount()<br />

Helper functions: none<br />

Messages: _IO_CONNECT <strong>with</strong> the _IO_CONNECT_MOUNT subtype.<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 />

uint16_t path_len;<br />

};<br />

typedef union {<br />

struct _io_connect<br />

connect;<br />

struct _io_connect_link_reply link_reply;<br />

} io_mount_t;<br />

Description: This function is called whenever a mount() or umount() client function<br />

sends your resource manager a message. For more information about the io_mount<br />

handler, see “Handling mount()” in the Handling Other Messages chapter of Writing a<br />

Resource Manager.<br />

Returns: The status via the helper macro _IO_SET_CONNECT_RET.<br />

io_msg()<br />

int io_msg (resmgr_context_t *ctp, io_msg_t *msg, RESMGR_OCB_T<br />

*ocb)<br />

Classification: I/O<br />

240 Chapter 5 • Resource Managers April 30, 2009

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

Saved successfully!

Ooh no, something went wrong!