summaryrefslogtreecommitdiff
path: root/cmake/CheckWorkingKqueue.cmake
diff options
context:
space:
mode:
authorCarlo Marcelo Arenas Belón <carenas@gmail.com>2017-08-19 16:01:46 -0700
committerAzat Khuzhin <a3at.mail@gmail.com>2017-09-11 01:48:35 +0300
commit1dfec8a97094a26317eac9b3d8a1c16eb1a7dbea (patch)
tree71936fc3054a73ee222e88636cb351f345717f1a /cmake/CheckWorkingKqueue.cmake
parenta86f89d333d870e6714bd28c695ba1774df3d7f5 (diff)
downloadlibevent-1dfec8a97094a26317eac9b3d8a1c16eb1a7dbea.tar.gz
configure: avoid false positive in DragonFlyBSD
by default, the max buffer size is 16K and histeresis is at 50%, so a bigger read is needed to unlock writes than you would expect from other BSD (512 bytes) this doesn't introduce any regression on FreeBSD 11.1, OpenBSD 6.1, NetBSD 7.1, macOS 10.12.6 and of course DragonFlyBSD 4.8.1, and most of them show a max pipe size of 64K, so the read call should drain them all regardless of how conservative they are on the free pipe space they will require (usually 512 bytes) before kevent reports the fd as ready for write. I couldn't find a reference to which bug this code was trying to look for and it seems to be there from the beginning of git history so it might be no longer relevant. Issue: #548
Diffstat (limited to 'cmake/CheckWorkingKqueue.cmake')
-rw-r--r--cmake/CheckWorkingKqueue.cmake6
1 files changed, 3 insertions, 3 deletions
diff --git a/cmake/CheckWorkingKqueue.cmake b/cmake/CheckWorkingKqueue.cmake
index 47bf4e83..f22f011b 100644
--- a/cmake/CheckWorkingKqueue.cmake
+++ b/cmake/CheckWorkingKqueue.cmake
@@ -17,7 +17,7 @@ main(int argc, char **argv)
int fd[2];
struct kevent ev;
struct timespec ts;
- char buf[8000];
+ char buf[80000];
if (pipe(fd) == -1)
exit(1);
@@ -27,7 +27,7 @@ main(int argc, char **argv)
while ((n = write(fd[1], buf, sizeof(buf))) == sizeof(buf))
;
- if ((kq = kqueue()) == -1)
+ if ((kq = kqueue()) == -1)
exit(1);
memset(&ev, 0, sizeof(ev));
@@ -49,4 +49,4 @@ main(int argc, char **argv)
exit(0);
}
-" EVENT__HAVE_WORKING_KQUEUE) \ No newline at end of file
+" EVENT__HAVE_WORKING_KQUEUE)