DCMD_FSYS_FSNOTIFY

Notify the filesystem event policy manager

Synopsis:

#include <sys/dcmd_blk.h>

#define DCMD_FSYS_FSNOTIFY    __DIOTF(_DCMD_FSYS, 29, uint32_t)

Arguments to devctl():

Argument Value
filedes A file descriptor that you obtained by opening the device.
dcmd DCMD_FSYS_FSNOTIFY
dev_data_ptr Depends on the request; see below
n_bytes Depends on the request; see below
dev_info_ptr NULL

Description:

The filesystem event policy manager, fsevmgr sends these commands to all of the io-blk.so mountpoints to make requests:

FSNOTIFY_REQ_ENABLE
Enable the fsnotify module. The dev_data_ptr argument must be a pointer to a uint32_t.
FSNOTIFY_REQ_INFO
Get information about the mountpoint. The dev_data_ptr argument must be a pointer to a fsnotify_info_t structure:
typedef struct _fsnotify_info_s {
        uint32_t command;   /* Structure type command */
        uint32_t uid;       /* Mount point unique id */
} fsnotify_info_t;
  
FSNOTIFY_REQ_WATCH_ADD
Add a watch. The dev_data_ptr argument must be a pointer to a fsnotify_watch_cmd_t structure:
typedef struct fsnotify_watch_cmd_s {
        uint32_t command;   /* Structure type command */
        uint32_t muid;      /* Receiving mailbox unique id */
        uint32_t wuid;      /* Watch unique id */
        uint32_t mask;      /* inotify watch mask */
        uint64_t inode;     /* inode being watched */
        uint32_t mpuid;     /* Mount point unique id */
} fsnotify_watch_cmd_t;
  
FSNOTIFY_REQ_RWATCH_ADD
Add a recursive watch. The dev_data_ptr argument must be a pointer to a fsnotify_watch_cmd_t structure, just as for FSNOTIFY_REQ_WATCH_ADD.

Input:

The input depends on the request, but includes at least the FSNOTIFY_REQ_* command itself:

FSNOTIFY_REQ_ENABLE
Set the uint32_t to FSNOTIFY_REQ_ENABLE.
FSNOTIFY_REQ_INFO
Set the command member to FSNOTIFY_REQ_INFO.
FSNOTIFY_REQ_WATCH_ADD, FSNOTIFY_REQ_RWATCH_ADD
Set the command member to FSNOTIFY_REQ_WATCH_ADD or FSNOTIFY_REQ_RWATCH_ADD. Fill in the muid, wuid, and mask fields.

Output:

The input depends on the request:

FSNOTIFY_REQ_ENABLE
None.
FSNOTIFY_REQ_INFO
The mountpoint's ID.
FSNOTIFY_REQ_WATCH_ADD, FSNOTIFY_REQ_RWATCH_ADD
The inode and mpuid members.

Errors:

The devctl() function can return the following, in addition to the error codes listed in its entry in the C Library Reference:

EINVAL
The size of the data structure isn't correct for the given request.

See also:

DCMD_FSYS_FSNOTIFY_SAVE

Filesystem events in the QNX Neutrino System Architecture guide

fsevmgr in the Utilities Reference

devctl() in the QNX Neutrino C Library Reference