diff options
author | Daniel Mueller <deso@posteo.net> | 2017-03-26 17:07:34 -0700 |
---|---|---|
committer | Daniel Mueller <deso@posteo.net> | 2017-03-26 17:07:34 -0700 |
commit | cb39828ecd7ea5d2eac3076ad3dd1b6ef05e10d3 (patch) | |
tree | ee9b7fb3e686a2154a95487e404b605d141b9258 /libc/src/redox.rs | |
parent | 86415f23a86b5a44aa000d513500a9d1d0df4bba (diff) | |
download | nitrocli-cb39828ecd7ea5d2eac3076ad3dd1b6ef05e10d3.tar.gz nitrocli-cb39828ecd7ea5d2eac3076ad3dd1b6ef05e10d3.tar.bz2 |
Import subrepo libc/:libc at 05a2d197356ef253dfd985166576619ac9b6947f
Diffstat (limited to 'libc/src/redox.rs')
-rw-r--r-- | libc/src/redox.rs | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/libc/src/redox.rs b/libc/src/redox.rs new file mode 100644 index 0000000..3f2ed9c --- /dev/null +++ b/libc/src/redox.rs @@ -0,0 +1,57 @@ +pub type c_char = i8; +pub type c_long = i64; +pub type c_ulong = u64; + +pub type wchar_t = i16; + +pub type off_t = usize; +pub type mode_t = u16; +pub type time_t = i64; +pub type pid_t = usize; +pub type gid_t = usize; +pub type uid_t = usize; + +pub type in_addr_t = u32; +pub type in_port_t = u16; + +pub type socklen_t = u32; +pub type sa_family_t = u16; + +s! { + pub struct in_addr { + pub s_addr: in_addr_t, + } + + pub struct in6_addr { + pub s6_addr: [u8; 16], + __align: [u32; 0], + } + + pub struct sockaddr { + pub sa_family: sa_family_t, + pub sa_data: [::c_char; 14], + } + + pub struct sockaddr_in { + pub sin_family: sa_family_t, + pub sin_port: ::in_port_t, + pub sin_addr: ::in_addr, + pub sin_zero: [u8; 8], + } + + pub struct sockaddr_in6 { + pub sin6_family: sa_family_t, + pub sin6_port: in_port_t, + pub sin6_flowinfo: u32, + pub sin6_addr: ::in6_addr, + pub sin6_scope_id: u32, + } +} + +extern { + pub fn memalign(align: ::size_t, size: ::size_t) -> *mut ::c_void; +} + +#[link(name = "c")] +#[link(name = "m")] +extern {} |