std: Migrate to the new libc

* Delete `sys::unix::{c, sync}` as these are now all folded into libc itself
* Update all references to use `libc` as a result.
* Update all references to the new flat namespace.
* Moves all windows bindings into sys::c
This commit is contained in:
Alex Crichton
2015-11-02 16:23:22 -08:00
parent c8a29c2092
commit 3d28b8b98e
62 changed files with 1889 additions and 2431 deletions

View File

@@ -16,7 +16,6 @@ use cmp;
use fmt;
use io::lazy::Lazy;
use io::{self, BufReader, LineWriter};
use libc;
use sync::{Arc, Mutex, MutexGuard};
use sys::stdio;
use sys_common::io::{read_to_end_uninitialized};
@@ -121,9 +120,9 @@ impl<R: io::Read> io::Read for Maybe<R> {
fn handle_ebadf<T>(r: io::Result<T>, default: T) -> io::Result<T> {
#[cfg(windows)]
const ERR: libc::c_int = libc::ERROR_INVALID_HANDLE;
const ERR: i32 = ::sys::c::ERROR_INVALID_HANDLE as i32;
#[cfg(not(windows))]
const ERR: libc::c_int = libc::EBADF;
const ERR: i32 = ::libc::EBADF as i32;
match r {
Err(ref e) if e.raw_os_error() == Some(ERR) => Ok(default),