summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Cran <bruce@cran.org.uk>2012-02-22 19:56:22 +0000
committerJens Axboe <axboe@kernel.dk>2012-02-22 21:11:35 +0100
commite5b8f91cc6229a5f8b38f1338fad29c800fef179 (patch)
tree11b2b921b44fa48d20b57b5db2977f8e02c5a96a
parent3892182aff21486d9c38a346fe8681c9098ecb0c (diff)
downloadfio-e5b8f91cc6229a5f8b38f1338fad29c800fef179.tar.gz
fio-e5b8f91cc6229a5f8b38f1338fad29c800fef179.tar.bz2
Implement sigaction for Windows.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rwxr-xr-xos/windows/posix.c13
1 files changed, 11 insertions, 2 deletions
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)