From 94777894a95044c5253ec081503085ab9947cfec Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Sat, 25 May 2019 19:48:33 -0500 Subject: 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. --- lib/portability.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'lib/portability.h') 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); -- cgit v1.2.3