about summary refs log tree commit diff
path: root/library/std/src/sys/unix/ext/fs.rs
AgeCommit message (Collapse)AuthorLines
2021-05-03Move `std::sys::unix::ext` to `std::os::unix`Christiaan Dirkx-912/+0
2021-04-30Add std::os::unix::fs::chroot to change the root directory of the current ↵Josh Triplett-0/+26
process This is a straightforward wrapper that uses the existing helpers for C string handling and errno handling. Having this available is convenient for UNIX utility programs written in Rust, and avoids having to call the unsafe `libc::chroot` directly and handle errors manually, in a program that may otherwise be entirely safe code.
2021-03-24Rollup merge of #83353 - m-ou-se:io-error-avoid-alloc, r=nagisaDylan DPC-3/+3
Add internal io::Error::new_const to avoid allocations. This makes it possible to have a io::Error containing a message with zero allocations, and uses that everywhere to avoid the *three* allocations involved in `io::Error::new(kind, "message")`. The function signature isn't perfect, because it needs a reference to the `&str`. So for now, this is just a `pub(crate)` function. Later, we'll be able to use `fn new_const<MSG: &'static str>(kind: ErrorKind)` to make that a bit better. (Then we'll also be able to use some ZST trickery if that would result in more efficient code.) See https://github.com/rust-lang/rust/issues/83352
2021-03-21Use io::Error::new_const everywhere to avoid allocations.Mara Bos-3/+3
2021-03-02Move `std::sys::unix::platform` to `std::sys::unix::ext`Christiaan Dirkx-1/+1
2020-11-14Disambiguate symlink argument namesDavid Tolnay-3/+3
2020-10-16Take sys/vxworks/{fd,fs,io} from sys/unix instead.Mara Bos-0/+7
2020-09-22Revert "Function to convert OpenOptions to c_int"Joshua Nelson-29/+0
2020-09-22Auto merge of #76110 - FedericoPonzi:convert-openoptions-cint, r=JoshTriplettbors-0/+29
Function to convert OpenOptions to c_int Fixes: #74943 The creation_mode and access_mode function were already available in the OpenOptions struct, but currently private. I've added a new free functions to unix/fs.rs which takes the OpenOptions, and returns the c_int to be used as parameter for the `open` call.
2020-09-22enable unstable open_options_ext_as_flags feature in doc commentsFederico Ponzi-0/+1
2020-09-16Sets as_flags as unstableFederico Ponzi-1/+1
2020-09-12Remove Windows details from Unix and VmWorks symlink() docstringsNicholas Bishop-9/+0
This note is not relevant to other operating systems.
2020-09-04Fix nlink example typoChris Gillespie-1/+1
2020-09-02Convert many files to intra-doc linksJoshua Nelson-2/+5
- Use intra-doc links for `std::io` in `std::fs` - Use intra-doc links for File::read in unix/ext/fs.rs - Remove explicit intra-doc links for `true` in `net/addr.rs` - Use intra-doc links in alloc/src/sync.rs - Use intra-doc links in src/ascii.rs - Switch to intra-doc links in alloc/rc.rs - Use intra-doc links in core/pin.rs - Use intra-doc links in std/prelude - Use shorter links in `std/fs.rs` `io` is already in scope.
2020-09-02Update docs of OpenOptions::as_flagsFederico Ponzi-3/+2
2020-08-31Update OpenOptions::as_flags docs, and minor stylingFederico Ponzi-9/+8
2020-08-31Add as_flag function to the OpenOptionsExt structFederico Ponzi-0/+30
2020-08-19Switch to intra-doc links in /src/sys/unix/ext/*.rsPrabakaran Kumaresshan-32/+13
2020-07-27mv std libs to library/mark-0/+904