Unlink connect function handler
QNX SDP8.0Getting Started with the QNX OSDeveloperUser
Prototype:
int (*unlink) ( resmgr_context_t *ctp,
io_unlink_t *msg,
RESMGR_HANDLE_T *handle,
void *reserved )
Classification:
ConnectDefault handler:
noneHelper functions:
iofunc_unlink()Client function:
unlink(), unlinkat()Messages:
_IO_CONNECT with subtype _IO_CONNECT_UNLINKData structure:
struct _io_connect {
// internal fields (as described above)
uint16_t path_len;
uint8_t extra_type;
uint16_t extra_len;
char path [1];
};
struct _io_connect_link_reply {
uint32_t reserved1;
uint32_t file_type;
uint8_t eflag;
uint8_t reserved2[1];
uint16_t chroot_len;
uint32_t umask;
uint16_t nentries;
uint16_t path_len;
};
struct _io_connect_ftype_reply {
uint16_t status; /* Typically an errno */
uint16_t reserved;
uint32_t file_type; /* _FTYPE_? in sys/ftype.h */
};
typedef union {
struct _io_connect connect;
struct _io_connect_link_reply link_reply;
struct _io_connect_ftype_reply ftype_reply;
} io_unlink_t;
Description:
Responsible for unlinking the file whose pathname is passed in the input message structure's path member.Returns:
The status via the helper macro _RESMGR_STATUS().Referenced by:
resmgr_connect_funcs_t connect tablePermission checking:
When you override the default function, QNX recommends that you call iofunc_unlink(), which verifies the following conditions before it updates the link counts:
- The client has write permission on the directory that contains the entity being unlinked.
- The entity being unlinked is not
.
or..
. - If it is a directory that is being unlinked, that the directory is empty.
- If it is a directory that is being unlinked, that the client is user ID (UID) 0 and the filesystem allows root to unlink directories (IOFUNC_PC_LINK_DIR; see iofunc_mount_t in the C Library Reference).
- If the sticky bit is set, the client is the owner of the entity being unlinked.
- It is a writable filesystem.
If you need to allow users other than UID 0 to unlink directories, re-implement all these checks yourself in your resource manager.
Page updated: