summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco A L Barbosa <malbarbo@gmail.com>2017-02-24 17:03:51 -0300
committerMarco A L Barbosa <malbarbo@gmail.com>2017-02-24 17:03:51 -0300
commitf2f11296723f3c492b0271898bd8daa8c391001a (patch)
tree69124c5a5c2844e1b4cc15684707a67ee28635ae
parent92ce51823cc442e5054805c0b535b9cf0e551b0e (diff)
downloadrust-libc-f2f11296723f3c492b0271898bd8daa8c391001a.tar.gz
Fix aarch64-linux-android failing tests
-rw-r--r--src/unix/notbsd/android/b32.rs1
-rw-r--r--src/unix/notbsd/android/b64.rs1
-rw-r--r--src/unix/notbsd/android/mod.rs21
3 files changed, 19 insertions, 4 deletions
diff --git a/src/unix/notbsd/android/b32.rs b/src/unix/notbsd/android/b32.rs
index f9c12d3369..beccb6c308 100644
--- a/src/unix/notbsd/android/b32.rs
+++ b/src/unix/notbsd/android/b32.rs
@@ -3,6 +3,7 @@ pub type c_ulong = u32;
pub type mode_t = u16;
pub type off64_t = ::c_longlong;
pub type sigset_t = ::c_ulong;
+pub type socklen_t = i32;
pub type time64_t = i64;
s! {
diff --git a/src/unix/notbsd/android/b64.rs b/src/unix/notbsd/android/b64.rs
index ff1f140966..230b43dbc4 100644
--- a/src/unix/notbsd/android/b64.rs
+++ b/src/unix/notbsd/android/b64.rs
@@ -4,6 +4,7 @@ pub type c_long = i64;
pub type c_ulong = u64;
pub type mode_t = u32;
pub type off64_t = i64;
+pub type socklen_t = u32;
s! {
pub struct sigset_t {
diff --git a/src/unix/notbsd/android/mod.rs b/src/unix/notbsd/android/mod.rs
index 4b8344cb38..a121a6b017 100644
--- a/src/unix/notbsd/android/mod.rs
+++ b/src/unix/notbsd/android/mod.rs
@@ -20,7 +20,6 @@ pub type blkcnt_t = ::c_ulong;
pub type blksize_t = ::c_ulong;
pub type nlink_t = u32;
pub type useconds_t = u32;
-pub type socklen_t = i32;
pub type pthread_t = ::c_long;
pub type pthread_mutexattr_t = ::c_long;
pub type pthread_condattr_t = ::c_long;
@@ -61,6 +60,7 @@ s! {
pub si_errno: ::c_int,
pub si_code: ::c_int,
pub _pad: [::c_int; 29],
+ _align: [usize; 0],
}
pub struct __fsid_t {
@@ -109,6 +109,8 @@ s! {
pub struct sem_t {
count: ::c_uint,
+ #[cfg(target_pointer_width = "64")]
+ __reserved: [::c_int; 3],
}
pub struct lastlog {
@@ -150,6 +152,8 @@ s! {
pub f_fsid: ::c_ulong,
pub f_flag: ::c_ulong,
pub f_namemax: ::c_ulong,
+ #[cfg(target_pointer_width = "64")]
+ __f_reserved: [u32; 6],
}
}
@@ -577,10 +581,19 @@ pub const TIOCMSET: ::c_int = 0x5418;
pub const FIONREAD: ::c_int = 0x541B;
pub const TIOCCONS: ::c_int = 0x541D;
-pub const RTLD_GLOBAL: ::c_int = 0x2;
pub const RTLD_NOLOAD: ::c_int = 0x4;
-pub const RTLD_NOW: ::c_int = 0;
-pub const RTLD_DEFAULT: *mut ::c_void = -1isize as *mut ::c_void;
+
+cfg_if! {
+ if #[cfg(target_arch = "aarch64")] {
+ pub const RTLD_GLOBAL: ::c_int = 0x00100;
+ pub const RTLD_NOW: ::c_int = 2;
+ pub const RTLD_DEFAULT: *mut ::c_void = 0i64 as *mut ::c_void;
+ } else {
+ pub const RTLD_GLOBAL: ::c_int = 2;
+ pub const RTLD_NOW: ::c_int = 0;
+ pub const RTLD_DEFAULT: *mut ::c_void = -1isize as *mut ::c_void;
+ }
+}
pub const SEM_FAILED: *mut sem_t = 0 as *mut sem_t;