[Previous] [Contents] [Next]

iofunc_open_default()

Default handler for _IO_CONNECT messages

Synopsis:

#include <sys/iofunc.h>

int iofunc_open_default( resmgr_context_t *ctp,
                         io_open_t *msg,
                         iofunc_attr_t *attr,
                         void *extra );

Library:

libc

Description:

The iofunc_open_default() function implements the default actions for the _IO_CONNECT message in a resource manager. The client's open mode is checked against the resources attributes to see if the resource can be opened in that mode (via iofunc_open()), an OCB is allocated (via iofunc_ocb_calloc()), the OCB is initialized (via iofunc_ocb_attach()), and finally, the newly-created OCB is bound to the request (via resmgr_open_bind()).

This function can be placed directly into the connect_funcs table passed to resmgr_attach(), at the open position. See the "Examples" section in the description of iofunc_open() for the skeleton outline of the functionality (the second example, where resmgr_attach() doesn't specify that the managed resource is a directory).

Returns:

EOK
Successful completion.
ENOSPC
There's insufficient memory to allocate the OCB.
ENOMEM
There's insufficient memory to allocate an internal data structure required by resmgr_open_bind().

Classification:

QNX 6

Safety:
Cancellation point No
Interrupt handler No
Signal handler Yes
Thread Yes

See also:

iofunc_chmod_default(), iofunc_chown_default(), iofunc_close_dup_default(), iofunc_close_ocb_default(), iofunc_devctl_default(), iofunc_lock_default(), iofunc_lseek_default(), iofunc_mmap_default(), iofunc_open(), iofunc_pathconf_default(), iofunc_stat_default(), iofunc_time_update(), iofunc_unblock_default(), iofunc_utime_default(), resmgr_attach()


[Previous] [Contents] [Next]