diff options
author | Elliott Hughes <enh@google.com> | 2019-05-23 16:28:19 -0700 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2019-05-25 18:59:30 -0500 |
commit | c82d3108947c93c9e27553a44f319171776e92a3 (patch) | |
tree | c85d419eba73989ced08e21d934dce7ba18792d0 /lib/portability.h | |
parent | cf624717b45049b3d394aeeda85a3ee9b89388af (diff) | |
download | toybox-c82d3108947c93c9e27553a44f319171776e92a3.tar.gz |
tail: support -f on BSD too.
Factor out the inotify code and add a kqueue equivalent.
Specifically tested on macOS 10.14, but I assume this works for other
BSDs too, given that I worked from the FreeBSD man page...
Diffstat (limited to 'lib/portability.h')
-rw-r--r-- | lib/portability.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/portability.h b/lib/portability.h index ccb1b1c5..f4a2b327 100644 --- a/lib/portability.h +++ b/lib/portability.h @@ -307,3 +307,8 @@ int xgetrandom(void *buf, unsigned len, unsigned flags); #include <string.h> static inline void confstr(int a, char *b, int c) {strcpy(b, a ? "POSIXLY_CORRECT=1" : "/bin:/usr/bin");} #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); |