@@ -19,7 +19,8 @@ pub type pthread_t = *mut ::c_void;
19
19
pub type pthread_attr_t = * mut :: c_void ;
20
20
pub type pthread_cond_t = * mut :: c_void ;
21
21
pub type pthread_condattr_t = * mut :: c_void ;
22
- pub type pthread_key_t = * mut :: c_void ;
22
+ // Must be usize due to libstd/sys_common/thread_local.rs, should be *mut ::c_void
23
+ pub type pthread_key_t = usize ;
23
24
pub type pthread_mutex_t = * mut :: c_void ;
24
25
pub type pthread_mutexattr_t = * mut :: c_void ;
25
26
pub type pthread_rwlock_t = * mut :: c_void ;
69
70
pub s_addr: :: in_addr_t,
70
71
}
71
72
73
+ pub struct ip_mreq {
74
+ pub imr_multiaddr: :: in_addr,
75
+ pub imr_interface: :: in_addr,
76
+ }
77
+
72
78
pub struct lconv {
73
79
pub currency_symbol: * const :: c_char,
74
80
pub decimal_point: * const :: c_char,
@@ -289,6 +295,26 @@ extern {
289
295
// netdb.h
290
296
pub const EAI_SYSTEM : :: c_int = -11 ;
291
297
298
+ // netinet/in.h
299
+ // TODO: relibc
300
+ pub const IP_TTL : :: c_int = 2 ;
301
+ // TODO: relibc
302
+ pub const IPV6_MULTICAST_LOOP : :: c_int = 19 ;
303
+ // TODO: relibc
304
+ pub const IPV6_ADD_MEMBERSHIP : :: c_int = 20 ;
305
+ // TODO: relibc
306
+ pub const IPV6_DROP_MEMBERSHIP : :: c_int = 21 ;
307
+ // TODO: relibc
308
+ pub const IPV6_V6ONLY : :: c_int = 26 ;
309
+ // TODO: relibc
310
+ pub const IP_MULTICAST_TTL : :: c_int = 33 ;
311
+ // TODO: relibc
312
+ pub const IP_MULTICAST_LOOP : :: c_int = 34 ;
313
+ // TODO: relibc
314
+ pub const IP_ADD_MEMBERSHIP : :: c_int = 35 ;
315
+ // TODO: relibc
316
+ pub const IP_DROP_MEMBERSHIP : :: c_int = 36 ;
317
+
292
318
// netinet/tcp.h
293
319
pub const TCP_NODELAY : :: c_int = 1 ;
294
320
@@ -306,6 +332,7 @@ pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 1;
306
332
pub const PTHREAD_MUTEX_INITIALIZER : :: pthread_mutex_t = -1isize as * mut _ ;
307
333
pub const PTHREAD_COND_INITIALIZER : :: pthread_cond_t = -1isize as * mut _ ;
308
334
pub const PTHREAD_RWLOCK_INITIALIZER : :: pthread_rwlock_t = -1isize as * mut _ ;
335
+ pub const PTHREAD_STACK_MIN : :: size_t = 4096 ;
309
336
extern {
310
337
pub fn pthread_create ( tid : * mut :: pthread_t ,
311
338
attr : * const :: pthread_attr_t ,
@@ -389,7 +416,9 @@ pub const MSG_PEEK: ::c_int = 2;
389
416
pub const SHUT_RD : :: c_int = 0 ;
390
417
pub const SHUT_WR : :: c_int = 1 ;
391
418
pub const SHUT_RDWR : :: c_int = 2 ;
419
+ pub const SO_REUSEADDR : :: c_int = 2 ;
392
420
pub const SO_ERROR : :: c_int = 4 ;
421
+ pub const SO_BROADCAST : :: c_int = 6 ;
393
422
pub const SO_RCVTIMEO : :: c_int = 20 ;
394
423
pub const SO_SNDTIMEO : :: c_int = 21 ;
395
424
pub const SOCK_STREAM : :: c_int = 1 ;
@@ -427,6 +456,7 @@ extern {
427
456
}
428
457
429
458
// unistd.h
459
+ pub const _SC_PAGESIZE: :: c_int = 30 ;
430
460
pub const SEEK_SET : :: c_int = 0 ;
431
461
pub const SEEK_CUR : :: c_int = 1 ;
432
462
pub const SEEK_END : :: c_int = 2 ;
0 commit comments