IMPORT openssh-9.8p1
[dragonfly.git] / sys / sys / _pthreadtypes.h
blob71aa563d3cf49eecca9ffdd9e5b6eeb23aa6e3a7
1 /*
2 * Copyright (c) 2020 The DragonFly Project. All rights reserved.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
13 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
14 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
15 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
16 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
17 * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
18 * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
19 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
21 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
22 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
23 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
27 #ifndef _SYS__PTHREADTYPES_H_
28 #define _SYS__PTHREADTYPES_H_
30 #include <sys/cdefs.h>
33 * Forward opaque structure definitions that do not pollute namespaces.
34 * To be used in headers where visibility is an issue.
36 struct __pthread_s;
37 struct __pthread_attr_s;
38 struct __pthread_barrier_s;
39 struct __pthread_barrierattr_s;
40 struct __pthread_cond_s;
41 struct __pthread_condattr_s;
42 struct __pthread_mutex_s;
43 struct __pthread_mutexattr_s;
44 struct __pthread_once_s;
45 struct __pthread_rwlock_s;
46 struct __pthread_rwlockattr_s;
47 struct __pthread_spinlock_s;
50 * Basic pthread types to be used in function prototypes.
52 #ifndef _PTHREAD_T_DECLARED
53 typedef struct __pthread_s *pthread_t;
54 #define _PTHREAD_T_DECLARED
55 #endif
56 #ifndef _PTHREAD_ATTR_T_DECLARED
57 typedef struct __pthread_attr_s *pthread_attr_t;
58 #define _PTHREAD_ATTR_T_DECLARED
59 #endif
60 typedef struct __pthread_barrier_s *pthread_barrier_t;
61 typedef struct __pthread_barrierattr_s *pthread_barrierattr_t;
62 typedef struct __pthread_cond_s *pthread_cond_t;
63 typedef struct __pthread_condattr_s *pthread_condattr_t;
64 typedef struct __pthread_mutex_s *pthread_mutex_t;
65 typedef struct __pthread_mutexattr_s *pthread_mutexattr_t;
66 typedef int pthread_key_t;
67 typedef struct __pthread_once_s pthread_once_t;
69 typedef struct __pthread_rwlock_s *pthread_rwlock_t;
70 typedef struct __pthread_rwlockattr_s *pthread_rwlockattr_t;
71 typedef struct __pthread_spinlock_s *pthread_spinlock_t;
74 * Once-only structure (partly public).
76 struct __pthread_once_s {
77 int __state;
78 void *__sparelibc_r; /* unused, kept for ABI compat */
81 #endif /* !_SYS__PTHREADTYPES_H_ */