|
| 1 | +pub type c_long = i32; |
| 2 | +pub type c_ulong = u32; |
1 | 3 | pub type mode_t = u16;
|
| 4 | +pub type off64_t = ::c_longlong; |
2 | 5 |
|
3 | 6 | s! {
|
4 | 7 | pub struct sigaction {
|
|
7 | 10 | pub sa_flags: ::c_ulong,
|
8 | 11 | pub sa_restorer: ::dox::Option<extern fn()>,
|
9 | 12 | }
|
| 13 | + |
| 14 | + pub struct stat { |
| 15 | + pub st_dev: ::c_ulonglong, |
| 16 | + __pad0: [::c_uchar; 4], |
| 17 | + __st_ino: ::ino_t, |
| 18 | + pub st_mode: ::c_uint, |
| 19 | + pub st_nlink: ::c_uint, |
| 20 | + pub st_uid: ::uid_t, |
| 21 | + pub st_gid: ::gid_t, |
| 22 | + pub st_rdev: ::c_ulonglong, |
| 23 | + __pad3: [::c_uchar; 4], |
| 24 | + pub st_size: ::c_longlong, |
| 25 | + pub st_blksize: ::blksize_t, |
| 26 | + pub st_blocks: ::c_ulonglong, |
| 27 | + pub st_atime: ::c_ulong, |
| 28 | + pub st_atime_nsec: ::c_ulong, |
| 29 | + pub st_mtime: ::c_ulong, |
| 30 | + pub st_mtime_nsec: ::c_ulong, |
| 31 | + pub st_ctime: ::c_ulong, |
| 32 | + pub st_ctime_nsec: ::c_ulong, |
| 33 | + pub st_ino: ::c_ulonglong, |
| 34 | + } |
| 35 | + |
| 36 | + pub struct stat64 { |
| 37 | + pub st_dev: ::c_ulonglong, |
| 38 | + __pad0: [::c_uchar; 4], |
| 39 | + __st_ino: ::ino_t, |
| 40 | + pub st_mode: ::c_uint, |
| 41 | + pub st_nlink: ::c_uint, |
| 42 | + pub st_uid: ::uid_t, |
| 43 | + pub st_gid: ::gid_t, |
| 44 | + pub st_rdev: ::c_ulonglong, |
| 45 | + __pad3: [::c_uchar; 4], |
| 46 | + pub st_size: ::c_longlong, |
| 47 | + pub st_blksize: ::blksize_t, |
| 48 | + pub st_blocks: ::c_ulonglong, |
| 49 | + pub st_atime: ::c_ulong, |
| 50 | + pub st_atime_nsec: ::c_ulong, |
| 51 | + pub st_mtime: ::c_ulong, |
| 52 | + pub st_mtime_nsec: ::c_ulong, |
| 53 | + pub st_ctime: ::c_ulong, |
| 54 | + pub st_ctime_nsec: ::c_ulong, |
| 55 | + pub st_ino: ::c_ulonglong, |
| 56 | + } |
| 57 | + |
| 58 | + pub struct pthread_attr_t { |
| 59 | + pub flags: ::uint32_t, |
| 60 | + pub stack_base: *mut ::c_void, |
| 61 | + pub stack_size: ::size_t, |
| 62 | + pub guard_size: ::size_t, |
| 63 | + pub sched_policy: ::int32_t, |
| 64 | + pub sched_priority: ::int32_t, |
| 65 | + } |
| 66 | + |
| 67 | + pub struct pthread_mutex_t { value: ::c_int } |
| 68 | + |
| 69 | + pub struct pthread_cond_t { value: ::c_int } |
| 70 | + |
| 71 | + pub struct pthread_rwlock_t { |
| 72 | + lock: pthread_mutex_t, |
| 73 | + cond: pthread_cond_t, |
| 74 | + numLocks: ::c_int, |
| 75 | + writerThreadId: ::c_int, |
| 76 | + pendingReaders: ::c_int, |
| 77 | + pendingWriters: ::c_int, |
| 78 | + attr: i32, |
| 79 | + __reserved: [::c_char; 12], |
| 80 | + } |
| 81 | + |
| 82 | + pub struct passwd { |
| 83 | + pub pw_name: *mut ::c_char, |
| 84 | + pub pw_passwd: *mut ::c_char, |
| 85 | + pub pw_uid: ::uid_t, |
| 86 | + pub pw_gid: ::gid_t, |
| 87 | + pub pw_dir: *mut ::c_char, |
| 88 | + pub pw_shell: *mut ::c_char, |
| 89 | + } |
| 90 | + |
| 91 | + pub struct statfs { |
| 92 | + pub f_type: ::uint32_t, |
| 93 | + pub f_bsize: ::uint32_t, |
| 94 | + pub f_blocks: ::uint64_t, |
| 95 | + pub f_bfree: ::uint64_t, |
| 96 | + pub f_bavail: ::uint64_t, |
| 97 | + pub f_files: ::uint64_t, |
| 98 | + pub f_ffree: ::uint64_t, |
| 99 | + pub f_fsid: ::__fsid_t, |
| 100 | + pub f_namelen: ::uint32_t, |
| 101 | + pub f_frsize: ::uint32_t, |
| 102 | + pub f_flags: ::uint32_t, |
| 103 | + pub f_spare: [::uint32_t; 4], |
| 104 | + } |
10 | 105 | }
|
11 | 106 |
|
12 | 107 | pub const SYS_gettid: ::c_long = 224;
|
| 108 | +pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t { |
| 109 | + value: 0, |
| 110 | +}; |
| 111 | +pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t { |
| 112 | + value: 0, |
| 113 | +}; |
| 114 | +pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t { |
| 115 | + lock: PTHREAD_MUTEX_INITIALIZER, |
| 116 | + cond: PTHREAD_COND_INITIALIZER, |
| 117 | + numLocks: 0, |
| 118 | + writerThreadId: 0, |
| 119 | + pendingReaders: 0, |
| 120 | + pendingWriters: 0, |
| 121 | + attr: 0, |
| 122 | + __reserved: [0; 12], |
| 123 | +}; |
| 124 | +pub const PTHREAD_STACK_MIN: ::size_t = 4096 * 2; |
13 | 125 |
|
14 | 126 | extern {
|
15 | 127 | pub fn timegm64(tm: *const ::tm) -> ::time64_t;
|
|
0 commit comments