Add the complement to sigemptyset(), sigfillset()!diff -r1.59 -r1.60 src/sys/arch/usermode/include/thunk.h
(reinoud)
--- src/sys/arch/usermode/include/thunk.h 2012/01/11 12:37:50 1.59
+++ src/sys/arch/usermode/include/thunk.h 2012/01/21 19:17:33 1.60
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: thunk.h,v 1.59 2012/01/11 12:37:50 reinoud Exp $ */ | 1 | /* $NetBSD: thunk.h,v 1.60 2012/01/21 19:17:33 reinoud Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 2011 Jared D. McNeill <jmcneill@invisible.ca> | 4 | * Copyright (c) 2011 Jared D. McNeill <jmcneill@invisible.ca> | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * Redistribution and use in source and binary forms, with or without | 7 | * Redistribution and use in source and binary forms, with or without | |
8 | * modification, are permitted provided that the following conditions | 8 | * modification, are permitted provided that the following conditions | |
9 | * are met: | 9 | * are met: | |
10 | * 1. Redistributions of source code must retain the above copyright | 10 | * 1. Redistributions of source code must retain the above copyright | |
11 | * notice, this list of conditions and the following disclaimer. | 11 | * notice, this list of conditions and the following disclaimer. | |
12 | * 2. Redistributions in binary form must reproduce the above copyright | 12 | * 2. Redistributions in binary form must reproduce the above copyright | |
13 | * notice, this list of conditions and the following disclaimer in the | 13 | * notice, this list of conditions and the following disclaimer in the | |
14 | * documentation and/or other materials provided with the distribution. | 14 | * documentation and/or other materials provided with the distribution. | |
@@ -122,26 +122,27 @@ ssize_t thunk_pwrite(int, const void *, | @@ -122,26 +122,27 @@ ssize_t thunk_pwrite(int, const void *, | |||
122 | ssize_t thunk_read(int, void *, size_t); | 122 | ssize_t thunk_read(int, void *, size_t); | |
123 | ssize_t thunk_write(int, const void *, size_t); | 123 | ssize_t thunk_write(int, const void *, size_t); | |
124 | int thunk_fsync(int); | 124 | int thunk_fsync(int); | |
125 | int thunk_mkstemp(char *); | 125 | int thunk_mkstemp(char *); | |
126 | int thunk_unlink(const char *); | 126 | int thunk_unlink(const char *); | |
127 | pid_t thunk_getpid(void); | 127 | pid_t thunk_getpid(void); | |
128 | 128 | |||
129 | int thunk_sigaction(int, const struct sigaction *, struct sigaction *); | 129 | int thunk_sigaction(int, const struct sigaction *, struct sigaction *); | |
130 | int thunk_sigaltstack(const stack_t *, stack_t *); | 130 | int thunk_sigaltstack(const stack_t *, stack_t *); | |
131 | void thunk_signal(int, void (*)(int)); | 131 | void thunk_signal(int, void (*)(int)); | |
132 | int thunk_sigblock(int); | 132 | int thunk_sigblock(int); | |
133 | int thunk_sigunblock(int); | 133 | int thunk_sigunblock(int); | |
134 | int thunk_sigemptyset(sigset_t *sa_mask); | 134 | int thunk_sigemptyset(sigset_t *sa_mask); | |
135 | int thunk_sigfillset(sigset_t *sa_mask); | |||
135 | void thunk_sigaddset(sigset_t *sa_mask, int sig); | 136 | void thunk_sigaddset(sigset_t *sa_mask, int sig); | |
136 | int thunk_sigprocmask(int how, const sigset_t * set, sigset_t *oset); | 137 | int thunk_sigprocmask(int how, const sigset_t * set, sigset_t *oset); | |
137 | int thunk_atexit(void (*function)(void)); | 138 | int thunk_atexit(void (*function)(void)); | |
138 | 139 | |||
139 | int thunk_aio_read(struct aiocb *); | 140 | int thunk_aio_read(struct aiocb *); | |
140 | int thunk_aio_write(struct aiocb *); | 141 | int thunk_aio_write(struct aiocb *); | |
141 | int thunk_aio_error(const struct aiocb *); | 142 | int thunk_aio_error(const struct aiocb *); | |
142 | int thunk_aio_return(struct aiocb *); | 143 | int thunk_aio_return(struct aiocb *); | |
143 | 144 | |||
144 | void * thunk_malloc(size_t len); | 145 | void * thunk_malloc(size_t len); | |
145 | void thunk_free(void *addr); | 146 | void thunk_free(void *addr); | |
146 | void * thunk_sbrk(intptr_t len); | 147 | void * thunk_sbrk(intptr_t len); | |
147 | void * thunk_mmap(void *addr, size_t len, int prot, int flags, int fd, off_t offset); | 148 | void * thunk_mmap(void *addr, size_t len, int prot, int flags, int fd, off_t offset); |
--- src/sys/arch/usermode/usermode/thunk.c 2012/01/15 10:35:08 1.79
+++ src/sys/arch/usermode/usermode/thunk.c 2012/01/21 19:17:33 1.80
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: thunk.c,v 1.79 2012/01/15 10:35:08 jmcneill Exp $ */ | 1 | /* $NetBSD: thunk.c,v 1.80 2012/01/21 19:17:33 reinoud Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 2011 Jared D. McNeill <jmcneill@invisible.ca> | 4 | * Copyright (c) 2011 Jared D. McNeill <jmcneill@invisible.ca> | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * Redistribution and use in source and binary forms, with or without | 7 | * Redistribution and use in source and binary forms, with or without | |
8 | * modification, are permitted provided that the following conditions | 8 | * modification, are permitted provided that the following conditions | |
9 | * are met: | 9 | * are met: | |
10 | * 1. Redistributions of source code must retain the above copyright | 10 | * 1. Redistributions of source code must retain the above copyright | |
11 | * notice, this list of conditions and the following disclaimer. | 11 | * notice, this list of conditions and the following disclaimer. | |
12 | * 2. Redistributions in binary form must reproduce the above copyright | 12 | * 2. Redistributions in binary form must reproduce the above copyright | |
13 | * notice, this list of conditions and the following disclaimer in the | 13 | * notice, this list of conditions and the following disclaimer in the | |
14 | * documentation and/or other materials provided with the distribution. | 14 | * documentation and/or other materials provided with the distribution. | |
@@ -18,27 +18,27 @@ | @@ -18,27 +18,27 @@ | |||
18 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 18 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
19 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | 19 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | |
20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
26 | * POSSIBILITY OF SUCH DAMAGE. | 26 | * POSSIBILITY OF SUCH DAMAGE. | |
27 | */ | 27 | */ | |
28 | 28 | |||
29 | #include <sys/cdefs.h> | 29 | #include <sys/cdefs.h> | |
30 | #ifdef __NetBSD__ | 30 | #ifdef __NetBSD__ | |
31 | __RCSID("$NetBSD: thunk.c,v 1.79 2012/01/15 10:35:08 jmcneill Exp $"); | 31 | __RCSID("$NetBSD: thunk.c,v 1.80 2012/01/21 19:17:33 reinoud Exp $"); | |
32 | #endif | 32 | #endif | |
33 | 33 | |||
34 | #include <sys/types.h> | 34 | #include <sys/types.h> | |
35 | #include <sys/mman.h> | 35 | #include <sys/mman.h> | |
36 | #include <sys/reboot.h> | 36 | #include <sys/reboot.h> | |
37 | #include <sys/poll.h> | 37 | #include <sys/poll.h> | |
38 | #include <sys/sysctl.h> | 38 | #include <sys/sysctl.h> | |
39 | #include <sys/socket.h> | 39 | #include <sys/socket.h> | |
40 | #include <sys/audioio.h> | 40 | #include <sys/audioio.h> | |
41 | #include <sys/shm.h> | 41 | #include <sys/shm.h> | |
42 | #include <machine/vmparam.h> | 42 | #include <machine/vmparam.h> | |
43 | 43 | |||
44 | #include <net/if.h> | 44 | #include <net/if.h> | |
@@ -595,26 +595,33 @@ thunk_sigunblock(int sig) | @@ -595,26 +595,33 @@ thunk_sigunblock(int sig) | |||
595 | 595 | |||
596 | sigemptyset(&set); | 596 | sigemptyset(&set); | |
597 | sigaddset(&set, sig); | 597 | sigaddset(&set, sig); | |
598 | return sigprocmask(SIG_UNBLOCK, &set, NULL); | 598 | return sigprocmask(SIG_UNBLOCK, &set, NULL); | |
599 | } | 599 | } | |
600 | 600 | |||
601 | int | 601 | int | |
602 | thunk_sigemptyset(sigset_t *sa_mask) | 602 | thunk_sigemptyset(sigset_t *sa_mask) | |
603 | { | 603 | { | |
604 | return sigemptyset(sa_mask); | 604 | return sigemptyset(sa_mask); | |
605 | } | 605 | } | |
606 | 606 | |||
607 | 607 | |||
608 | int | |||
609 | thunk_sigfillset(sigset_t *sa_mask) | |||
610 | { | |||
611 | return sigfillset(sa_mask); | |||
612 | } | |||
613 | ||||
614 | ||||
608 | void | 615 | void | |
609 | thunk_sigaddset(sigset_t *sa_mask, int sig) | 616 | thunk_sigaddset(sigset_t *sa_mask, int sig) | |
610 | { | 617 | { | |
611 | int retval; | 618 | int retval; | |
612 | retval = sigaddset(sa_mask, sig); | 619 | retval = sigaddset(sa_mask, sig); | |
613 | if (retval == -1) { | 620 | if (retval == -1) { | |
614 | warn("bad signal added"); | 621 | warn("bad signal added"); | |
615 | abort(); | 622 | abort(); | |
616 | } | 623 | } | |
617 | } | 624 | } | |
618 | 625 | |||
619 | int | 626 | int | |
620 | thunk_sigprocmask(int how, const sigset_t * set, sigset_t *oset) | 627 | thunk_sigprocmask(int how, const sigset_t * set, sigset_t *oset) |