Skip to content

Commit

Permalink
Rollup merge of rust-lang#22758 - ejjeong:aarch64-linux-android, r=al…
Browse files Browse the repository at this point in the history
…excrichton

 This commit has already been merged in rust-lang#21774,
but i think it has been accidently overriden by rust-lang#22584 and rust-lang#22480.
r? @alexcrichton
  • Loading branch information
Manishearth committed Feb 24, 2015
2 parents 4ff8b8a + 0afebe6 commit 1913e79
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
10 changes: 9 additions & 1 deletion src/libstd/sys/unix/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ impl Process {
K: BytesContainer + Eq + Hash, V: BytesContainer
{
use libc::funcs::posix88::unistd::{fork, dup2, close, chdir, execvp};
use libc::funcs::bsd44::getdtablesize;

mod rustrt {
extern {
Expand All @@ -82,6 +81,15 @@ impl Process {
assert_eq!(ret, 0);
}

#[cfg(all(target_os = "android", target_arch = "aarch64"))]
unsafe fn getdtablesize() -> c_int {
libc::sysconf(libc::consts::os::sysconf::_SC_OPEN_MAX) as c_int
}
#[cfg(not(all(target_os = "android", target_arch = "aarch64")))]
unsafe fn getdtablesize() -> c_int {
libc::funcs::bsd44::getdtablesize()
}

let dirp = cfg.cwd().map(|c| c.as_ptr()).unwrap_or(ptr::null());

// temporary until unboxed closures land
Expand Down
11 changes: 10 additions & 1 deletion src/libstd/sys/unix/process2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ impl Process {
-> io::Result<Process>
{
use libc::funcs::posix88::unistd::{fork, dup2, close, chdir, execvp};
use libc::funcs::bsd44::getdtablesize;

mod rustrt {
extern {
Expand All @@ -154,6 +153,16 @@ impl Process {
assert_eq!(ret, 0);
}

#[cfg(all(target_os = "android", target_arch = "aarch64"))]
unsafe fn getdtablesize() -> c_int {
libc::sysconf(libc::consts::os::sysconf::_SC_OPEN_MAX) as c_int
}

#[cfg(not(all(target_os = "android", target_arch = "aarch64")))]
unsafe fn getdtablesize() -> c_int {
libc::funcs::bsd44::getdtablesize()
}

let dirp = cfg.cwd.as_ref().map(|c| c.as_ptr()).unwrap_or(ptr::null());

with_envp(cfg.env.as_ref(), |envp: *const c_void| {
Expand Down

0 comments on commit 1913e79

Please sign in to comment.