Sun Jul 20 19:03:04 2008 UTC ()
Make the user-namespaced rumpuser_cv_has_waiters() of type int
instead of bool to avoid unnecessary problems in trying to provide
the bool type.


(pooka)
diff -r1.20 -r1.21 src/sys/rump/librump/rumpuser/rumpuser.h
diff -r1.14 -r1.15 src/sys/rump/librump/rumpuser/rumpuser_pth.c

cvs diff -r1.20 -r1.21 src/sys/rump/librump/rumpuser/Attic/rumpuser.h (expand / switch to unified diff)

--- src/sys/rump/librump/rumpuser/Attic/rumpuser.h 2008/07/18 16:19:12 1.20
+++ src/sys/rump/librump/rumpuser/Attic/rumpuser.h 2008/07/20 19:03:04 1.21
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: rumpuser.h,v 1.20 2008/07/18 16:19:12 pooka Exp $ */ 1/* $NetBSD: rumpuser.h,v 1.21 2008/07/20 19:03:04 pooka Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2007 Antti Kantee. All Rights Reserved. 4 * Copyright (c) 2007 Antti Kantee. All Rights Reserved.
5 * 5 *
6 * Development of this software was supported by Google Summer of Code. 6 * Development of this software was supported by Google Summer of Code.
7 * 7 *
8 * Redistribution and use in source and binary forms, with or without 8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions 9 * modification, are permitted provided that the following conditions
10 * are met: 10 * are met:
11 * 1. Redistributions of source code must retain the above copyright 11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer. 12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright 13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the 14 * notice, this list of conditions and the following disclaimer in the
@@ -20,28 +20,26 @@ @@ -20,28 +20,26 @@
20 * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 20 * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
23 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE. 27 * SUCH DAMAGE.
28 */ 28 */
29 29
30#ifndef _SYS_RUMPUSER_H_ 30#ifndef _SYS_RUMPUSER_H_
31#define _SYS_RUMPUSER_H_ 31#define _SYS_RUMPUSER_H_
32 32
33#include <stdbool.h> 
34 
35struct stat; 33struct stat;
36 34
37int rumpuser_stat(const char *, struct stat *, int *); 35int rumpuser_stat(const char *, struct stat *, int *);
38int rumpuser_lstat(const char *, struct stat *, int *); 36int rumpuser_lstat(const char *, struct stat *, int *);
39int rumpuser_nanosleep(const struct timespec *, struct timespec *, int *); 37int rumpuser_nanosleep(const struct timespec *, struct timespec *, int *);
40 38
41#define rumpuser_malloc(a,b) _rumpuser_malloc(a,b,__func__,__LINE__); 39#define rumpuser_malloc(a,b) _rumpuser_malloc(a,b,__func__,__LINE__);
42#define rumpuser_realloc(a,b,c) _rumpuser_realloc(a,b,c,__func__,__LINE__); 40#define rumpuser_realloc(a,b,c) _rumpuser_realloc(a,b,c,__func__,__LINE__);
43 41
44void *_rumpuser_malloc(size_t, int, const char *, int); 42void *_rumpuser_malloc(size_t, int, const char *, int);
45void *_rumpuser_realloc(void *, size_t, int, const char *, int); 43void *_rumpuser_realloc(void *, size_t, int, const char *, int);
46void rumpuser_free(void *); 44void rumpuser_free(void *);
47 45
@@ -97,27 +95,27 @@ void rumpuser_rw_exit(struct rumpuser_rw @@ -97,27 +95,27 @@ void rumpuser_rw_exit(struct rumpuser_rw
97void rumpuser_rw_destroy(struct rumpuser_rw *); 95void rumpuser_rw_destroy(struct rumpuser_rw *);
98int rumpuser_rw_held(struct rumpuser_rw *); 96int rumpuser_rw_held(struct rumpuser_rw *);
99int rumpuser_rw_rdheld(struct rumpuser_rw *); 97int rumpuser_rw_rdheld(struct rumpuser_rw *);
100int rumpuser_rw_wrheld(struct rumpuser_rw *); 98int rumpuser_rw_wrheld(struct rumpuser_rw *);
101 99
102struct rumpuser_cv; 100struct rumpuser_cv;
103 101
104void rumpuser_cv_init(struct rumpuser_cv **); 102void rumpuser_cv_init(struct rumpuser_cv **);
105void rumpuser_cv_destroy(struct rumpuser_cv *); 103void rumpuser_cv_destroy(struct rumpuser_cv *);
106void rumpuser_cv_wait(struct rumpuser_cv *, struct rumpuser_mtx *); 104void rumpuser_cv_wait(struct rumpuser_cv *, struct rumpuser_mtx *);
107int rumpuser_cv_timedwait(struct rumpuser_cv *, struct rumpuser_mtx *, int); 105int rumpuser_cv_timedwait(struct rumpuser_cv *, struct rumpuser_mtx *, int);
108void rumpuser_cv_signal(struct rumpuser_cv *); 106void rumpuser_cv_signal(struct rumpuser_cv *);
109void rumpuser_cv_broadcast(struct rumpuser_cv *); 107void rumpuser_cv_broadcast(struct rumpuser_cv *);
110bool rumpuser_cv_has_waiters(struct rumpuser_cv *); 108int rumpuser_cv_has_waiters(struct rumpuser_cv *);
111 109
112struct lwp; 110struct lwp;
113 111
114void rumpuser_set_curlwp(struct lwp *); 112void rumpuser_set_curlwp(struct lwp *);
115struct lwp *rumpuser_get_curlwp(void); 113struct lwp *rumpuser_get_curlwp(void);
116 114
117/* actually part of the rumpkern */ 115/* actually part of the rumpkern */
118void rump_biodone(void *, size_t, int); 116void rump_biodone(void *, size_t, int);
119 117
120/* "aio" stuff for being able to fire of a B_ASYNC I/O and continue */ 118/* "aio" stuff for being able to fire of a B_ASYNC I/O and continue */
121struct rumpuser_aio { 119struct rumpuser_aio {
122 int rua_fd; 120 int rua_fd;
123 uint8_t *rua_data; 121 uint8_t *rua_data;

cvs diff -r1.14 -r1.15 src/sys/rump/librump/rumpuser/Attic/rumpuser_pth.c (expand / switch to unified diff)

--- src/sys/rump/librump/rumpuser/Attic/rumpuser_pth.c 2008/07/18 16:19:12 1.14
+++ src/sys/rump/librump/rumpuser/Attic/rumpuser_pth.c 2008/07/20 19:03:04 1.15
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: rumpuser_pth.c,v 1.14 2008/07/18 16:19:12 pooka Exp $ */ 1/* $NetBSD: rumpuser_pth.c,v 1.15 2008/07/20 19:03:04 pooka Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2007 Antti Kantee. All Rights Reserved. 4 * Copyright (c) 2007 Antti Kantee. All Rights Reserved.
5 * 5 *
6 * Development of this software was supported by the 6 * Development of this software was supported by the
7 * Finnish Cultural Foundation. 7 * Finnish Cultural Foundation.
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
11 * are met: 11 * are met:
12 * 1. Redistributions of source code must retain the above copyright 12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer. 13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright 14 * 2. Redistributions in binary form must reproduce the above copyright
@@ -320,27 +320,27 @@ void @@ -320,27 +320,27 @@ void
320rumpuser_cv_signal(struct rumpuser_cv *cv) 320rumpuser_cv_signal(struct rumpuser_cv *cv)
321{ 321{
322 322
323 NOFAIL_ERRNO(pthread_cond_signal(&cv->pthcv)); 323 NOFAIL_ERRNO(pthread_cond_signal(&cv->pthcv));
324} 324}
325 325
326void 326void
327rumpuser_cv_broadcast(struct rumpuser_cv *cv) 327rumpuser_cv_broadcast(struct rumpuser_cv *cv)
328{ 328{
329 329
330 NOFAIL_ERRNO(pthread_cond_broadcast(&cv->pthcv)); 330 NOFAIL_ERRNO(pthread_cond_broadcast(&cv->pthcv));
331} 331}
332 332
333bool 333int
334rumpuser_cv_has_waiters(struct rumpuser_cv *cv) 334rumpuser_cv_has_waiters(struct rumpuser_cv *cv)
335{ 335{
336 336
337 return pthread_cond_has_waiters_np(&cv->pthcv); 337 return pthread_cond_has_waiters_np(&cv->pthcv);
338} 338}
339 339
340/* 340/*
341 * curlwp 341 * curlwp
342 */ 342 */
343 343
344void 344void
345rumpuser_set_curlwp(struct lwp *l) 345rumpuser_set_curlwp(struct lwp *l)
346{ 346{