From: Bruce Cran Date: Wed, 22 Feb 2012 19:56:22 +0000 (+0000) Subject: Implement sigaction for Windows. X-Git-Tag: fio-2.0.4~6 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=e5b8f91cc6229a5f8b38f1338fad29c800fef179;p=fio.git Implement sigaction for Windows. Signed-off-by: Jens Axboe --- diff --git a/os/windows/posix.c b/os/windows/posix.c index ea3736d5..ba7abb54 100755 --- a/os/windows/posix.c +++ b/os/windows/posix.c @@ -124,8 +124,17 @@ void syslog(int priority, const char *message, ... /* argument */) int sigaction(int sig, const struct sigaction *act, struct sigaction *oact) { - errno = ENOSYS; - return (-1); + int rc = 0; + void (*prev_handler)(int); + + prev_handler = signal(sig, act->sa_handler); + if (oact != NULL) + oact->sa_handler = prev_handler; + + if (prev_handler == SIG_ERR) + rc = -1; + + return rc; } int lstat(const char * path, struct stat * buf)