search for: have_ppol

Displaying 3 results from an estimated 3 matches for "have_ppol".

Did you mean: have_ppoll
2019 Aug 28
2
[PATCH nbdkit] freebsd: In nbdkit_nanosleep, fallback to calling nanosleep(2).
...ep (unsigned sec, unsigned nsec) { + struct timespec ts; + + if (sec >= INT_MAX - nsec / 1000000000) { + nbdkit_error ("sleep request is too long"); + errno = EINVAL; + return -1; + } + ts.tv_sec = sec + nsec / 1000000000; + ts.tv_nsec = nsec % 1000000000; + #if defined HAVE_PPOLL && defined POLLRDHUP /* End the sleep early if any of these happen: * - nbdkit has received a signal to shut down the server @@ -311,7 +321,6 @@ nbdkit_nanosleep (unsigned sec, unsigned nsec) * NBD_CMD_DISC or a problem with the connection * - the input socket detects POLL...
2019 Aug 03
0
[nbdkit PATCH 3/3] server: Add and use nbdkit_nanosleep
...t; #include <termios.h> #include <errno.h> +#include <poll.h> +#include <signal.h> #include "get-current-dir-name.h" @@ -297,3 +299,62 @@ nbdkit_realpath (const char *path) return ret; } + + +int +nbdkit_nanosleep (unsigned sec, unsigned nsec) +{ +#ifndef HAVE_PPOLL +# error "Please port this to your platform" + /* Porting ideas, in order of preference: + * - POSIX requires pselect; it's a bit clunkier to set up the poll, + * but the same ability to atomically mask all signals and operate + * on struct timespec makes it similar to the...
2019 Aug 03
5
[nbdkit PATCH 0/3] More responsive shutdown
We noticed while writing various libnbd tests that when the delay filter is in use, there are scenarios where we had to resort to SIGKILL to get rid of nbdkit, because it was non-responsive to SIGINT. I'm still trying to figure out the best way to add testsuite coverage of this, but already proved to myself that it works from the command line, under two scenarios that both used to cause long