1 // Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
11 //! Experimental extensions to `std` for Unix platforms.
13 //! For now, this module is limited to extracting file descriptors,
14 //! but its functionality will grow over time.
19 //! use std::fs::File;
20 //! use std::os::unix::prelude::*;
23 //! let f = File::create("foo.txt").unwrap();
24 //! let fd = f.as_raw_fd();
26 //! // use fd with native unix bindings
30 #![stable(feature = "rust1", since = "1.0.0")]
40 /// A prelude for conveniently writing platform-specific code.
42 /// Includes all extension traits, and some important type definitions.
43 #[stable(feature = "rust1", since = "1.0.0")]
45 #[doc(no_inline)] #[stable(feature = "rust1", since = "1.0.0")]
46 pub use super::io::{RawFd, AsRawFd, FromRawFd, IntoRawFd};
47 #[doc(no_inline)] #[stable(feature = "rust1", since = "1.0.0")]
48 pub use super::ffi::{OsStrExt, OsStringExt};
49 #[doc(no_inline)] #[stable(feature = "rust1", since = "1.0.0")]
50 pub use super::fs::{PermissionsExt, OpenOptionsExt, MetadataExt, FileTypeExt};
51 #[doc(no_inline)] #[stable(feature = "rust1", since = "1.0.0")]
52 pub use super::fs::DirEntryExt;
53 #[doc(no_inline)] #[stable(feature = "rust1", since = "1.0.0")]
54 pub use super::thread::JoinHandleExt;
55 #[doc(no_inline)] #[stable(feature = "rust1", since = "1.0.0")]
56 pub use super::process::{CommandExt, ExitStatusExt};