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 //! Provides access to platform-level information on Unix platforms, and
14 //! exposes Unix-specific functions that would otherwise be inappropriate as
15 //! part of the core `std` library.
17 //! It exposes more ways to deal with platform-specific strings (`OsStr`,
18 //! `OsString`), allows to set permissions more granularly, extract low-level
19 //! file descriptors from files and sockets, and has platform-specific helpers
20 //! for spawning processes.
25 //! use std::fs::File;
26 //! use std::os::unix::prelude::*;
29 //! let f = File::create("foo.txt").unwrap();
30 //! let fd = f.as_raw_fd();
32 //! // use fd with native unix bindings
36 #![stable(feature = "rust1", since = "1.0.0")]
47 /// A prelude for conveniently writing platform-specific code.
49 /// Includes all extension traits, and some important type definitions.
50 #[stable(feature = "rust1", since = "1.0.0")]
52 #[doc(no_inline)] #[stable(feature = "rust1", since = "1.0.0")]
53 pub use super::io
::{RawFd, AsRawFd, FromRawFd, IntoRawFd}
;
54 #[doc(no_inline)] #[stable(feature = "rust1", since = "1.0.0")]
55 pub use super::ffi
::{OsStrExt, OsStringExt}
;
56 #[doc(no_inline)] #[stable(feature = "rust1", since = "1.0.0")]
57 pub use super::fs
::{PermissionsExt, OpenOptionsExt, MetadataExt, FileTypeExt}
;
58 #[doc(no_inline)] #[stable(feature = "rust1", since = "1.0.0")]
59 pub use super::fs
::DirEntryExt
;
60 #[doc(no_inline)] #[stable(feature = "file_offset", since = "1.15.0")]
61 pub use super::fs
::FileExt
;
62 #[doc(no_inline)] #[stable(feature = "rust1", since = "1.0.0")]
63 pub use super::thread
::JoinHandleExt
;
64 #[doc(no_inline)] #[stable(feature = "rust1", since = "1.0.0")]
65 pub use super::process
::{CommandExt, ExitStatusExt}
;