Sat Jan 21 19:17:33 2012 UTC ()
Add the complement to sigemptyset(), sigfillset()!


(reinoud)
diff -r1.59 -r1.60 src/sys/arch/usermode/include/thunk.h
diff -r1.79 -r1.80 src/sys/arch/usermode/usermode/thunk.c

cvs diff -r1.59 -r1.60 src/sys/arch/usermode/include/thunk.h (expand / switch to unified diff)

--- 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 *,
122ssize_t thunk_read(int, void *, size_t); 122ssize_t thunk_read(int, void *, size_t);
123ssize_t thunk_write(int, const void *, size_t); 123ssize_t thunk_write(int, const void *, size_t);
124int thunk_fsync(int); 124int thunk_fsync(int);
125int thunk_mkstemp(char *); 125int thunk_mkstemp(char *);
126int thunk_unlink(const char *); 126int thunk_unlink(const char *);
127pid_t thunk_getpid(void); 127pid_t thunk_getpid(void);
128 128
129int thunk_sigaction(int, const struct sigaction *, struct sigaction *); 129int thunk_sigaction(int, const struct sigaction *, struct sigaction *);
130int thunk_sigaltstack(const stack_t *, stack_t *); 130int thunk_sigaltstack(const stack_t *, stack_t *);
131void thunk_signal(int, void (*)(int)); 131void thunk_signal(int, void (*)(int));
132int thunk_sigblock(int); 132int thunk_sigblock(int);
133int thunk_sigunblock(int); 133int thunk_sigunblock(int);
134int thunk_sigemptyset(sigset_t *sa_mask); 134int thunk_sigemptyset(sigset_t *sa_mask);
 135int thunk_sigfillset(sigset_t *sa_mask);
135void thunk_sigaddset(sigset_t *sa_mask, int sig); 136void thunk_sigaddset(sigset_t *sa_mask, int sig);
136int thunk_sigprocmask(int how, const sigset_t * set, sigset_t *oset); 137int thunk_sigprocmask(int how, const sigset_t * set, sigset_t *oset);
137int thunk_atexit(void (*function)(void)); 138int thunk_atexit(void (*function)(void));
138 139
139int thunk_aio_read(struct aiocb *); 140int thunk_aio_read(struct aiocb *);
140int thunk_aio_write(struct aiocb *); 141int thunk_aio_write(struct aiocb *);
141int thunk_aio_error(const struct aiocb *); 142int thunk_aio_error(const struct aiocb *);
142int thunk_aio_return(struct aiocb *); 143int thunk_aio_return(struct aiocb *);
143 144
144void * thunk_malloc(size_t len); 145void * thunk_malloc(size_t len);
145void thunk_free(void *addr); 146void thunk_free(void *addr);
146void * thunk_sbrk(intptr_t len); 147void * thunk_sbrk(intptr_t len);
147void * thunk_mmap(void *addr, size_t len, int prot, int flags, int fd, off_t offset); 148void * thunk_mmap(void *addr, size_t len, int prot, int flags, int fd, off_t offset);

cvs diff -r1.79 -r1.80 src/sys/arch/usermode/usermode/thunk.c (expand / switch to unified diff)

--- 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
601int 601int
602thunk_sigemptyset(sigset_t *sa_mask) 602thunk_sigemptyset(sigset_t *sa_mask)
603{ 603{
604 return sigemptyset(sa_mask); 604 return sigemptyset(sa_mask);
605} 605}
606 606
607 607
 608int
 609thunk_sigfillset(sigset_t *sa_mask)
 610{
 611 return sigfillset(sa_mask);
 612}
 613
 614
608void 615void
609thunk_sigaddset(sigset_t *sa_mask, int sig) 616thunk_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
619int 626int
620thunk_sigprocmask(int how, const sigset_t * set, sigset_t *oset) 627thunk_sigprocmask(int how, const sigset_t * set, sigset_t *oset)