2 * Copyright 2002-2012 Haiku, Inc. All Rights Reserved.
3 * Distributed under the terms of the MIT License.
9 #include <config/types.h>
14 /* BSD compatibility */
15 typedef unsigned long u_long
;
16 typedef unsigned int u_int
;
17 typedef unsigned short u_short
;
18 typedef unsigned char u_char
;
21 /* sysV compatibility */
22 typedef unsigned long ulong
;
23 typedef unsigned short ushort
;
24 typedef unsigned int uint
;
25 typedef unsigned char unchar
;
28 typedef __haiku_int64 blkcnt_t
;
29 typedef __haiku_std_int32 blksize_t
;
30 typedef __haiku_int64 fsblkcnt_t
;
31 typedef __haiku_int64 fsfilcnt_t
;
32 typedef __haiku_int64 off_t
;
33 typedef __haiku_int64 ino_t
;
34 typedef __haiku_std_int32 cnt_t
;
35 typedef __haiku_int32 dev_t
;
36 typedef __haiku_int32 pid_t
;
37 typedef __haiku_int32 id_t
;
39 typedef __haiku_std_uint32 uid_t
;
40 typedef __haiku_std_uint32 gid_t
;
41 typedef __haiku_std_uint32 mode_t
;
42 typedef __haiku_std_uint32 umode_t
;
43 typedef __haiku_std_int32 nlink_t
;
45 #ifdef __HAIKU_BEOS_COMPATIBLE_TYPES
46 typedef int daddr_t
; /* disk address */
48 typedef off_t daddr_t
; /* disk address */
50 typedef char* caddr_t
;
52 typedef __haiku_addr_t addr_t
;
53 typedef __haiku_int32 key_t
;
55 typedef __haiku_std_int32 clockid_t
;
56 typedef struct __timer_t
* timer_t
;
61 typedef struct _pthread_thread
*pthread_t
;
62 typedef struct _pthread_attr
*pthread_attr_t
;
63 typedef struct _pthread_barrier pthread_barrier_t
;
64 typedef struct _pthread_barrierattr
*pthread_barrierattr_t
;
65 typedef struct _pthread_mutex pthread_mutex_t
;
66 typedef struct _pthread_mutexattr
*pthread_mutexattr_t
;
67 typedef struct _pthread_cond pthread_cond_t
;
68 typedef struct _pthread_condattr
*pthread_condattr_t
;
69 typedef int pthread_key_t
;
70 typedef struct _pthread_once pthread_once_t
;
71 typedef struct _pthread_rwlock pthread_rwlock_t
;
72 typedef struct _pthread_rwlockattr
*pthread_rwlockattr_t
;
73 typedef struct _pthread_spinlock pthread_spinlock_t
;
75 struct _pthread_mutex
{
76 __haiku_std_uint32 flags
;
77 __haiku_std_int32 lock
;
78 __haiku_std_int32 unused
;
79 __haiku_std_int32 owner
;
80 __haiku_std_int32 owner_count
;
83 struct _pthread_barrier
{
84 __haiku_std_uint32 flags
;
85 __haiku_std_int32 lock
;
86 __haiku_std_int32 mutex
;
87 __haiku_std_int32 waiter_count
;
88 __haiku_std_int32 waiter_max
;
91 struct _pthread_cond
{
92 __haiku_std_uint32 flags
;
93 __haiku_std_int32 unused
;
94 pthread_mutex_t
* mutex
;
95 __haiku_std_int32 waiter_count
;
96 __haiku_std_int32 lock
;
99 struct _pthread_once
{
100 __haiku_std_int32 state
;
103 struct _pthread_rwlock
{
104 __haiku_std_uint32 flags
;
105 __haiku_std_int32 owner
;
108 __haiku_std_int32 mutex
;
109 __haiku_std_int32 unused
;
110 __haiku_std_int32 reader_count
;
111 __haiku_std_int32 writer_count
;
115 __haiku_std_int32 sem
;
120 struct _pthread_spinlock
{
121 __haiku_std_int32 lock
;