2
2
3
3
pub type blkcnt_t = i64 ;
4
4
pub type blksize_t = i64 ;
5
+ pub type clock_t = i64 ;
5
6
pub type c_char = u8 ;
6
7
pub type c_long = i64 ;
7
8
pub type c_ulong = u64 ;
@@ -22,39 +23,86 @@ pub type wchar_t = ::c_int;
22
23
pub type nfds_t = :: c_ulong ;
23
24
24
25
s ! {
25
- // ------------------------------------------------------------
26
- // networking
27
- pub struct in_addr {
28
- pub s_addr: in_addr_t,
26
+ pub struct ipc_perm {
27
+ pub __key: :: key_t,
28
+ pub uid: :: uid_t,
29
+ pub gid: :: gid_t,
30
+ pub cuid: :: uid_t,
31
+ pub cgid: :: gid_t,
32
+ pub mode: :: c_ushort, // read / write
33
+ __pad1: :: c_ushort,
34
+ pub __seq: :: c_ushort,
35
+ __pad2: :: c_ushort,
36
+ __unused1: :: c_ulong,
37
+ __unused2: :: c_ulong
38
+ }
39
+
40
+ pub struct siginfo_t {
41
+ si_signo: :: c_int, // signal number
42
+ si_errno: :: c_int, // if not zero: error value of signal, see errno.h
43
+ si_code: :: c_int, // signal code
44
+ pub _pad: [ :: c_int; 28 ] , // unported union
45
+ _align: [ usize ; 0 ] ,
29
46
}
30
47
31
- pub struct in6_addr {
32
- pub s6_addr: [ u8 ; 16 ] ,
33
- __align: [ u32 ; 0 ] ,
48
+ pub struct shmid_ds {
49
+ pub shm_perm: :: ipc_perm,
50
+ pub shm_segsz: :: size_t, // segment size in bytes
51
+ pub shm_atime: :: time_t, // time of last shmat()
52
+ pub shm_dtime: :: time_t,
53
+ pub shm_ctime: :: time_t,
54
+ pub shm_cpid: :: pid_t,
55
+ pub shm_lpid: :: pid_t,
56
+ pub shm_nattch: :: shmatt_t,
57
+ __unused1: :: c_ulong,
58
+ __unused2: :: c_ulong
59
+ }
60
+
61
+ pub struct msqid_ds {
62
+ pub msg_perm: :: ipc_perm,
63
+ pub msg_stime: :: time_t,
64
+ pub msg_rtime: :: time_t,
65
+ pub msg_ctime: :: time_t,
66
+ __msg_cbytes: :: c_ulong,
67
+ pub msg_qnum: :: msgqnum_t,
68
+ pub msg_qbytes: :: msglen_t,
69
+ pub msg_lspid: :: pid_t,
70
+ pub msg_lrpid: :: pid_t,
71
+ __ignored1: :: c_ulong,
72
+ __ignored2: :: c_ulong,
34
73
}
35
74
36
75
pub struct sockaddr {
37
- pub sa_family: sa_family_t,
76
+ pub sa_family: :: sa_family_t,
38
77
pub sa_data: [ :: c_char; 14 ] ,
39
78
}
40
79
41
80
pub struct sockaddr_in {
42
- pub sin_family: sa_family_t,
81
+ pub sin_family: :: sa_family_t,
43
82
pub sin_port: :: in_port_t,
44
83
pub sin_addr: :: in_addr,
45
84
pub sin_zero: [ u8 ; 8 ] ,
46
85
}
47
86
48
87
pub struct sockaddr_in6 {
49
- pub sin6_family: sa_family_t,
50
- pub sin6_port: in_port_t,
88
+ pub sin6_family: :: sa_family_t,
89
+ pub sin6_port: :: in_port_t,
51
90
pub sin6_flowinfo: u32 ,
52
91
pub sin6_addr: :: in6_addr,
53
92
pub sin6_scope_id: u32 ,
54
93
}
55
94
56
95
// ------------------------------------------------------------
57
96
// definitions below are *unverified* and might **break** the software
97
+ // pub struct in_addr {
98
+ // pub s_addr: in_addr_t,
99
+ // }
100
+ //
101
+ // pub struct in6_addr {
102
+ // pub s6_addr: [u8; 16],
103
+ // __align: [u32; 0],
104
+ // }
105
+
58
106
pub struct stat { // ToDo
59
107
pub st_dev: :: c_ulong,
60
108
st_pad1: [ :: c_long; 2 ] ,
@@ -100,16 +148,16 @@ s! {
100
148
}
101
149
102
150
pub struct dirent { // Todo
103
- pub d_ino: ino_64_t ,
104
- pub d_off: off64_t,
151
+ pub d_ino: :: ino64_t ,
152
+ pub d_off: :: off64_t,
105
153
d_reclen: u16 ,
106
154
pub d_type: u8 ,
107
155
pub d_name: [ i8 ; 256 ] ,
108
156
}
109
157
110
158
pub struct dirent64 { //
111
- pub d_ino: ino64_t,
112
- pub d_off: off64_t,
159
+ pub d_ino: :: ino64_t,
160
+ pub d_off: :: off64_t,
113
161
pub d_reclen: u16 ,
114
162
pub d_type: u8 ,
115
163
pub d_name: [ i8 ; 256 ] ,
@@ -303,6 +351,7 @@ pub const PTHREAD_MUTEX_NORMAL: ::c_int = 0;
303
351
pub const PTHREAD_MUTEX_RECURSIVE : :: c_int = 1 ;
304
352
pub const PTHREAD_MUTEX_ERRORCHECK : :: c_int = 2 ;
305
353
pub const PTHREAD_MUTEX_DEFAULT : :: c_int = PTHREAD_MUTEX_NORMAL ;
354
+ pub const RLIM_INFINITY : u64 = 0xffffffffffffffff ;
306
355
pub const __SIZEOF_PTHREAD_COND_T: usize = 48 ;
307
356
pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4 ;
308
357
pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56 ;
0 commit comments