about summary refs log tree commit diff
path: root/library/std/src/sys
AgeCommit message (Collapse)AuthorLines
2022-04-02Rollup merge of #95587 - m-ou-se:std-remove-associated-type-bounds, r=Dylan-DPCDylan DPC-2/+4
Remove need for associated_type_bounds in std.
2022-04-01Use MaybeUninit for clock_gettime's timespec.Mara Bos-3/+4
2022-04-01Don't spin on contended mutexes.Mara Bos-1/+3
2022-04-01Shuffle around #[inline] and #[cold] in mutex impl.Mara Bos-5/+7
2022-04-01Add comment about futex_wait timeout.Mara Bos-0/+2
2022-04-01Remove need for associated_type_bounds in std.Mara Bos-2/+4
2022-03-30Fix library/std compilation on openbsd.Dan Gohman-1/+1
Fix a minor typo from #95241 which prevented compilation on x86_64-unknown-openbsd.
2022-03-30Synchronize asynchronous pipe reads and writesChris Denton-2/+138
2022-03-29mark FIXMES for all the places found that are probably offset_fromAria Beingessner-0/+2
2022-03-29revert changes that cast functions to raw pointers, portability hazardAria Beingessner-9/+8
2022-03-29Make some linux/unix APIs better conform to strict provenance.Alexis Beingessner-33/+36
This largely makes the stdlib conform to strict provenance on Ubuntu. Some hairier things have been left alone for now.
2022-03-29Make the stdlib largely conform to strict provenance.Aria Beingessner-16/+19
Some things like the unwinders and system APIs are not fully conformant, this only covers a lot of low-hanging fruit.
2022-03-28Fix build on i686-apple-darwin systemsMarcus Calhoun-Lopez-0/+3
On 32-bit systems, fdopendir is called `_fdopendir$INODE64$UNIX2003`. On 64-bit systems, fdopendir is called `_fdopendir$INODE64`.
2022-03-28Fix build on i686-apple-darwin systemsMarcus Calhoun-Lopez-5/+5
Replace `target_arch = "x86_64"` with `not(target_arch = "aarch64")` so that i686-apple-darwin systems dynamically choose implementation.
2022-03-25Check for `"` and `\` in a filenameChris Denton-1/+9
And also fix typo.
2022-03-24Explicitly use CLOCK_MONOTONIC in futex_wait.Mara Bos-3/+3
Instant might be changed to use CLOCK_BOOTTIME at some point.
2022-03-24Make Timespec available in sys::unix.Mara Bos-15/+13
2022-03-24Use FUTEX_WAIT_BITSET rather than FUTEX_WAIT on Linux.Mara Bos-22/+38
2022-03-23Spin before blocking in Mutex::lock.Mara Bos-4/+38
2022-03-23Replace Linux Mutex and Condvar with futex based ones.Mara Bos-8/+149
2022-03-23Add futex_wake_all.Mara Bos-0/+12
2022-03-23Return timeout status in futex_wait.Mara Bos-4/+5
2022-03-23Auto merge of #95173 - m-ou-se:sys-locks-module, r=dtolnaybors-90/+124
Move std::sys::{mutex, condvar, rwlock} to std::sys::locks. This cleans up the the std::sys modules a bit by putting the locks in a single module called `locks` rather than spread over the three modules `mutex`, `condvar`, and `rwlock`. This makes it easier to organise lock implementations, which helps with https://github.com/rust-lang/rust/issues/93740.
2022-03-23Command: handle exe and batch files separatelyChris Denton-22/+113
2022-03-23Refactor: Move argument building into argsChris Denton-69/+70
2022-03-22Move std::sys::{mutex, condvar, rwlock} to std::sys::locks.Mara Bos-40/+64
2022-03-21Move pthread locks to own module.Mara Bos-50/+60
2022-03-20Rollup merge of #95114 - ChrisDenton:symlink-test, r=the8472Matthias Krüger-2/+9
Skip a test if symlink creation is not possible If someone running tests on Windows does not have Developer Mode enabled then creating symlinks will fail which in turn would cause this test to fail. This can be a stumbling block for contributors.
2022-03-20Rollup merge of #94749 - RalfJung:remove-dir-all-miri, r=cuviperMatthias Krüger-3/+3
remove_dir_all: use fallback implementation on Miri Fixes https://github.com/rust-lang/miri/issues/1966 The new implementation requires `openat`, `unlinkat`, and `fdopendir`. These cannot easily be shimmed in Miri since libstd does not expose APIs corresponding to them. So for now it is probably easiest to just use the fallback code in Miri. Nobody should run Miri as root anyway...
2022-03-19Skip a test if symlink creation is not possibleChris Denton-2/+9
2022-03-19Rollup merge of #93858 - krallin:process-process_group, r=dtolnayDylan DPC-2/+80
Add a `process_group` method to UNIX `CommandExt` - Tracking issue: #93857 - RFC: https://github.com/rust-lang/rfcs/pull/3228 Add a `process_group` method to `std::os::unix::process::CommandExt` that allows setting the process group id (i.e. calling `setpgid`) in the child, thus enabling users to set process groups while leveraging the `posix_spawn` fast path.
2022-03-19Rollup merge of #92612 - atopia:update-lib-l4re, r=dtolnayDylan DPC-15/+49
Update stdlib for the l4re target This PR contains the work by ``@humenda`` and myself to update standard library support for the x86_64-unknown-l4re-uclibc tier 3 target, split out from humenda/rust as requested in #85967. The changes have been rebased on current master and updated in follow up commits by myself. The publishing of the changes is authorized and preferred by the original author. To preserve attribution, when standard library changes were introduced as part of other changes to the compiler, I have kept the changes concerning the standard library and altered the commit messages as indicated. Any incompatibilities have been remedied in follow up commits, so that the PR as a whole should result in a clean update of the target.
2022-03-19Rollup merge of #92519 - ChrisDenton:command-maybe-verbatim, r=dtolnayDylan DPC-30/+44
Use verbatim paths for `process::Command` if necessary In #89174, the standard library started using verbatim paths so longer paths are usable by default. However, `Command` was originally left out because of the way `CreateProcessW` was being called. This was changed as a side effect of #87704 so now `Command` paths can be converted to verbatim too (if necessary).
2022-03-18Rollup merge of #95058 - wcampbell0x2a:use-then-in-unix-process, r=dtolnayMatthias Krüger-3/+3
Add use of bool::then in sys/unix/process Remove `else { None }` in favor of using `bool::then()`
2022-03-17feat: Add use of bool::then in sys/unix/processwcampbell-3/+3
Remove else { None } in favor of using bool::then()
2022-03-16resolve the conflict in compiler/rustc_session/src/parse.rscodehorseman-1/+1
Signed-off-by: codehorseman <cricis@yeah.net>
2022-03-14Add a `process_group` method to UNIX `CommandExt`Thomas Orozco-2/+80
2022-03-10Use implicit capture syntax in format_argsT-O-R-U-S-26/+24
This updates the standard library's documentation to use the new syntax. The documentation is worthwhile to update as it should be more idiomatic (particularly for features like this, which are nice for users to get acquainted with). The general codebase is likely more hassle than benefit to update: it'll hurt git blame, and generally updates can be done by folks updating the code if (and when) that makes things more readable with the new format. A few places in the compiler and library code are updated (mostly just due to already having been done when this commit was first authored).
2022-03-09add as_raw() method to L4Re's Socket mockBenjamin Lamowski-0/+5
Minimally comply with with #87329 to avoid breaking tests on L4Re.
2022-03-09adapt L4Re network interface mock to #87329Benjamin Lamowski-9/+34
Copy the relevant trait implementations from the Unix default.
2022-03-09L4Re does not support sanitizing standard streamsBenjamin Lamowski-0/+1
L4Re provides limited POSIX support which includes support for standard I/O streams, and a limited implementation of the standard file handling API. However, because as a capability based OS it strives to only make a local view available to each application, there are currently no standardized special files like /dev/null that could serve to sanitize closed standard FDs. For now, skip any attempts to sanitize standard streams until a more complete POSIX runtime is available.
2022-03-09drop unused libc imports on L4ReBenjamin Lamowski-1/+4
As a capability-based microkernel OS, L4Re only has incomplete support for POSIX APIs, in particular it does not implement UIDs and GIDs.
2022-03-09fix return value of LookupHost::port()Sebastian Humenda-1/+1
[Benjamin Lamowski: Reworded commit message after split commit.]
2022-03-09fix return values in L4Re networking stubSebastian Humenda-4/+4
[Benjamin Lamowski: Reworded commit message after split commit.]
2022-03-09Rollup merge of #94756 - ChrisDenton:unreachable, r=yaahcDylan DPC-1/+7
Use `unreachable!` for an unreachable code path Closes #73212
2022-03-09Auto merge of #94750 - cuviper:dirent64_min, r=joshtriplettbors-10/+47
unix: reduce the size of DirEntry On platforms where we call `readdir` instead of `readdir_r`, we store the name as an allocated `CString` for variable length. There's no point carrying around a full `dirent64` with its fixed-length `d_name` too.
2022-03-09Use `unreachable!` for an unreachable code pathChris Denton-1/+7
2022-03-08Rollup merge of #94724 - cuviper:rmdirall-cstr, r=Dylan-DPCDylan DPC-10/+9
unix: Avoid name conversions in `remove_dir_all_recursive` Each recursive call was creating an `OsString` for a `&Path`, only for it to be turned into a `CString` right away. Instead we can directly pass `.name_cstr()`, saving two allocations each time.
2022-03-08unix: reduce the size of DirEntryJosh Stone-10/+47
On platforms where we call `readdir` instead of `readdir_r`, we store the name as an allocated `CString` for variable length. There's no point carrying around a full `dirent64` with its fixed-length `d_name` too.
2022-03-08remove_dir_all: use fallback implementation on MiriRalf Jung-3/+3