Skip to content

Commit 0f395c6

Browse files
committed
Auto merge of #511 - malbarbo:android_sa, r=gnzlbg
Fix android SA_* constants Trying to crosscompile wait-timeout to armv7-linux-androideabi I found that SA_* had different types in libc, but they have to be the same because they are used in bitwise operations.
2 parents ae24e22 + e2bbeed commit 0f395c6

File tree

3 files changed

+18
-8
lines changed

3 files changed

+18
-8
lines changed

src/unix/notbsd/android/b32/mod.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,15 @@ s! {
161161
}
162162
}
163163

164+
// These constants must be of the same type of sigaction.sa_flags
165+
pub const SA_NOCLDSTOP: ::c_ulong = 0x00000001;
166+
pub const SA_NOCLDWAIT: ::c_ulong = 0x00000002;
167+
pub const SA_NODEFER: ::c_ulong = 0x40000000;
168+
pub const SA_ONSTACK: ::c_ulong = 0x08000000;
169+
pub const SA_RESETHAND: ::c_ulong = 0x80000000;
170+
pub const SA_RESTART: ::c_ulong = 0x10000000;
171+
pub const SA_SIGINFO: ::c_ulong = 0x00000004;
172+
164173
pub const RTLD_GLOBAL: ::c_int = 2;
165174
pub const RTLD_NOW: ::c_int = 0;
166175
pub const RTLD_DEFAULT: *mut ::c_void = -1isize as *mut ::c_void;

src/unix/notbsd/android/b64/mod.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,15 @@ cfg_if! {
231231
}
232232
}
233233

234+
// These constants must be of the same type of sigaction.sa_flags
235+
pub const SA_NOCLDSTOP: ::c_uint = 0x00000001;
236+
pub const SA_NOCLDWAIT: ::c_uint = 0x00000002;
237+
pub const SA_NODEFER: ::c_uint = 0x40000000;
238+
pub const SA_ONSTACK: ::c_uint = 0x08000000;
239+
pub const SA_RESETHAND: ::c_uint = 0x80000000;
240+
pub const SA_RESTART: ::c_uint = 0x10000000;
241+
pub const SA_SIGINFO: ::c_uint = 0x00000004;
242+
234243
pub const RTLD_GLOBAL: ::c_int = 0x00100;
235244
pub const RTLD_NOW: ::c_int = 2;
236245
pub const RTLD_DEFAULT: *mut ::c_void = 0i64 as *mut ::c_void;

src/unix/notbsd/android/mod.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -571,11 +571,6 @@ pub const ECOMM: ::c_int = 70;
571571
pub const EPROTO: ::c_int = 71;
572572
pub const EDOTDOT: ::c_int = 73;
573573

574-
pub const SA_NODEFER: ::c_int = 0x40000000;
575-
pub const SA_RESETHAND: ::c_int = 0x80000000;
576-
pub const SA_RESTART: ::c_int = 0x10000000;
577-
pub const SA_NOCLDSTOP: ::c_int = 0x00000001;
578-
579574
pub const EPOLL_CLOEXEC: ::c_int = 0x80000;
580575
pub const EPOLLONESHOT: ::c_int = 0x40000000;
581576
pub const EPOLLRDHUP: ::c_int = 0x00002000;
@@ -756,9 +751,6 @@ pub const PTHREAD_MUTEX_DEFAULT: ::c_int = PTHREAD_MUTEX_NORMAL;
756751

757752
pub const FIOCLEX: ::c_int = 0x5451;
758753

759-
pub const SA_ONSTACK: ::c_ulong = 0x08000000;
760-
pub const SA_SIGINFO: ::c_ulong = 0x00000004;
761-
pub const SA_NOCLDWAIT: ::c_ulong = 0x00000002;
762754
pub const SIGCHLD: ::c_int = 17;
763755
pub const SIGBUS: ::c_int = 7;
764756
pub const SIGUSR1: ::c_int = 10;

0 commit comments

Comments
 (0)