Skip to content

Commit 95848f9

Browse files
authored
Merge pull request rust-lang#758 from humenda/uclibc_networking
Add networking symbols for uclibc/x86_64
2 parents 39dba5f + dee3699 commit 95848f9

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

src/unix/uclibc/mod.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1809,6 +1809,10 @@ extern {
18091809
pub fn pthread_atfork(prepare: Option<unsafe extern fn()>,
18101810
parent: Option<unsafe extern fn()>,
18111811
child: Option<unsafe extern fn()>) -> ::c_int;
1812+
pub fn pthread_create(native: *mut ::pthread_t,
1813+
attr: *const ::pthread_attr_t,
1814+
f: extern fn(*mut ::c_void) -> *mut ::c_void,
1815+
value: *mut ::c_void) -> ::c_int;
18121816
pub fn getgrgid(gid: ::gid_t) -> *mut ::group;
18131817
#[cfg_attr(all(target_os = "macos", target_arch = "x86"),
18141818
link_name = "popen$UNIX2003")]
@@ -1827,3 +1831,4 @@ cfg_if! {
18271831
pub use unsupported_target;
18281832
}
18291833
}
1834+

src/unix/uclibc/x86_64/mod.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,14 @@ pub const SIG_SETMASK: ::c_int = 2; // Set the set of blocked signals
327327
pub const PTHREAD_STACK_MIN: usize = 16384;
328328
pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40;
329329
pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4;
330+
pub const SO_BROADCAST: ::c_int = 6;
331+
pub const SOCK_DGRAM: ::c_int = 2; // connectionless, unreliable datagrams
332+
pub const SOCK_STREAM: ::c_int = 1; // …/common/bits/socket_type.h
333+
pub const SO_ERROR: ::c_int = 4;
334+
pub const SOL_SOCKET: ::c_int = 1;
335+
pub const SO_RCVTIMEO: ::c_int = 20;
336+
pub const SO_REUSEADDR: ::c_int = 2;
337+
pub const SO_SNDTIMEO: ::c_int = 21;
330338
pub const PTHREAD_MUTEX_NORMAL: ::c_int = 0;
331339
pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 1;
332340
pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 2;

0 commit comments

Comments
 (0)