Skip to content

Definitions for i686-unknown-linux-musl, arm and asmjs musl #122

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 30, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
target
Cargo.lock
*~
4 changes: 3 additions & 1 deletion libc-test/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,9 @@ fn main() {
// just insert some padding.
(struct_ == "siginfo_t" && field == "_pad") ||
// musl names this __dummy1 but it's still there
(musl && struct_ == "glob_t" && field == "gl_flags")
(musl && struct_ == "glob_t" && field == "gl_flags") ||
// musl seems to define this as an *anonymous* bitfield
(musl && struct_ == "statvfs" && field == "__f_unused")
});

cfg.fn_cname(move |name, cname| {
Expand Down
3 changes: 3 additions & 0 deletions src/unix/notbsd/android/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ pub type time64_t = i64;
pub type fsfilcnt_t = ::c_ulong;
pub type fsblkcnt_t = ::c_ulong;
pub type nfds_t = ::c_uint;
pub type rlim_t = c_ulong;

s! {
pub struct stat {
Expand Down Expand Up @@ -468,6 +469,8 @@ pub const EFD_NONBLOCK: ::c_int = 0x800;
pub const F_GETLK: ::c_int = 5;
pub const F_GETOWN: ::c_int = 9;
pub const F_SETOWN: ::c_int = 8;
pub const F_SETLK: ::c_int = 6;
pub const F_SETLKW: ::c_int = 7;

pub const TCGETS: ::c_int = 0x5401;
pub const TCSETS: ::c_int = 0x5402;
Expand Down
5 changes: 5 additions & 0 deletions src/unix/notbsd/linux/mips.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ pub type ino_t = u32;
pub type blkcnt_t = i32;
pub type blksize_t = i32;
pub type nlink_t = u32;
pub type fsblkcnt_t = ::c_ulong;
pub type fsfilcnt_t = ::c_ulong;
pub type rlim_t = c_ulong;

s! {
pub struct stat {
Expand Down Expand Up @@ -428,6 +431,8 @@ pub const EFD_NONBLOCK: ::c_int = 0x80;
pub const F_GETLK: ::c_int = 14;
pub const F_GETOWN: ::c_int = 23;
pub const F_SETOWN: ::c_int = 24;
pub const F_SETLK: ::c_int = 6;
pub const F_SETLKW: ::c_int = 7;

pub const SFD_NONBLOCK: ::c_int = 0x80;

Expand Down
2 changes: 0 additions & 2 deletions src/unix/notbsd/linux/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ pub type ino64_t = u64;
pub type off64_t = i64;
pub type blkcnt64_t = i64;
pub type rlim64_t = u64;
pub type fsblkcnt_t = ::c_ulong;
pub type fsfilcnt_t = ::c_ulong;
pub type key_t = ::c_int;
pub type shmatt_t = ::c_ulong;
pub type mqd_t = ::c_int;
Expand Down
2 changes: 2 additions & 0 deletions src/unix/notbsd/linux/musl/b32/arm.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pub type c_char = u8;
pub type wchar_t = u32;
2 changes: 2 additions & 0 deletions src/unix/notbsd/linux/musl/b32/asmjs.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pub type c_char = u8;
pub type wchar_t = u32;
97 changes: 97 additions & 0 deletions src/unix/notbsd/linux/musl/b32/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
pub type c_long = i32;
pub type c_ulong = u32;

pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 32;
pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 24;

pub const F_GETLK: ::c_int = 12;
pub const F_SETLK: ::c_int = 13;
pub const F_SETLKW: ::c_int = 14;


s! {
pub struct stat {
pub st_dev: ::dev_t,
__st_dev_padding: ::c_int,
__st_ino_truncated: ::c_long,
pub st_mode: ::mode_t,
pub st_nlink: ::nlink_t,
pub st_uid: ::uid_t,
pub st_gid: ::gid_t,
pub st_rdev: ::dev_t,
__st_rdev_padding: ::c_int,
pub st_size: ::off_t,
pub st_blksize: ::blksize_t,
pub st_blocks: ::blkcnt_t,
pub st_atim: ::timespec,
pub st_mtim: ::timespec,
pub st_ctim: ::timespec,
pub st_ino: ::ino_t,
}

pub struct stat64 {
pub st_dev: ::dev_t,
__st_dev_padding: ::c_int,
__st_ino_truncated: ::c_long,
pub st_mode: ::mode_t,
pub st_nlink: ::nlink_t,
pub st_uid: ::uid_t,
pub st_gid: ::gid_t,
pub st_rdev: ::dev_t,
__st_rdev_padding: ::c_int,
pub st_size: ::off_t,
pub st_blksize: ::blksize_t,
pub st_blocks: ::blkcnt_t,
pub st_atim: ::timespec,
pub st_mtim: ::timespec,
pub st_ctim: ::timespec,
pub st_ino: ::ino_t,
}

pub struct pthread_attr_t {
__size: [u32; 9]
}

pub struct sigset_t {
__val: [::c_ulong; 32],
}

pub struct shmid_ds {
pub shm_perm: ::ipc_perm,
pub shm_segsz: ::size_t,
pub shm_atime: ::time_t,
__unused1: ::c_int,
pub shm_dtime: ::time_t,
__unused2: ::c_int,
pub shm_ctime: ::time_t,
__unused3: ::c_int,
pub shm_cpid: ::pid_t,
pub shm_lpid: ::pid_t,
pub shm_nattch: ::c_ulong,
__pad1: ::c_ulong,
__pad2: ::c_ulong,
}

pub struct msghdr {
pub msg_name: *mut ::c_void,
pub msg_namelen: ::socklen_t,
pub msg_iov: *mut ::iovec,
pub msg_iovlen: ::c_int,
pub msg_control: *mut ::c_void,
pub msg_controllen: ::socklen_t,
pub msg_flags: ::c_int,
}
}

cfg_if! {
if #[cfg(any(target_arch = "x86"))] {
mod x86;
pub use self::x86::*;
} else if #[cfg(any(target_arch = "arm"))] {
mod arm;
pub use self::arm::*;
} else if #[cfg(any(target_arch = "asmjs"))] {
mod asmjs;
pub use self::asmjs::*;
} else { }
}
2 changes: 2 additions & 0 deletions src/unix/notbsd/linux/musl/b32/x86.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pub type c_char = i8;
pub type wchar_t = i32;
88 changes: 88 additions & 0 deletions src/unix/notbsd/linux/musl/b64/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
pub type c_char = i8;
pub type wchar_t = i32;
pub type c_long = i64;
pub type c_ulong = u64;

pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56;
pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40;

pub const F_GETLK: ::c_int = 5;
pub const F_SETLK: ::c_int = 6;
pub const F_SETLKW: ::c_int = 7;

s! {
pub struct stat {
pub st_dev: ::dev_t,
pub st_ino: ::ino_t,
pub st_nlink: ::nlink_t,
pub st_mode: ::mode_t,
pub st_uid: ::uid_t,
pub st_gid: ::gid_t,
__pad0: ::c_int,
pub st_rdev: ::dev_t,
pub st_size: ::off_t,
pub st_blksize: ::blksize_t,
pub st_blocks: ::blkcnt_t,
pub st_atime: ::time_t,
pub st_atime_nsec: ::c_long,
pub st_mtime: ::time_t,
pub st_mtime_nsec: ::c_long,
pub st_ctime: ::time_t,
pub st_ctime_nsec: ::c_long,
__unused: [::c_long; 3],
}

pub struct stat64 {
pub st_dev: ::dev_t,
pub st_ino: ::ino64_t,
pub st_nlink: ::nlink_t,
pub st_mode: ::mode_t,
pub st_uid: ::uid_t,
pub st_gid: ::gid_t,
__pad0: ::c_int,
pub st_rdev: ::dev_t,
pub st_size: ::off_t,
pub st_blksize: ::blksize_t,
pub st_blocks: ::blkcnt64_t,
pub st_atime: ::time_t,
pub st_atime_nsec: ::c_long,
pub st_mtime: ::time_t,
pub st_mtime_nsec: ::c_long,
pub st_ctime: ::time_t,
pub st_ctime_nsec: ::c_long,
__reserved: [::c_long; 3],
}

pub struct pthread_attr_t {
__size: [u64; 7]
}

pub struct sigset_t {
__val: [::c_ulong; 16],
}

pub struct shmid_ds {
pub shm_perm: ::ipc_perm,
pub shm_segsz: ::size_t,
pub shm_atime: ::time_t,
pub shm_dtime: ::time_t,
pub shm_ctime: ::time_t,
pub shm_cpid: ::pid_t,
pub shm_lpid: ::pid_t,
pub shm_nattch: ::c_ulong,
__pad1: ::c_ulong,
__pad2: ::c_ulong,
}

pub struct msghdr {
pub msg_name: *mut ::c_void,
pub msg_namelen: ::socklen_t,
pub msg_iov: *mut ::iovec,
pub msg_iovlen: ::c_int,
__pad1: ::c_int,
pub msg_control: *mut ::c_void,
pub msg_controllen: ::socklen_t,
__pad2: ::socklen_t,
pub msg_flags: ::c_int,
}
}
Loading