Verify that an entry can be unlinked
#include <sys/iofunc.h> int iofunc_unlink( resmgr_context_t* ctp, io_unlink_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_unlink() function verifies that the msg specifies valid semantics for an unlink, and that the client is allowed to unlink the resource, as specified by a combination of who the client is (info), and the resource attributes attr, dattr, attr->uid and attr->gid.
If a directory entry is being removed, iofunc_unlink() checks to see that the directory is empty. The iofunc_unlink() function also updates the time stamps, and decrements the link count for the entry.
The io_unlink_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_unlink_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 |
_io_connect, _io_connect_link_reply, _io_connect_ftype_reply, ConnectClientInfo(), iofunc_attr_t, iofunc_check_access(), resmgr_context_t
Resource Managers chapter of Getting Started with QNX Neutrino