1 #pragma once
2 
3 #include <stdint.h>
4 #include <stdbool.h>
5 
6 typedef unsigned char u_char;
7 typedef unsigned short u_short;
8 typedef unsigned int u_int;
9 typedef unsigned long u_long;
10 
11 typedef uint32_t uid_t;
12 typedef uint32_t gid_t;
13 typedef long long ssize_t;
14 
15 typedef int64_t pid_t;
16 typedef __SIZE_TYPE__ size_t;
17 
18 typedef char *caddr_t;
19 
20 typedef int id_t;
21 
22 typedef uint64_t ino_t;
23 typedef int64_t off_t;
24 
25 typedef uint32_t blkcnt_t;
26 typedef uint32_t blksize_t;
27 typedef uint32_t dev_t;
28 typedef uint16_t mode_t;
29 typedef uint32_t nlink_t;
30 
31 typedef int64_t time_t;
32 typedef uint32_t useconds_t;
33 typedef int32_t suseconds_t;
34 typedef uint32_t clock_t;
35 
36 typedef uint64_t fsblkcnt_t;
37 typedef uint64_t fsfilcnt_t;
38 
39 #define __socklen_t_defined
40 #define __socklen_t uint32_t
41 typedef __socklen_t socklen_t;
42 
43 struct utimbuf
44 {
45     time_t actime;
46     time_t modtime;
47 };
48 
49 typedef int pthread_t;
50 typedef int pthread_key_t;
51 typedef uint32_t pthread_once_t;
52 
53 typedef struct __pthread_mutex_t
54 {
55     uint32_t lock;
56     pthread_t owner;
57     int level;
58     int type;
59 } pthread_mutex_t;
60 
61 typedef void *pthread_attr_t;
62 typedef struct __pthread_mutexattr_t
63 {
64     int type;
65 } pthread_mutexattr_t;
66 
67 typedef struct __pthread_cond_t
68 {
69     pthread_mutex_t *mutex;
70     uint32_t value;
71     int clockid; // clockid_t
72 } pthread_cond_t;
73 
74 typedef uint64_t pthread_rwlock_t;
75 typedef void *pthread_rwlockattr_t;
76 typedef struct __pthread_spinlock_t
77 {
78     int m_lock;
79 } pthread_spinlock_t;
80 typedef struct __pthread_condattr_t
81 {
82     int clockid; // clockid_t
83 } pthread_condattr_t;