Verify a client's ability to open a resource
#include <sys/iofunc.h> int iofunc_open( resmgr_context_t *ctp, io_open_t *msg, iofunc_attr_t *attr, iofunc_attr_t *dattr, struct _client_info *info );
libc
Use the -l c option to qcc to link against this library. This library is usually included automatically.
The iofunc_open() function checks to see if the client (described by the optional info structure) has access to open the resource whose name is passed in msg->connect.path. It's a helper function for resource managers that implement open().
The attr structure describes the resource's attributes. The optional dattr structure defines the attributes of the parent directory; if dattr isn't NULL, the resource identified by attr is being created within the directory specified by dattr.
The info argument can be passed as NULL, in which case iofunc_open() obtains the client information itself via a call to iofunc_client_info_ext(). It is, of course, more efficient to get the client info once, rather than calling this function with NULL every time.
io_open_t structure
The io_open_t structure holds the _IO_CONNECT message received by the resource manager:
typedef union { struct _io_connect connect; struct _io_connect_link_reply link_reply; struct _io_connect_ftype_reply ftype_reply; } io_open_t;
This message structure is a union of an input message (coming to the resource manager), _io_connect, and two possible output or reply messages (going back to the client):
Or:
Safety: | |
---|---|
Cancellation point | No |
Interrupt handler | No |
Signal handler | Yes |
Thread | Yes |