… | |
… | |
5 | #include "XSUB.h" |
5 | #include "XSUB.h" |
6 | |
6 | |
7 | #include <unistd.h> |
7 | #include <unistd.h> |
8 | #include <fcntl.h> |
8 | #include <fcntl.h> |
9 | |
9 | |
10 | #include "inotify.h" |
10 | #include <sys/inotify.h> |
11 | #include "inotify-syscalls.h" |
|
|
12 | |
11 | |
13 | MODULE = Linux::Inotify2 PACKAGE = Linux::Inotify2 |
12 | MODULE = Linux::Inotify2 PACKAGE = Linux::Inotify2 |
14 | |
13 | |
15 | PROTOTYPES: ENABLE |
14 | PROTOTYPES: ENABLE |
16 | |
15 | |
… | |
… | |
33 | newCONSTSUB (stash, "IN_UNMOUNT" , newSViv (IN_UNMOUNT)); |
32 | newCONSTSUB (stash, "IN_UNMOUNT" , newSViv (IN_UNMOUNT)); |
34 | newCONSTSUB (stash, "IN_Q_OVERFLOW" , newSViv (IN_Q_OVERFLOW)); |
33 | newCONSTSUB (stash, "IN_Q_OVERFLOW" , newSViv (IN_Q_OVERFLOW)); |
35 | newCONSTSUB (stash, "IN_IGNORED" , newSViv (IN_IGNORED)); |
34 | newCONSTSUB (stash, "IN_IGNORED" , newSViv (IN_IGNORED)); |
36 | newCONSTSUB (stash, "IN_CLOSE" , newSViv (IN_CLOSE)); |
35 | newCONSTSUB (stash, "IN_CLOSE" , newSViv (IN_CLOSE)); |
37 | newCONSTSUB (stash, "IN_MOVE" , newSViv (IN_MOVE)); |
36 | newCONSTSUB (stash, "IN_MOVE" , newSViv (IN_MOVE)); |
|
|
37 | newCONSTSUB (stash, "IN_ONLYDIR" , newSViv (IN_ONLYDIR)); |
|
|
38 | newCONSTSUB (stash, "IN_DONT_FOLLOW" , newSViv (IN_DONT_FOLLOW)); |
|
|
39 | newCONSTSUB (stash, "IN_MASK_ADD" , newSViv (IN_MASK_ADD)); |
38 | newCONSTSUB (stash, "IN_ISDIR" , newSViv (IN_ISDIR)); |
40 | newCONSTSUB (stash, "IN_ISDIR" , newSViv (IN_ISDIR)); |
39 | newCONSTSUB (stash, "IN_ONESHOT" , newSViv (IN_ONESHOT)); |
41 | newCONSTSUB (stash, "IN_ONESHOT" , newSViv (IN_ONESHOT)); |
40 | newCONSTSUB (stash, "IN_ALL_EVENTS" , newSViv (IN_ALL_EVENTS)); |
42 | newCONSTSUB (stash, "IN_ALL_EVENTS" , newSViv (IN_ALL_EVENTS)); |
41 | } |
43 | } |
42 | |
44 | |
… | |
… | |
54 | int |
56 | int |
55 | inotify_rm_watch (int fd, U32 wd) |
57 | inotify_rm_watch (int fd, U32 wd) |
56 | |
58 | |
57 | int |
59 | int |
58 | inotify_blocking (int fd, I32 blocking) |
60 | inotify_blocking (int fd, I32 blocking) |
59 | CODE: |
61 | CODE: |
60 | fcntl (fd, F_SETFL, blocking ? 0 : O_NONBLOCK); |
62 | fcntl (fd, F_SETFL, blocking ? 0 : O_NONBLOCK); |
61 | |
63 | |
62 | void |
64 | void |
63 | inotify_read (int fd, int size = 8192) |
65 | inotify_read (int fd, int size = 8192) |
64 | PPCODE: |
66 | PPCODE: |
… | |
… | |
91 | |
93 | |
92 | XPUSHs (sv_2mortal (newRV_noinc ((SV *)hv))); |
94 | XPUSHs (sv_2mortal (newRV_noinc ((SV *)hv))); |
93 | } |
95 | } |
94 | } |
96 | } |
95 | |
97 | |
96 | |
|
|