about summary refs log tree commit diff
path: root/src/libstd/sys/unix/ext
AgeCommit message (Collapse)AuthorLines
2020-07-27mv std libs to library/mark-3464/+0
2020-07-09libstd/libcore: fix various typosAndy Russell-2/+2
2020-07-02Fix linksGuillaume Gomez-1/+1
2020-06-23Remove unused crate imports in 2018 edition cratesyuqio-3/+0
2020-06-18Document format correctionqy3u-2/+4
2020-06-10Migrate to numeric associated constsLzu Tao-1/+1
2020-05-12Stabilize process_set_argv0 feature for UnixJeremy Fitzhardinge-1/+1
This stabilizes process_set_argv0 targeting 1.45.0. It has been useful in practice and seems useful as-is. The equivalent feature could be implemented for Windows, but as far as I know nobody has. That can be done separately. Tracking issue: #66510
2020-05-07Allow a few warnings.Steve Klabnik-0/+6
On Windows, these types were causing warnings to be emitted during the build. These types are allowed to not have idiomatic names, so the warning should be supressed.
2020-04-26Fix stragglersSteven Fackler-5/+5
2020-04-26Update nameSteven Fackler-3/+3
2020-04-26Add Read/Write::can_read/write_vectoredSteven Fackler-0/+20
When working with an arbitrary reader or writer, code that uses vectored operations may end up being slower than code that copies into a single buffer when the underlying reader or writer doesn't actually support vectored operations. These new methods allow you to ask the reader or witer up front if vectored operations are efficiently supported. Currently, you have to use some heuristics to guess by e.g. checking if the read or write only accessed the first buffer. Hyper is one concrete example of a library that has to do this dynamically: https://github.com/hyperium/hyper/blob/0eaf304644a396895a4ce1f0146e596640bb666a/src/proto/h1/io.rs#L582-L594
2020-01-12Document behavior of set_nonblocking on UnixListenerTill Arnold-0/+8
2019-12-22Format the worldMark Rousskov-88/+117
2019-12-02Rollup merge of #66346 - linkmauve:try-in-docstring, r=Dylan-DPCMazdak Farrokhzad-156/+284
Replace .unwrap() with ? in std::os::unix::net As people like to copy examples, this gives them good habits.
2019-11-29Format libstd/sys with rustfmtDavid Tolnay-55/+123
This commit applies rustfmt with rust-lang/rust's default settings to files in src/libstd/sys *that are not involved in any currently open PR* to minimize merge conflicts. THe list of files involved in open PRs was determined by querying GitHub's GraphQL API with this script: https://gist.github.com/dtolnay/aa9c34993dc051a4f344d1b10e4487e8 With the list of files from the script in outstanding_files, the relevant commands were: $ find src/libstd/sys -name '*.rs' \ | xargs rustfmt --edition=2018 --unstable-features --skip-children $ rg libstd/sys outstanding_files | xargs git checkout -- Repeating this process several months apart should get us coverage of most of the rest of the files. To confirm no funny business: $ git checkout $THIS_COMMIT^ $ git show --pretty= --name-only $THIS_COMMIT \ | xargs rustfmt --edition=2018 --unstable-features --skip-children $ git diff $THIS_COMMIT # there should be no difference
2019-11-24Add missing main() and return valueEmmanuel Gil Peyrot-2/+5
2019-11-24Add missing semicolons and question marksEmmanuel Gil Peyrot-5/+5
2019-11-24Also fix the signature of main in std::sys::unix::extEmmanuel Gil Peyrot-1/+3
2019-11-24Return Ok(()) in docstrings in std::os::unix::netEmmanuel Gil Peyrot-10/+45
2019-11-24Replace .unwrap() with ? in std::os::unix::netEmmanuel Gil Peyrot-149/+237
2019-11-19Add unix::process::CommandExt::arg0Jeremy Fitzhardinge-0/+16
This allows argv[0] to be overridden on the executable's command-line. This also makes the program executed independent of argv[0]. Does Fuchsia have the same semantics? Addresses: #66510
2019-10-28[doc] fix the reference to using `OpenOptions::open`Josh Stone-1/+1
2019-10-28[doc] add a possessive apostrophe in `OpenOptionsExt::mode`Josh Stone-1/+1
2019-07-01Remove needless lifetimesJeremy Stucki-2/+2
2019-06-26Avoid mem::uninitialized() in std::sys::unixJosh Stone-6/+5
For `libc` types that will be initialized in FFI calls, we can just use `MaybeUninit` and then pass around raw pointers. For `sun_path_offset()`, which really wants `offset_of`, all callers have a real `sockaddr_un` available, so we can use that reference.
2019-05-26Print file mode of PermissionExt in octal in Examplesoberien-1/+1
2019-05-13Remove bitrig support from rustMarcel Hellwig-2/+2
2019-04-27Stabilized vectored IOSteven Fackler-7/+7
This renames `std::io::IoVec` to `std::io::IoSlice` and `std::io::IoVecMut` to `std::io::IoSliceMut`, and stabilizes `std::io::IoSlice`, `std::io::IoSliceMut`, `std::io::Read::read_vectored`, and `std::io::Write::write_vectored`. Closes #58452
2019-03-31libstd: deny(elided_lifetimes_in_paths)Mazdak Farrokhzad-5/+5
2019-03-29implement `AsRawFd` for stdio locksAndy Russell-0/+15
2019-03-21Unify OsString/OsStr for byte-based implementationsJethro Beekman-104/+33
2019-02-28libstd => 2018Taiki Endo-47/+45
2019-02-26Auto merge of #58357 - sfackler:vectored-io, r=alexcrichtonbors-1/+36
Add vectored read and write support This functionality has lived for a while in the tokio ecosystem, where it can improve performance by minimizing copies. r? @alexcrichton
2019-02-22Rollup merge of #58059 - RalfJung:before_exec, r=alexcrichtonMazdak Farrokhzad-4/+24
deprecate before_exec in favor of unsafe pre_exec Fixes https://github.com/rust-lang/rust/issues/39575 As per the [lang team decision](https://github.com/rust-lang/rust/issues/39575#issuecomment-442993358): > The language team agreed that before_exec should be unsafe, and leaves the details of a transition plan to the libs team. Cc @alexcrichton @rust-lang/libs how would you like to proceed?
2019-02-13Add vectored read and write supportSteven Fackler-1/+36
This functionality has lived for a while in the tokio ecosystem, where it can improve performance by minimizing copies.
2019-02-12Auto merge of #58341 - alexreg:cosmetic-2-doc-comments, r=steveklabnikbors-12/+12
Cosmetic improvements to doc comments This has been factored out from https://github.com/rust-lang/rust/pull/58036 to only include changes to documentation comments (throughout the rustc codebase). r? @steveklabnik Once you're happy with this, maybe we could get it through with r=1, so it doesn't constantly get invalidated? (I'm not sure this will be an issue, but just in case...) Anyway, thanks for your advice so far!
2019-02-11remove "experimental" wording from std::os::unixAndy Russell-1/+1
2019-02-10libs: doc commentsAlexander Regueiro-10/+10
2019-02-10tests: doc commentsAlexander Regueiro-2/+2
2019-02-03POSIX requires async signal safety for fork in signal handlers, not in generalRalf Jung-2/+1
2019-02-02pre_exec: expand docsRalf Jung-3/+4
2019-02-02deprecate things a bit slowerRalf Jung-1/+1
2019-02-01also replace before_exec by pre_exec on redoxRalf Jung-1/+1
2019-02-01deprecate before_exec in favor of unsafe pre_execRalf Jung-3/+23
2019-01-15Stabilize FileExt::read_exact_at/write_all_atDror Levin-4/+2
Closes #51984.
2018-12-25Remove licensesMark Rousskov-80/+0
2018-12-11std: Depend directly on crates.io cratesAlex Crichton-1/+1
Ever since we added a Cargo-based build system for the compiler the standard library has always been a little special, it's never been able to depend on crates.io crates for runtime dependencies. This has been a result of various limitations, namely that Cargo doesn't understand that crates from crates.io depend on libcore, so Cargo tries to build crates before libcore is finished. I had an idea this afternoon, however, which lifts the strategy from #52919 to directly depend on crates.io crates from the standard library. After all is said and done this removes a whopping three submodules that we need to manage! The basic idea here is that for any crate `std` depends on it adds an *optional* dependency on an empty crate on crates.io, in this case named `rustc-std-workspace-core`. This crate is overridden via `[patch]` in this repository to point to a local crate we write, and *that* has a `path` dependency on libcore. Note that all `no_std` crates also depend on `compiler_builtins`, but if we're not using submodules we can publish `compiler_builtins` to crates.io and all crates can depend on it anyway! The basic strategy then looks like: * The standard library (or some transitive dep) decides to depend on a crate `foo`. * The standard library adds ```toml [dependencies] foo = { version = "0.1", features = ['rustc-dep-of-std'] } ``` * The crate `foo` has an optional dependency on `rustc-std-workspace-core` * The crate `foo` has an optional dependency on `compiler_builtins` * The crate `foo` has a feature `rustc-dep-of-std` which activates these crates and any other necessary infrastructure in the crate. A sample commit for `dlmalloc` [turns out to be quite simple][commit]. After that all `no_std` crates should largely build "as is" and still be publishable on crates.io! Notably they should be able to continue to use stable Rust if necessary, since the `rename-dependency` feature of Cargo is soon stabilizing. As a proof of concept, this commit removes the `dlmalloc`, `libcompiler_builtins`, and `libc` submodules from this repository. Long thorns in our side these are now gone for good and we can directly depend on crates.io! It's hoped that in the long term we can bring in other crates as necessary, but for now this is largely intended to simply make it easier to manage these crates and remove submodules. This should be a transparent non-breaking change for all users, but one possible stickler is that this almost for sure breaks out-of-tree `std`-building tools like `xargo` and `cargo-xbuild`. I think it should be relatively easy to get them working, however, as all that's needed is an entry in the `[patch]` section used to build the standard library. Hopefully we can work with these tools to solve this problem! [commit]: https://github.com/alexcrichton/dlmalloc-rs/commit/28ee12db813a3b650a7c25d1c36d2c17dcb88ae3
2018-12-07Various minor/cosmetic improvements to codeAlexander Regueiro-1/+1
2018-11-30Deal with EINTR in net timeout testsJosh Stone-4/+6
We've seen sporadic QE failures in the timeout tests on this assertion: assert!(kind == ErrorKind::WouldBlock || kind == ErrorKind::TimedOut); So there's an error, but not either of the expected kinds. Adding a format to show the kind revealed `ErrorKind::Interrupted` (`EINTR`). For the cases that were using `read`, we can just use `read_exact` to keep trying after interruption. For those using `recv_from`, we have to manually loop until we get a non-interrupted result.
2018-11-22Make std::os::unix/linux::fs::MetadataExt::a/m/ctime* documentation clearerariasuni-6/+12