]> git.proxmox.com Git - rustc.git/blob - src/liblibc/src/unix/bsd/openbsdlike/netbsd.rs
Imported Upstream version 1.9.0+dfsg1
[rustc.git] / src / liblibc / src / unix / bsd / openbsdlike / netbsd.rs
1 pub type clock_t = ::c_uint;
2 pub type suseconds_t = ::c_int;
3 pub type dev_t = u64;
4 pub type blksize_t = ::int32_t;
5 pub type fsblkcnt_t = ::uint64_t;
6 pub type fsfilcnt_t = ::uint64_t;
7
8 s! {
9 pub struct dirent {
10 pub d_fileno: ::ino_t,
11 pub d_reclen: u16,
12 pub d_namlen: u16,
13 pub d_type: u8,
14 pub d_name: [::c_char; 512],
15 }
16
17 pub struct glob_t {
18 pub gl_pathc: ::size_t,
19 __unused1: ::c_int,
20 pub gl_offs: ::size_t,
21 __unused2: ::c_int,
22 pub gl_pathv: *mut *mut ::c_char,
23
24 __unused3: *mut ::c_void,
25
26 __unused4: *mut ::c_void,
27 __unused5: *mut ::c_void,
28 __unused6: *mut ::c_void,
29 __unused7: *mut ::c_void,
30 __unused8: *mut ::c_void,
31 }
32
33 pub struct sigset_t {
34 __bits: [u32; 4],
35 }
36
37 pub struct stat {
38 pub st_dev: ::dev_t,
39 pub st_mode: ::mode_t,
40 pub st_ino: ::ino_t,
41 pub st_nlink: ::nlink_t,
42 pub st_uid: ::uid_t,
43 pub st_gid: ::gid_t,
44 pub st_rdev: ::dev_t,
45 pub st_atime: ::time_t,
46 pub st_atimensec: ::c_long,
47 pub st_mtime: ::time_t,
48 pub st_mtimensec: ::c_long,
49 pub st_ctime: ::time_t,
50 pub st_ctimensec: ::c_long,
51 pub st_birthtime: ::time_t,
52 pub st_birthtimensec: ::c_long,
53 pub st_size: ::off_t,
54 pub st_blocks: ::blkcnt_t,
55 pub st_blksize: ::blksize_t,
56 pub st_flags: ::uint32_t,
57 pub st_gen: ::uint32_t,
58 pub st_spare: [::uint32_t; 2],
59 }
60
61 pub struct statvfs {
62 pub f_flag: ::c_ulong,
63 pub f_bsize: ::c_ulong,
64 pub f_frsize: ::c_ulong,
65 pub f_iosize: ::c_ulong,
66
67 pub f_blocks: ::fsblkcnt_t,
68 pub f_bfree: ::fsblkcnt_t,
69 pub f_bavail: ::fsblkcnt_t,
70 pub f_bresvd: ::fsblkcnt_t,
71
72 pub f_files: ::fsfilcnt_t,
73 pub f_ffree: ::fsfilcnt_t,
74 pub f_favail: ::fsfilcnt_t,
75 pub f_fresvd: ::fsfilcnt_t,
76
77 pub f_syncreads: ::uint64_t,
78 pub f_syncwrites: ::uint64_t,
79
80 pub f_asyncreads: ::uint64_t,
81 pub f_asyncwrites: ::uint64_t,
82
83 pub f_fsidx: ::fsid_t,
84 pub f_fsid: ::c_ulong,
85 pub f_namemax: ::c_ulong,
86 pub f_owner: ::uid_t,
87
88 pub f_spare: [::uint32_t; 4],
89
90 pub f_fstypename: [::c_char; 32],
91 pub f_mntonname: [::c_char; 1024],
92 pub f_mntfromname: [::c_char; 1024],
93 }
94
95 pub struct addrinfo {
96 pub ai_flags: ::c_int,
97 pub ai_family: ::c_int,
98 pub ai_socktype: ::c_int,
99 pub ai_protocol: ::c_int,
100 pub ai_addrlen: ::socklen_t,
101 pub ai_canonname: *mut ::c_char,
102 pub ai_addr: *mut ::sockaddr,
103 pub ai_next: *mut ::addrinfo,
104 }
105
106 pub struct sockaddr_storage {
107 pub ss_len: u8,
108 pub ss_family: ::sa_family_t,
109 __ss_pad1: [u8; 6],
110 __ss_pad2: i64,
111 __ss_pad3: [u8; 112],
112 }
113
114 pub struct siginfo_t {
115 pub si_signo: ::c_int,
116 pub si_code: ::c_int,
117 pub si_errno: ::c_int,
118 __pad1: ::c_int,
119 pub si_addr: *mut ::c_void,
120 __pad2: [u64; 13],
121 }
122
123 pub struct pthread_attr_t {
124 pta_magic: ::c_uint,
125 pta_flags: ::c_int,
126 pta_private: *mut ::c_void,
127 }
128
129 pub struct pthread_mutex_t {
130 ptm_magic: ::c_uint,
131 ptm_errorcheck: ::c_uchar,
132 ptm_pad1: [u8; 3],
133 ptm_interlock: ::c_uchar,
134 ptm_pad2: [u8; 3],
135 ptm_owner: ::pthread_t,
136 ptm_waiters: *mut u8,
137 ptm_recursed: ::c_uint,
138 ptm_spare2: *mut ::c_void,
139 }
140
141 pub struct pthread_mutexattr_t {
142 ptma_magic: ::c_uint,
143 ptma_private: *mut ::c_void,
144 }
145
146 pub struct pthread_cond_t {
147 ptc_magic: ::c_uint,
148 ptc_lock: ::c_uchar,
149 ptc_waiters_first: *mut u8,
150 ptc_waiters_last: *mut u8,
151 ptc_mutex: *mut ::pthread_mutex_t,
152 ptc_private: *mut ::c_void,
153 }
154
155 pub struct pthread_rwlock_t {
156 ptr_magic: ::c_uint,
157 ptr_interlock: ::c_uchar,
158 ptr_rblocked_first: *mut u8,
159 ptr_rblocked_last: *mut u8,
160 ptr_wblocked_first: *mut u8,
161 ptr_wblocked_last: *mut u8,
162 ptr_nreaders: ::c_uint,
163 ptr_owner: ::pthread_t,
164 ptr_private: *mut ::c_void,
165 }
166
167 pub struct kevent {
168 pub ident: ::uintptr_t,
169 pub filter: ::uint32_t,
170 pub flags: ::uint32_t,
171 pub fflags: ::uint32_t,
172 pub data: ::int64_t,
173 pub udata: ::intptr_t,
174 }
175
176 pub struct dqblk {
177 pub dqb_bhardlimit: ::uint32_t,
178 pub dqb_bsoftlimit: ::uint32_t,
179 pub dqb_curblocks: ::uint32_t,
180 pub dqb_ihardlimit: ::uint32_t,
181 pub dqb_isoftlimit: ::uint32_t,
182 pub dqb_curinodes: ::uint32_t,
183 pub dqb_btime: ::int32_t,
184 pub dqb_itime: ::int32_t,
185 }
186
187 pub struct Dl_info {
188 pub dli_fname: *const ::c_char,
189 pub dli_fbase: *mut ::c_void,
190 pub dli_sname: *const ::c_char,
191 pub dli_saddr: *const ::c_void,
192 }
193
194 pub struct lconv {
195 pub decimal_point: *mut ::c_char,
196 pub thousands_sep: *mut ::c_char,
197 pub grouping: *mut ::c_char,
198 pub int_curr_symbol: *mut ::c_char,
199 pub currency_symbol: *mut ::c_char,
200 pub mon_decimal_point: *mut ::c_char,
201 pub mon_thousands_sep: *mut ::c_char,
202 pub mon_grouping: *mut ::c_char,
203 pub positive_sign: *mut ::c_char,
204 pub negative_sign: *mut ::c_char,
205 pub int_frac_digits: ::c_char,
206 pub frac_digits: ::c_char,
207 pub p_cs_precedes: ::c_char,
208 pub p_sep_by_space: ::c_char,
209 pub n_cs_precedes: ::c_char,
210 pub n_sep_by_space: ::c_char,
211 pub p_sign_posn: ::c_char,
212 pub n_sign_posn: ::c_char,
213 pub int_p_cs_precedes: ::c_char,
214 pub int_n_cs_precedes: ::c_char,
215 pub int_p_sep_by_space: ::c_char,
216 pub int_n_sep_by_space: ::c_char,
217 pub int_p_sign_posn: ::c_char,
218 pub int_n_sign_posn: ::c_char,
219 }
220 }
221
222 pub const O_CLOEXEC: ::c_int = 0x400000;
223 pub const O_ALT_IO: ::c_int = 0x40000;
224 pub const O_NOSIGPIPE: ::c_int = 0x1000000;
225 pub const O_SEARCH: ::c_int = 0x800000;
226 pub const O_EXLOCK: ::c_int = 0x20;
227 pub const O_SHLOCK: ::c_int = 0x10;
228 pub const O_DIRECTORY: ::c_int = 0x200000;
229
230 pub const MS_SYNC : ::c_int = 0x4;
231 pub const MS_INVALIDATE : ::c_int = 0x2;
232
233 pub const RLIM_NLIMITS: ::c_int = 12;
234
235 pub const ENOATTR : ::c_int = 93;
236 pub const EILSEQ : ::c_int = 85;
237 pub const EOVERFLOW : ::c_int = 84;
238 pub const ECANCELED : ::c_int = 87;
239 pub const EIDRM : ::c_int = 82;
240 pub const ENOMSG : ::c_int = 83;
241 pub const ENOTSUP : ::c_int = 86;
242 pub const ELAST : ::c_int = 96;
243
244 pub const F_DUPFD_CLOEXEC : ::c_int = 12;
245 pub const F_CLOSEM: ::c_int = 10;
246 pub const F_GETNOSIGPIPE: ::c_int = 13;
247 pub const F_SETNOSIGPIPE: ::c_int = 14;
248 pub const F_MAXFD: ::c_int = 11;
249
250 pub const IPV6_JOIN_GROUP: ::c_int = 12;
251 pub const IPV6_LEAVE_GROUP: ::c_int = 13;
252
253 pub const SO_SNDTIMEO: ::c_int = 0x100b;
254 pub const SO_RCVTIMEO: ::c_int = 0x100c;
255
256 pub const KERN_PROC : ::c_int = 14;
257 pub const O_DSYNC : ::c_int = 0x10000;
258
259 pub const MAP_RENAME : ::c_int = 0x20;
260 pub const MAP_NORESERVE : ::c_int = 0x40;
261 pub const MAP_HASSEMAPHORE : ::c_int = 0x200;
262 pub const MAP_WIRED: ::c_int = 0x800;
263
264 pub const _SC_IOV_MAX : ::c_int = 32;
265 pub const _SC_GETGR_R_SIZE_MAX : ::c_int = 47;
266 pub const _SC_GETPW_R_SIZE_MAX : ::c_int = 48;
267 pub const _SC_LOGIN_NAME_MAX : ::c_int = 37;
268 pub const _SC_MQ_PRIO_MAX : ::c_int = 55;
269 pub const _SC_NPROCESSORS_ONLN : ::c_int = 1002;
270 pub const _SC_THREADS : ::c_int = 41;
271 pub const _SC_THREAD_ATTR_STACKADDR : ::c_int = 61;
272 pub const _SC_THREAD_ATTR_STACKSIZE : ::c_int = 62;
273 pub const _SC_THREAD_DESTRUCTOR_ITERATIONS : ::c_int = 57;
274 pub const _SC_THREAD_KEYS_MAX : ::c_int = 58;
275 pub const _SC_THREAD_PRIO_INHERIT : ::c_int = 64;
276 pub const _SC_THREAD_PRIO_PROTECT : ::c_int = 65;
277 pub const _SC_THREAD_PRIORITY_SCHEDULING : ::c_int = 63;
278 pub const _SC_THREAD_PROCESS_SHARED : ::c_int = 66;
279 pub const _SC_THREAD_SAFE_FUNCTIONS : ::c_int = 67;
280 pub const _SC_THREAD_STACK_MIN : ::c_int = 59;
281 pub const _SC_THREAD_THREADS_MAX : ::c_int = 60;
282 pub const _SC_TTY_NAME_MAX : ::c_int = 68;
283 pub const _SC_ATEXIT_MAX : ::c_int = 40;
284 pub const _SC_CLK_TCK : ::c_int = 39;
285 pub const _SC_AIO_LISTIO_MAX : ::c_int = 51;
286 pub const _SC_AIO_MAX : ::c_int = 52;
287 pub const _SC_ASYNCHRONOUS_IO : ::c_int = 50;
288 pub const _SC_MAPPED_FILES : ::c_int = 33;
289 pub const _SC_MEMLOCK : ::c_int = 34;
290 pub const _SC_MEMLOCK_RANGE : ::c_int = 35;
291 pub const _SC_MEMORY_PROTECTION : ::c_int = 36;
292 pub const _SC_MESSAGE_PASSING : ::c_int = 53;
293 pub const _SC_MQ_OPEN_MAX : ::c_int = 54;
294 pub const _SC_PRIORITY_SCHEDULING : ::c_int = 56;
295 pub const _SC_SEMAPHORES : ::c_int = 42;
296 pub const _SC_SHARED_MEMORY_OBJECTS : ::c_int = 87;
297 pub const _SC_SYNCHRONIZED_IO : ::c_int = 31;
298 pub const _SC_TIMERS : ::c_int = 44;
299
300 pub const FD_SETSIZE: usize = 0x100;
301
302 pub const ST_NOSUID: ::c_ulong = 8;
303
304 pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t {
305 ptm_magic: 0x33330003,
306 ptm_errorcheck: 0,
307 ptm_interlock: 0,
308 ptm_waiters: 0 as *mut _,
309 ptm_owner: 0,
310 ptm_pad1: [0; 3],
311 ptm_pad2: [0; 3],
312 ptm_recursed: 0,
313 ptm_spare2: 0 as *mut _,
314 };
315 pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t {
316 ptc_magic: 0x55550005,
317 ptc_lock: 0,
318 ptc_waiters_first: 0 as *mut _,
319 ptc_waiters_last: 0 as *mut _,
320 ptc_mutex: 0 as *mut _,
321 ptc_private: 0 as *mut _,
322 };
323 pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t {
324 ptr_magic: 0x99990009,
325 ptr_interlock: 0,
326 ptr_rblocked_first: 0 as *mut _,
327 ptr_rblocked_last: 0 as *mut _,
328 ptr_wblocked_first: 0 as *mut _,
329 ptr_wblocked_last: 0 as *mut _,
330 ptr_nreaders: 0,
331 ptr_owner: 0,
332 ptr_private: 0 as *mut _,
333 };
334 pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 2;
335 pub const KERN_PROC_ARGS: ::c_int = 48;
336
337 pub const EVFILT_AIO: ::int16_t = 2;
338 pub const EVFILT_PROC: ::int16_t = 4;
339 pub const EVFILT_READ: ::int16_t = 0;
340 pub const EVFILT_SIGNAL: ::int16_t = 5;
341 pub const EVFILT_SYSCOUNT: ::int16_t = 7;
342 pub const EVFILT_TIMER: ::int16_t = 6;
343 pub const EVFILT_VNODE: ::int16_t = 3;
344 pub const EVFILT_WRITE: ::int16_t = 1;
345
346 pub const NOTE_PCTRLMASK: ::uint32_t = 0xf0000000;
347
348 pub const CRTSCTS: ::tcflag_t = 0x00010000;
349
350 pub const TMP_MAX : ::c_uint = 308915776;
351
352 pub const NI_MAXHOST: ::socklen_t = 1025;
353
354 pub const RTLD_NOLOAD: ::c_int = 0x2000;
355 pub const RTLD_LOCAL: ::c_int = 0x200;
356
357 extern {
358 pub fn getnameinfo(sa: *const ::sockaddr,
359 salen: ::socklen_t,
360 host: *mut ::c_char,
361 hostlen: ::socklen_t,
362 serv: *mut ::c_char,
363 sevlen: ::socklen_t,
364 flags: ::c_int) -> ::c_int;
365 pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int)
366 -> ::c_int;
367 pub fn sysctl(name: *const ::c_int,
368 namelen: ::c_uint,
369 oldp: *mut ::c_void,
370 oldlenp: *mut ::size_t,
371 newp: *const ::c_void,
372 newlen: ::size_t)
373 -> ::c_int;
374 pub fn sysctlbyname(name: *const ::c_char,
375 oldp: *mut ::c_void,
376 oldlenp: *mut ::size_t,
377 newp: *const ::c_void,
378 newlen: ::size_t)
379 -> ::c_int;
380 #[link_name = "__kevent50"]
381 pub fn kevent(kq: ::c_int,
382 changelist: *const ::kevent,
383 nchanges: ::size_t,
384 eventlist: *mut ::kevent,
385 nevents: ::size_t,
386 timeout: *const ::timespec) -> ::c_int;
387 #[link_name = "__mount50"]
388 pub fn mount(src: *const ::c_char,
389 target: *const ::c_char,
390 flags: ::c_int,
391 data: *mut ::c_void,
392 size: ::size_t) -> ::c_int;
393 pub fn ptrace(requeset: ::c_int,
394 pid: ::pid_t,
395 addr: *mut ::c_void,
396 data: ::c_int) -> ::c_int;
397 pub fn sethostname(name: *const ::c_char, len: ::size_t) -> ::c_int;
398 pub fn pthread_setname_np(t: ::pthread_t,
399 name: *const ::c_char,
400 arg: *mut ::c_void) -> ::c_int;
401 pub fn pthread_getattr_np(native: ::pthread_t,
402 attr: *mut ::pthread_attr_t) -> ::c_int;
403 pub fn pthread_attr_getguardsize(attr: *const ::pthread_attr_t,
404 guardsize: *mut ::size_t) -> ::c_int;
405 pub fn pthread_attr_getstack(attr: *const ::pthread_attr_t,
406 stackaddr: *mut *mut ::c_void,
407 stacksize: *mut ::size_t) -> ::c_int;
408 #[link_name = "__sigtimedwait50"]
409 pub fn sigtimedwait(set: *const sigset_t,
410 info: *mut siginfo_t,
411 timeout: *const ::timespec) -> ::c_int;
412 pub fn sigwaitinfo(set: *const sigset_t,
413 info: *mut siginfo_t) -> ::c_int;
414 }