Skip to content

Commit c821847

Browse files
committed
Merge pull request rust-lang#46 from alexcrichton/ni-maxhost
Add NI_MAXHOST
2 parents d7d4fed + 9f52b89 commit c821847

File tree

7 files changed

+18
-13
lines changed

7 files changed

+18
-13
lines changed

ci/run-travis.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ case "$TARGET" in
5454
cp -r /checkout/* .
5555
mkdir .cargo
5656
cp ci/cargo-config .cargo/config
57-
sh ci/run.sh $TARGET
57+
exec sh ci/run.sh $TARGET
5858
"
5959
exec docker run \
6060
--entrypoint bash \

ci/run.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ case "$TARGET" in
2222
emulator @arm-18 -no-window &
2323
adb wait-for-device
2424
adb push libc-test/target/$TARGET/debug/libc-test /data/libc-test
25-
adb shell /data/libc-test
25+
adb shell /data/libc-test 2>&1 | tee out
26+
grep "^PASSED .* tests" out
2627
;;
2728

2829
arm-unknown-linux-gnueabihf)

src/unix/bsd/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@ pub const FD_SETSIZE: usize = 1024;
107107
pub const ST_RDONLY: ::c_ulong = 1;
108108
pub const ST_NOSUID: ::c_ulong = 2;
109109

110+
pub const NI_MAXHOST: ::socklen_t = 1025;
111+
110112
f! {
111113
pub fn FD_CLR(fd: ::c_int, set: *mut fd_set) -> () {
112114
let fd = fd as usize;

src/unix/notbsd/android/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,7 @@ pub const O_NOCTTY: ::c_int = 256;
317317
pub const O_NONBLOCK: ::c_int = 2048;
318318
pub const O_SYNC: ::c_int = 0x1000;
319319

320+
pub const NI_MAXHOST: ::size_t = 1025;
320321

321322
f! {
322323
pub fn sigemptyset(set: *mut sigset_t) -> ::c_int {

src/unix/notbsd/linux/mod.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -320,17 +320,6 @@ extern {
320320
count: ::size_t) -> ::ssize_t;
321321
}
322322

323-
cfg_if! {
324-
if #[cfg(any(target_env = "musl"))] {
325-
pub const PTHREAD_STACK_MIN: ::size_t = 2048;
326-
} else if #[cfg(any(target_arch = "arm", target_arch = "x86",
327-
target_arch = "x86_64"))] {
328-
pub const PTHREAD_STACK_MIN: ::size_t = 16384;
329-
} else {
330-
pub const PTHREAD_STACK_MIN: ::size_t = 131072;
331-
}
332-
}
333-
334323
cfg_if! {
335324
if #[cfg(target_env = "musl")] {
336325
mod musl;

src/unix/notbsd/linux/musl.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ pub const FOPEN_MAX: ::c_uint = 1000;
44
pub const POSIX_MADV_DONTNEED: ::c_int = 0;
55
pub const O_ACCMODE: ::c_int = 0o10000003;
66
pub const RUSAGE_CHILDREN: ::c_int = 1;
7+
pub const NI_MAXHOST: ::socklen_t = 255;
8+
pub const PTHREAD_STACK_MIN: ::size_t = 2048;
79

810
extern {
911
pub fn ioctl(fd: ::c_int, request: ::c_int, ...) -> ::c_int;

src/unix/notbsd/linux/notmusl.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,16 @@ pub const RUSAGE_THREAD: ::c_int = 1;
2222
pub const O_ACCMODE: ::c_int = 3;
2323
pub const RUSAGE_CHILDREN: ::c_int = -1;
2424
pub const ST_RELATIME: ::c_ulong = 4096;
25+
pub const NI_MAXHOST: ::socklen_t = 1025;
26+
27+
cfg_if! {
28+
if #[cfg(any(target_arch = "arm", target_arch = "x86",
29+
target_arch = "x86_64"))] {
30+
pub const PTHREAD_STACK_MIN: ::size_t = 16384;
31+
} else {
32+
pub const PTHREAD_STACK_MIN: ::size_t = 131072;
33+
}
34+
}
2535

2636
extern {
2737
pub fn sysctl(name: *mut ::c_int,

0 commit comments

Comments
 (0)