Permalink
Browse files

wip

  • Loading branch information...
1 parent e22185a commit c42f32e5a4b507cccb9ae0fba757440f4e2e32aa @brson committed Dec 22, 2015
Showing with 18 additions and 4 deletions.
  1. +12 −1 src/libstd/os/linux/raw.rs
  2. +4 −2 src/libstd/sys/unix/fs.rs
  3. +2 −1 src/libtest/lib.rs
@@ -35,7 +35,18 @@ mod arch {
#[stable(feature = "raw_ext", since = "1.1.0")] pub type blkcnt_t = i32;
#[stable(feature = "raw_ext", since = "1.1.0")] pub type blksize_t = i32;
- #[stable(feature = "raw_ext", since = "1.1.0")] pub type ino_t = u32;
+
+ // FIXME: This change for asmjs is pretty dubious. ATM asjms is
+ // using the musl definitions of libc, but those are *64-bit*
+ // definitions, when asmjs is 32-bit. It's likely some of them are
+ // wrong.
+ #[stable(feature = "raw_ext", since = "1.1.0")]
+ #[cfg(not(target_arch = "asmjs"))]
+ pub type ino_t = u32;
+ #[stable(feature = "raw_ext", since = "1.1.0")]
+ #[cfg(target_arch = "asmjs")]
+ pub type ino_t = u64;
+
#[stable(feature = "raw_ext", since = "1.1.0")] pub type nlink_t = u32;
#[stable(feature = "raw_ext", since = "1.1.0")] pub type off_t = i32;
#[stable(feature = "raw_ext", since = "1.1.0")] pub type time_t = i32;
@@ -183,7 +183,8 @@ impl DirEntry {
#[cfg(any(target_os = "macos",
target_os = "ios",
- target_os = "linux"))]
+ target_os = "linux",
+ target_os = "emscripten"))]
pub fn ino(&self) -> raw::ino_t {
self.entry.d_ino
}
@@ -222,7 +223,8 @@ impl DirEntry {
}
}
#[cfg(any(target_os = "android",
- target_os = "linux"))]
+ target_os = "linux",
+ target_os = "emscripten"))]
fn name_bytes(&self) -> &[u8] {
unsafe {
CStr::from_ptr(self.entry.d_name.as_ptr()).to_bytes()
View
@@ -909,7 +909,8 @@ fn get_concurrency() -> usize {
#[cfg(any(target_os = "linux",
target_os = "macos",
target_os = "ios",
- target_os = "android"))]
+ target_os = "android",
+ target_os = "emscripten"))]
fn num_cpus() -> usize {
unsafe {
libc::sysconf(libc::_SC_NPROCESSORS_ONLN) as usize

0 comments on commit c42f32e

Please sign in to comment.