head 1.5; access; symbols netbsd-10-0-RELEASE:1.5 netbsd-10-0-RC6:1.5 netbsd-10-0-RC5:1.5 netbsd-10-0-RC4:1.5 netbsd-10-0-RC3:1.5 netbsd-10-0-RC2:1.5 netbsd-10-0-RC1:1.5 netbsd-10:1.5.0.26 netbsd-10-base:1.5 netbsd-9-3-RELEASE:1.5 cjep_sun2x-base1:1.5 cjep_sun2x:1.5.0.24 cjep_sun2x-base:1.5 cjep_staticlib_x-base1:1.5 netbsd-9-2-RELEASE:1.5 cjep_staticlib_x:1.5.0.22 cjep_staticlib_x-base:1.5 netbsd-9-1-RELEASE:1.5 phil-wifi-20200421:1.5 phil-wifi-20200411:1.5 is-mlppp:1.5.0.20 is-mlppp-base:1.5 phil-wifi-20200406:1.5 netbsd-8-2-RELEASE:1.5 netbsd-9-0-RELEASE:1.5 netbsd-9-0-RC2:1.5 netbsd-9-0-RC1:1.5 phil-wifi-20191119:1.5 netbsd-9:1.5.0.18 netbsd-9-base:1.5 phil-wifi-20190609:1.5 netbsd-8-1-RELEASE:1.5 netbsd-8-1-RC1:1.5 pgoyette-compat-merge-20190127:1.5 pgoyette-compat-20190127:1.5 pgoyette-compat-20190118:1.5 pgoyette-compat-1226:1.5 pgoyette-compat-1126:1.5 pgoyette-compat-1020:1.5 pgoyette-compat-0930:1.5 pgoyette-compat-0906:1.5 netbsd-7-2-RELEASE:1.4 pgoyette-compat-0728:1.5 netbsd-8-0-RELEASE:1.5 phil-wifi:1.5.0.16 phil-wifi-base:1.5 pgoyette-compat-0625:1.5 netbsd-8-0-RC2:1.5 pgoyette-compat-0521:1.5 pgoyette-compat-0502:1.5 pgoyette-compat-0422:1.5 netbsd-8-0-RC1:1.5 pgoyette-compat-0415:1.5 pgoyette-compat-0407:1.5 pgoyette-compat-0330:1.5 pgoyette-compat-0322:1.5 pgoyette-compat-0315:1.5 netbsd-7-1-2-RELEASE:1.4 pgoyette-compat:1.5.0.14 pgoyette-compat-base:1.5 netbsd-7-1-1-RELEASE:1.4 matt-nb8-mediatek:1.5.0.12 matt-nb8-mediatek-base:1.5 perseant-stdc-iso10646:1.5.0.10 perseant-stdc-iso10646-base:1.5 netbsd-8:1.5.0.8 netbsd-8-base:1.5 prg-localcount2-base3:1.5 prg-localcount2-base2:1.5 prg-localcount2-base1:1.5 prg-localcount2:1.5.0.6 prg-localcount2-base:1.5 pgoyette-localcount-20170426:1.5 bouyer-socketcan-base1:1.5 pgoyette-localcount-20170320:1.5 netbsd-7-1:1.4.0.16 netbsd-7-1-RELEASE:1.4 netbsd-7-1-RC2:1.4 netbsd-7-nhusb-base-20170116:1.4 bouyer-socketcan:1.5.0.4 bouyer-socketcan-base:1.5 pgoyette-localcount-20170107:1.5 netbsd-7-1-RC1:1.4 pgoyette-localcount-20161104:1.5 netbsd-7-0-2-RELEASE:1.4 localcount-20160914:1.5 netbsd-7-nhusb:1.4.0.14 netbsd-7-nhusb-base:1.4 pgoyette-localcount-20160806:1.5 pgoyette-localcount-20160726:1.5 pgoyette-localcount:1.5.0.2 pgoyette-localcount-base:1.5 netbsd-7-0-1-RELEASE:1.4 netbsd-7-0:1.4.0.12 netbsd-7-0-RELEASE:1.4 netbsd-7-0-RC3:1.4 netbsd-7-0-RC2:1.4 netbsd-7-0-RC1:1.4 netbsd-5-2-3-RELEASE:1.3 netbsd-5-1-5-RELEASE:1.3 netbsd-6-0-6-RELEASE:1.3 netbsd-6-1-5-RELEASE:1.3 netbsd-7:1.4.0.10 netbsd-7-base:1.4 yamt-pagecache-base9:1.4 yamt-pagecache-tag8:1.3.6.1 netbsd-6-1-4-RELEASE:1.3 netbsd-6-0-5-RELEASE:1.3 tls-earlyentropy:1.4.0.8 tls-earlyentropy-base:1.4 riastradh-xf86-video-intel-2-7-1-pre-2-21-15:1.4 riastradh-drm2-base3:1.4 netbsd-6-1-3-RELEASE:1.3 netbsd-6-0-4-RELEASE:1.3 netbsd-5-2-2-RELEASE:1.3 netbsd-5-1-4-RELEASE:1.3 netbsd-6-1-2-RELEASE:1.3 netbsd-6-0-3-RELEASE:1.3 netbsd-5-2-1-RELEASE:1.3 netbsd-5-1-3-RELEASE:1.3 netbsd-6-1-1-RELEASE:1.3 riastradh-drm2-base2:1.4 riastradh-drm2-base1:1.4 riastradh-drm2:1.4.0.4 riastradh-drm2-base:1.4 netbsd-6-1:1.3.0.36 netbsd-6-0-2-RELEASE:1.3 netbsd-6-1-RELEASE:1.3 netbsd-6-1-RC4:1.3 netbsd-6-1-RC3:1.3 agc-symver:1.4.0.6 agc-symver-base:1.4 netbsd-6-1-RC2:1.3 netbsd-6-1-RC1:1.3 yamt-pagecache-base8:1.4 netbsd-5-2:1.3.0.34 netbsd-6-0-1-RELEASE:1.3 yamt-pagecache-base7:1.4 netbsd-5-2-RELEASE:1.3 netbsd-5-2-RC1:1.3 matt-nb6-plus-nbase:1.3 yamt-pagecache-base6:1.4 netbsd-6-0:1.3.0.32 netbsd-6-0-RELEASE:1.3 netbsd-6-0-RC2:1.3 tls-maxphys:1.4.0.2 tls-maxphys-base:1.4 matt-nb6-plus:1.3.0.30 matt-nb6-plus-base:1.3 netbsd-6-0-RC1:1.3 yamt-pagecache-base5:1.4 yamt-pagecache-base4:1.4 netbsd-6:1.3.0.28 netbsd-6-base:1.3 netbsd-5-1-2-RELEASE:1.3 netbsd-5-1-1-RELEASE:1.3 yamt-pagecache-base3:1.3 yamt-pagecache-base2:1.3 yamt-pagecache:1.3.0.6 yamt-pagecache-base:1.3 cherry-xenmp:1.3.0.26 cherry-xenmp-base:1.3 uebayasi-xip-base7:1.3 bouyer-quota2-nbase:1.3 bouyer-quota2:1.3.0.24 bouyer-quota2-base:1.3 matt-mips64-premerge-20101231:1.3 matt-nb5-mips64-premerge-20101231:1.3 matt-nb5-pq3:1.3.0.22 matt-nb5-pq3-base:1.3 netbsd-5-1:1.3.0.20 uebayasi-xip-base6:1.3 uebayasi-xip-base5:1.3 netbsd-5-1-RELEASE:1.3 uebayasi-xip-base4:1.3 uebayasi-xip-base3:1.3 netbsd-5-1-RC4:1.3 matt-nb5-mips64-k15:1.3 uebayasi-xip-base2:1.3 netbsd-5-1-RC3:1.3 netbsd-5-1-RC2:1.3 uebayasi-xip-base1:1.3 netbsd-5-1-RC1:1.3 uebayasi-xip:1.3.0.18 uebayasi-xip-base:1.3 netbsd-5-0-2-RELEASE:1.3 matt-nb5-mips64-premerge-20091211:1.3 matt-premerge-20091211:1.3 matt-nb5-mips64-u2-k2-k4-k7-k8-k9:1.3 matt-nb4-mips64-k7-u2a-k9b:1.3 matt-nb5-mips64-u1-k1-k5:1.3 matt-nb5-mips64:1.3.0.16 netbsd-5-0-1-RELEASE:1.3 jym-xensuspend-nbase:1.3 netbsd-5-0:1.3.0.14 netbsd-5-0-RELEASE:1.3 netbsd-5-0-RC4:1.3 netbsd-5-0-RC3:1.3 netbsd-5-0-RC2:1.3 jym-xensuspend:1.3.0.12 jym-xensuspend-base:1.3 netbsd-5-0-RC1:1.3 christos-time_t-nbase:1.3 christos-time_t:1.3.0.10 christos-time_t-base:1.3 netbsd-5:1.3.0.8 netbsd-5-base:1.3 matt-mips64-base2:1.3 matt-mips64:1.2.0.32 netbsd-4-0-1-RELEASE:1.2 wrstuden-revivesa-base-3:1.3 wrstuden-revivesa-base-2:1.3 wrstuden-fixsa-newbase:1.2 wrstuden-revivesa-base-1:1.3 simonb-wapbl-nbase:1.3 yamt-pf42-base4:1.3 simonb-wapbl:1.3.0.4 simonb-wapbl-base:1.3 yamt-pf42-base3:1.3 hpcarm-cleanup-nbase:1.3 yamt-pf42-baseX:1.2 yamt-pf42-base2:1.3 wrstuden-revivesa:1.3.0.2 wrstuden-revivesa-base:1.3 yamt-pf42:1.2.0.30 yamt-pf42-base:1.2 keiichi-mipv6:1.2.0.28 keiichi-mipv6-base:1.2 matt-armv6-nbase:1.2 matt-armv6-prevmlocking:1.2 wrstuden-fixsa-base-1:1.2 netbsd-4-0:1.2.0.26 netbsd-4-0-RELEASE:1.2 cube-autoconf:1.2.0.24 cube-autoconf-base:1.2 netbsd-4-0-RC5:1.2 netbsd-4-0-RC4:1.2 netbsd-4-0-RC3:1.2 netbsd-4-0-RC2:1.2 netbsd-4-0-RC1:1.2 matt-armv6:1.2.0.22 matt-armv6-base:1.2 matt-mips64-base:1.2 hpcarm-cleanup:1.2.0.20 hpcarm-cleanup-base:1.2 netbsd-3-1-1-RELEASE:1.2 netbsd-3-0-3-RELEASE:1.2 wrstuden-fixsa:1.2.0.18 wrstuden-fixsa-base:1.2 abandoned-netbsd-4-base:1.2 abandoned-netbsd-4:1.2.0.12 netbsd-3-1:1.2.0.14 netbsd-3-1-RELEASE:1.2 netbsd-3-0-2-RELEASE:1.2 netbsd-3-1-RC4:1.2 netbsd-3-1-RC3:1.2 netbsd-3-1-RC2:1.2 netbsd-3-1-RC1:1.2 netbsd-4:1.2.0.16 netbsd-4-base:1.2 netbsd-3-0-1-RELEASE:1.2 netbsd-3-0:1.2.0.10 netbsd-3-0-RELEASE:1.2 netbsd-3-0-RC6:1.2 netbsd-3-0-RC5:1.2 netbsd-3-0-RC4:1.2 netbsd-3-0-RC3:1.2 netbsd-3-0-RC2:1.2 netbsd-3-0-RC1:1.2 netbsd-2-0-3-RELEASE:1.2 netbsd-2-1:1.2.0.8 netbsd-2-1-RELEASE:1.2 netbsd-2-1-RC6:1.2 netbsd-2-1-RC5:1.2 netbsd-2-1-RC4:1.2 netbsd-2-1-RC3:1.2 netbsd-2-1-RC2:1.2 netbsd-2-1-RC1:1.2 netbsd-2-0-2-RELEASE:1.2 netbsd-3:1.2.0.6 netbsd-3-base:1.2 netbsd-2-0-1-RELEASE:1.2 netbsd-2:1.2.0.4 netbsd-2-base:1.2 netbsd-2-0-RELEASE:1.2 netbsd-2-0-RC5:1.2 netbsd-2-0-RC4:1.2 netbsd-2-0-RC3:1.2 netbsd-2-0-RC2:1.2 netbsd-2-0-RC1:1.2 netbsd-2-0:1.2.0.2 netbsd-2-0-base:1.2; locks; strict; comment @ * @; 1.5 date 2016.04.24.19.48.29; author dholland; state Exp; branches; next 1.4; commitid Y697uVU6DCNvRU3z; 1.4 date 2012.03.08.21.59.28; author joerg; state Exp; branches; next 1.3; 1.3 date 2008.04.28.20.22.54; author martin; state Exp; branches 1.3.6.1 1.3.10.1; next 1.2; 1.2 date 2003.01.21.12.27.11; author kleink; state Exp; branches 1.2.30.1; next 1.1; 1.1 date 2003.01.20.20.09.50; author christos; state Exp; branches; next ; 1.3.6.1 date 2012.04.17.00.05.10; author yamt; state Exp; branches; next ; 1.3.10.1 date 2008.04.28.20.22.54; author martin; state dead; branches; next 1.3.10.2; 1.3.10.2 date 2008.04.28.20.22.55; author martin; state Exp; branches; next ; 1.2.30.1 date 2008.05.18.12.30.09; author yamt; state Exp; branches; next ; desc @@ 1.5 log @Define SEM_VALUE_MAX in only one place. Adding a whole extra header file just for this is not the optimal solution... but stuffing it in with anything else exposes things that otherwise wouldn't be. Nothing in userland should use directly, and if some foolish third-party software should decide to do so anyway in spite of the instructions to the contrary I will ruthlessly break it later when the big kernel includes cleanup finally happens. Reported by Kamil Rytarowski, and, as it turns out, also by Klaus Heinz in 2008. @ text @/* $NetBSD: semaphore.h,v 1.4 2012/03/08 21:59:28 joerg Exp $ */ /*- * Copyright (c) 2003 The NetBSD Foundation, Inc. * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation * by Christos Zoulas. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ #ifndef _SEMAPHORE_H_ #define _SEMAPHORE_H_ /* POSIX 1003.1b semaphores */ struct _sem_st; typedef struct _sem_st *sem_t; #define SEM_FAILED ((sem_t *)0) #include /* some kernel-only bits */ #include __BEGIN_DECLS int sem_close(sem_t *); int sem_destroy(sem_t *); int sem_getvalue(sem_t * __restrict, int * __restrict); int sem_init(sem_t *, int, unsigned int); int sem_post(sem_t *); int sem_timedwait(sem_t *, const struct timespec * __restrict); int sem_trywait(sem_t *); int sem_unlink(const char *); int sem_wait(sem_t *); sem_t *sem_open(const char *, int, ...); __END_DECLS #endif /* !_SEMAPHORE_H_ */ @ 1.4 log @Implement sem_timedwait. @ text @d1 1 a1 1 /* $NetBSD: semaphore.h,v 1.3 2008/04/28 20:22:54 martin Exp $ */ a40 1 #define SEM_VALUE_MAX (~0U) d42 1 @ 1.3 log @Remove clause 3 and 4 from TNF licenses @ text @d1 1 a1 1 /* $NetBSD: semaphore.h,v 1.2 2003/01/21 12:27:11 kleink Exp $ */ d43 1 a43 1 #include d51 1 @ 1.3.6.1 log @sync with head @ text @d1 1 a1 1 /* $NetBSD: semaphore.h,v 1.3 2008/04/28 20:22:54 martin Exp $ */ d43 1 a43 1 #include a50 1 int sem_timedwait(sem_t *, const struct timespec * __restrict); @ 1.3.10.1 log @file semaphore.h was added on branch christos-time_t on 2008-04-28 20:22:55 +0000 @ text @d1 57 @ 1.3.10.2 log @Remove clause 3 and 4 from TNF licenses @ text @a0 57 /* $NetBSD: semaphore.h,v 1.3 2008/04/28 20:22:54 martin Exp $ */ /*- * Copyright (c) 2003 The NetBSD Foundation, Inc. * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation * by Christos Zoulas. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ #ifndef _SEMAPHORE_H_ #define _SEMAPHORE_H_ /* POSIX 1003.1b semaphores */ struct _sem_st; typedef struct _sem_st *sem_t; #define SEM_FAILED ((sem_t *)0) #define SEM_VALUE_MAX (~0U) #include __BEGIN_DECLS int sem_close(sem_t *); int sem_destroy(sem_t *); int sem_getvalue(sem_t * __restrict, int * __restrict); int sem_init(sem_t *, int, unsigned int); int sem_post(sem_t *); int sem_trywait(sem_t *); int sem_unlink(const char *); int sem_wait(sem_t *); sem_t *sem_open(const char *, int, ...); __END_DECLS #endif /* !_SEMAPHORE_H_ */ @ 1.2 log @Need . @ text @d1 1 a1 1 /* $NetBSD: semaphore.h,v 1.1 2003/01/20 20:09:50 christos Exp $ */ a17 7 * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the NetBSD * Foundation, Inc. and its contributors. * 4. Neither the name of The NetBSD Foundation nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. @ 1.2.30.1 log @sync with head. @ text @d1 1 a1 1 /* $NetBSD: semaphore.h,v 1.2 2003/01/21 12:27:11 kleink Exp $ */ d18 7 @ 1.1 log @add support for p1003.1b semaphores. From FreeBSD @ text @d1 1 a1 1 /* $NetBSD$ */ d38 1 d49 2 @