Skip to content
Snippets Groups Projects
  1. Jan 06, 2017
  2. Jan 04, 2017
  3. Jan 03, 2017
  4. Jan 02, 2017
  5. Jan 01, 2017
    • bors's avatar
      Auto merge of #483 - japaric:sparc64, r=alexcrichton · 3e895791
      bors authored
      sparc64-linux support
      
      This needs to be "cleaned" up to use modules instead of a bunch of `cfg`s ...
      
      Sadly, sparc64 constants are very different from other architectures so cleaning this will result in a bunch of duplication, I think.
      
      While working on this, I was wondering why the constants are not written like this:
      
      ``` rust
      // linux/mod.rs
      const COMMON: ::c_int = 3;
      
      cfg_if! {
          if #[cfg(target_arch = "sparc64")] {
              const FOO: ::c_int = 1;
          } else if #[cfg(any(target_arch = "mips64", target_arch = "x86_64"))] {
              const FOO: ::c_int = 2;
          } else {
              // unsupported/unknown architecture
          }
      }
      ```
      
      I think this might result in less duplicated code. @alexcrichton Has something like that ^ been attempted before?
      3e895791
    • Jorge Aparicio's avatar
      tidy and last minute fixes · 67615b49
      Jorge Aparicio authored
      67615b49
  6. Dec 31, 2016
  7. Dec 29, 2016
  8. Dec 28, 2016
  9. Dec 27, 2016
  10. Dec 21, 2016
  11. Dec 20, 2016
  12. Dec 18, 2016
  13. Dec 15, 2016
  14. Dec 13, 2016
    • bors's avatar
      Auto merge of #472 - BrandonSchaefer:wifsignaled-fix, r=alexcrichton · fb8587d3
      bors authored
      When checking the status from waitpid on a kill -STOP <child_pid> WIFSIGNALED returns true
      
      Currently in WIFSIGNALED rust is doing:
      (status & 0x7f) + 1
      where status is i32
      
      As defined in /usr/include/x86_64-linux-gnu/bits/waitstatus.h
      #define __WIFSIGNALED(status) \
        (((signed char) (((status) & 0x7f) + 1) >> 1) > 0)
      
      Here is an example of the issue:
      http://paste2.org/fXc8BxJ0
      
      Run it, and it'll print the child pid then:
      kill -STOP <child_pid>
      
      Expect:
        Stopped by signal print statement
      Results:
        Killed by signal print statement
      
      Using the i32, it wont overflow leaving you with 128 returning true, using the waitstatus define you'll end up with -64 (since it shifts 1 right) which would return false. Though the C version shifts right once not really sure *why* but theres most likely a reason somewhere.
      
      For the fix, just cast to i8 (signed char pretty much) as the C version is doing.
      
      RUNNING ALL TESTS
      PASSED 7356 tests
      fb8587d3
    • Brandon Schaefer's avatar
Loading