Skip to content

Commit 00d7722

Browse files
committed
Add more missing constants
1 parent 7e6fcd1 commit 00d7722

File tree

1 file changed

+31
-1
lines changed

1 file changed

+31
-1
lines changed

src/unix/redox/mod.rs

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ pub type pthread_t = *mut ::c_void;
1919
pub type pthread_attr_t = *mut ::c_void;
2020
pub type pthread_cond_t = *mut ::c_void;
2121
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;
2324
pub type pthread_mutex_t = *mut ::c_void;
2425
pub type pthread_mutexattr_t = *mut ::c_void;
2526
pub type pthread_rwlock_t = *mut ::c_void;
@@ -69,6 +70,11 @@ s! {
6970
pub s_addr: ::in_addr_t,
7071
}
7172

73+
pub struct ip_mreq {
74+
pub imr_multiaddr: ::in_addr,
75+
pub imr_interface: ::in_addr,
76+
}
77+
7278
pub struct lconv {
7379
pub currency_symbol: *const ::c_char,
7480
pub decimal_point: *const ::c_char,
@@ -289,6 +295,26 @@ extern {
289295
// netdb.h
290296
pub const EAI_SYSTEM: ::c_int = -11;
291297

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+
292318
// netinet/tcp.h
293319
pub const TCP_NODELAY: ::c_int = 1;
294320

@@ -306,6 +332,7 @@ pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 1;
306332
pub const PTHREAD_MUTEX_INITIALIZER: ::pthread_mutex_t = -1isize as *mut _;
307333
pub const PTHREAD_COND_INITIALIZER: ::pthread_cond_t = -1isize as *mut _;
308334
pub const PTHREAD_RWLOCK_INITIALIZER: ::pthread_rwlock_t = -1isize as *mut _;
335+
pub const PTHREAD_STACK_MIN : ::size_t = 4096;
309336
extern {
310337
pub fn pthread_create(tid: *mut ::pthread_t,
311338
attr: *const ::pthread_attr_t,
@@ -389,7 +416,9 @@ pub const MSG_PEEK: ::c_int = 2;
389416
pub const SHUT_RD: ::c_int = 0;
390417
pub const SHUT_WR: ::c_int = 1;
391418
pub const SHUT_RDWR: ::c_int = 2;
419+
pub const SO_REUSEADDR: ::c_int = 2;
392420
pub const SO_ERROR: ::c_int = 4;
421+
pub const SO_BROADCAST: ::c_int = 6;
393422
pub const SO_RCVTIMEO: ::c_int = 20;
394423
pub const SO_SNDTIMEO: ::c_int = 21;
395424
pub const SOCK_STREAM: ::c_int = 1;
@@ -427,6 +456,7 @@ extern {
427456
}
428457

429458
// unistd.h
459+
pub const _SC_PAGESIZE: ::c_int = 30;
430460
pub const SEEK_SET: ::c_int = 0;
431461
pub const SEEK_CUR: ::c_int = 1;
432462
pub const SEEK_END: ::c_int = 2;

0 commit comments

Comments
 (0)