diff options
author | Rob Landley <rob@landley.net> | 2019-05-25 19:48:33 -0500 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2019-05-25 19:48:33 -0500 |
commit | 94777894a95044c5253ec081503085ab9947cfec (patch) | |
tree | d1b706df996629cbde90046b9e841218210388cf /lib/portability.h | |
parent | c82d3108947c93c9e27553a44f319171776e92a3 (diff) | |
download | toybox-94777894a95044c5253ec081503085ab9947cfec.tar.gz |
Move notify.c into portability.c (collate the #ifdefs), move global variables
into a structure passed as arguments, add x prefix to functions that can fail,
add overflow test.
Diffstat (limited to 'lib/portability.h')
-rw-r--r-- | lib/portability.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/portability.h b/lib/portability.h index f4a2b327..f5f8352a 100644 --- a/lib/portability.h +++ b/lib/portability.h @@ -309,6 +309,12 @@ static inline void confstr(int a, char *b, int c) {strcpy(b, a ? "POSIXLY_CORREC #endif // Paper over the differences between BSD kqueue and Linux inotify for tail. -void notify_init(int max); -int notify_add(int fd, char *path); -int notify_wait(char **path); + +struct xnotify { + char **paths; + int max, *fds, count, kq; +}; + +struct xnotify *xnotify_init(int max); +int xnotify_add(struct xnotify *not, int fd, char *path); +int xnotify_wait(struct xnotify *not, char **path); |