From c82d3108947c93c9e27553a44f319171776e92a3 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Thu, 23 May 2019 16:28:19 -0700 Subject: 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... --- lib/portability.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/portability.h') 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 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); -- cgit v1.2.3