zoslib
z/OS C/C++ Library
Loading...
Searching...
No Matches
inotify.h
Go to the documentation of this file.
1
2// Licensed Materials - Property of IBM
3// ZOSLIB
4// (C) Copyright IBM Corp. 2020. All Rights Reserved.
5// US Government Users Restricted Rights - Use, duplication
6// or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
8
9#ifndef ZOS_SYS_INOTIFY_H_
10#define ZOS_SYS_INOTIFY_H_
11
12#define __XPLAT 1
13#include "zos-macros.h"
14
15#if (__EDC_TARGET < 0x42050000) && defined(ZOSLIB_ENABLE_V2R5_FEATURES)
16
17#include <sys/types.h>
18#include <stdint.h>
19
20/* inotify_init options */
21#define IN_CLOEXEC 0x00001000
22#define IN_NONBLOCK 0x00000004
23
24/* inotify events */
25#define IN_ACCESS 0x00000001
26#define IN_MODIFY 0x00000002
27#define IN_ATTRIB 0x00000004
28#define IN_CLOSE_WRITE 0x00000008
29#define IN_CLOSE_NOWRITE 0x00000010
30#define IN_OPEN 0x00000020
31#define IN_MOVED_FROM 0x00000040
32#define IN_MOVED_TO 0x00000080
33#define IN_CREATE 0x00000100
34#define IN_DELETE 0x00000200
35#define IN_DELETE_SELF 0x00000400
36#define IN_MOVE_SELF 0x00000800
37
38/* Events sent by the kernel */
39#define IN_UNMOUNT 0x00002000
40#define IN_Q_OVERFLOW 0x00004000
41#define IN_IGNORED 0x00008000
42
43/* Helper events */
44#define IN_CLOSE (IN_CLOSE_WRITE | IN_CLOSE_NOWRITE)
45#define IN_MOVE (IN_MOVED_FROM | IN_MOVED_TO)
46#define IN_ALL_EVENTS (IN_ACCESS | IN_MODIFY | IN_ATTRIB | \
47 IN_CLOSE_WRITE | IN_CLOSE_NOWRITE | \
48 IN_OPEN | IN_MOVED_FROM | \
49 IN_MOVED_TO | IN_CREATE | \
50 IN_DELETE | IN_DELETE_SELF | \
51 IN_MOVE_SELF)
52
53/* Special flags */
54#define IN_ONLYDIR 0x01000000
55#define IN_DONT_FOLLOW 0x02000000
56#define IN_EXCL_UNLINK 0x04000000
57#define IN_MASK_CREATE 0x10000000
58#define IN_MASK_ADD 0x20000000
59#define IN_ISDIR 0x40000000
60#define IN_ONESHOT 0x80000000
61
62#if defined(__cplusplus)
63extern "C" {
64#endif
65
66struct inotify_event {
67 int wd;
68 uint32_t mask;
69 uint32_t cookie;
70 uint32_t len;
71 char name[];
72};
73
74__Z_EXPORT extern int (*inotify_init)(void);
75__Z_EXPORT extern int (*inotify_init1)(int);
76__Z_EXPORT extern int (*inotify_add_watch)(int, const char *,
77 uint32_t);
78__Z_EXPORT extern int (*inotify_rm_watch)(int, int);
79
80#if defined(__cplusplus)
81}
82#endif
83
84#endif
85
86#endif
#define __Z_EXPORT
Definition zos-macros.h:13