inotify_init()
Initialize the inode notify system
Synopsis:
#include <sys/inotify.h>
int inotify_init( void );
Library:
libc
Use the -l c option to qcc to link against this library. This library is usually included automatically.
Description:
The inotify_init() function initializes the inode notify system that you can use to watch for filesystem events.
The basic steps for using the inotify system are as follows:
- Initialize the inotify system by calling inotify_init(), saving the file descriptor that it returns.
- Use inotify_add_watch() to add or modify a watch for a given file or directory.
- Read the filesystem events (of type struct inotify_event) from the file descriptor returned by inotify_init().
- To remove a watch, call inotify_rm_watch().
- To remove all watches and shut down inotify, close the file descriptor returned by inotify_init().
While the QNX Neutrino inotify implementation follows the same semantics as the Linux implementation, the behavior differs from Linux due to the kernel and filesystem models employed. For an overview of inotify, see http://www.linuxjournal.com/article/8478?page=0,0 in the Linux Journal. Currently, only io-blk.so-based filesystems support inotify.
Returns:
A file descriptor for the inotify mailbox, or -1 if an error occurred (errno is set).
Errors:
- EACCES
- The process does not have permission to open /dev/fsnotify.
- ENOSYS
- The fsevmgr process is not running.
Classification:
| Safety: | |
|---|---|
| Cancellation point | No |
| Interrupt handler | No |
| Signal handler | No |
| Thread | Yes |
