add a wrapper for signal(3)

This commit is contained in:
jmcneill 2011-08-23 21:55:21 +00:00
parent 76987894af
commit 23f5395b58
2 changed files with 10 additions and 3 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: thunk.h,v 1.14 2011/08/23 17:12:32 jmcneill Exp $ */
/* $NetBSD: thunk.h,v 1.15 2011/08/23 21:55:21 jmcneill Exp $ */
/*-
* Copyright (c) 2011 Jared D. McNeill <jmcneill@invisible.ca>
@ -76,6 +76,7 @@ int thunk_mkstemp(char *);
int thunk_unlink(const char *);
int thunk_sigaction(int, const struct sigaction *, struct sigaction *);
void thunk_signal(int, void (*)(int));
int thunk_aio_read(struct aiocb *);
int thunk_aio_write(struct aiocb *);

View File

@ -1,4 +1,4 @@
/* $NetBSD: thunk.c,v 1.16 2011/08/23 18:36:08 reinoud Exp $ */
/* $NetBSD: thunk.c,v 1.17 2011/08/23 21:55:21 jmcneill Exp $ */
/*-
* Copyright (c) 2011 Jared D. McNeill <jmcneill@invisible.ca>
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__RCSID("$NetBSD: thunk.c,v 1.16 2011/08/23 18:36:08 reinoud Exp $");
__RCSID("$NetBSD: thunk.c,v 1.17 2011/08/23 21:55:21 jmcneill Exp $");
#include <sys/types.h>
#include <sys/ansi.h>
@ -258,6 +258,12 @@ thunk_sigaction(int sig, const struct sigaction *act, struct sigaction *oact)
return sigaction(sig, act, oact);
}
void
thunk_signal(int sig, void (*func)(int))
{
signal(sig, func);
}
int
thunk_aio_read(struct aiocb *aiocbp)
{