Skip to content

Commit

Permalink
auto merge of #13455 : alexcrichton/rust/jettison-timerfd, r=brson
Browse files Browse the repository at this point in the history
Rust advertises itself as being compatible with linux 2.6.18, but the timerfd
set of syscalls weren't added until linux 2.6.25. There is no real need for a
specialized timer implementation beyond being a "little more accurate", but the
select() implementation will suffice for now.

If it is later deemed that an accurate timerfd implementation is needed, it can
be added then through some method which will allow the standard distribution to
continue to be compatible with 2.6.18

Closes #13447
  • Loading branch information
bors committed Apr 13, 2014
2 parents 82cd9ac + 28ba3a7 commit 9d75f23
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 333 deletions.
5 changes: 1 addition & 4 deletions src/libnative/io/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,8 @@ pub mod file;
#[cfg(target_os = "macos")]
#[cfg(target_os = "freebsd")]
#[cfg(target_os = "android")]
#[path = "timer_other.rs"]
pub mod timer;

#[cfg(target_os = "linux")]
#[path = "timer_timerfd.rs"]
#[path = "timer_unix.rs"]
pub mod timer;

#[cfg(target_os = "win32")]
Expand Down
327 changes: 0 additions & 327 deletions src/libnative/io/timer_timerfd.rs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -312,17 +312,20 @@ mod imp {

#[cfg(target_os = "android")]
#[cfg(target_os = "freebsd")]
#[cfg(target_os = "linux")]
mod imp {
use libc;
use std::uint;

pub static FD_SETSIZE: uint = 1024;

pub struct fd_set {
fds_bits: [u64, ..(FD_SETSIZE / 64)]
fds_bits: [uint, ..(FD_SETSIZE / uint::BITS)]
}

pub fn fd_set(set: &mut fd_set, fd: i32) {
set.fds_bits[(fd / 64) as uint] |= (1 << (fd % 64)) as u64;
let fd = fd as uint;
set.fds_bits[fd / uint::BITS] |= 1 << (fd % uint::BITS);
}

extern {
Expand Down

0 comments on commit 9d75f23

Please sign in to comment.