about summary refs log tree commit diff
path: root/library/std/src/sys
AgeCommit message (Collapse)AuthorLines
2022-05-09Auto merge of #96802 - gimbles:windows_slice, r=thomccbors-0/+1
[feat] Make sys::windows::os_str::Slice repr(transparent) Fixes #96577
2022-05-08fix panic in Path::strip_prefixname1e5s-0/+12
2022-05-07[fix] remove pub(crate) visibilitygimbles-1/+1
2022-05-06Share more unix SystemTime codeJosh Stone-101/+57
2022-05-06[feat] Make sys::windows::os_str::Slice repr(transparent)gimbles-1/+2
2022-05-06Use statx's 64-bit times on 32-bit linux-gnuJosh Stone-38/+79
2022-05-06Use __clock_gettime64 on 32-bit linux-gnuJosh Stone-0/+27
2022-05-06unix: always use 64-bit TimespecJosh Stone-67/+65
2022-05-03Round timeouts up to infinite in futex_wait on DragonFlyBSD.Mara Bos-9/+8
2022-05-03Add #[cfg] in cfg_if for linux in unix/futex.Mara Bos-3/+5
2022-05-03Don't use futexes on netbsd.Mara Bos-43/+5
The latest NetBSD release doesn't include the futex syscall yet.
2022-04-29Disable pthread thread parker on futex platforms.Mara Bos-1/+5
2022-04-29Always return false in futex_wake on {Free,DragonFly}BSD.Mara Bos-16/+13
2022-04-29Use futex-based locks and thread parker on FreeBSD.Mara Bos-4/+59
2022-04-29Use futex-based locks and thread parker on DragonFlyBSD.Mara Bos-1/+43
2022-04-29Use futex-based locks and thread parker on NetBSD.Mara Bos-24/+52
2022-04-29Use futex-based locks and thread parker on OpenBSD.Mara Bos-1/+52
2022-04-29Auto merge of #96441 - ChrisDenton:sync-pipes, r=m-ou-sebors-31/+107
Windows: Make stdin pipes synchronous Stdin pipes do not need to be used asynchronously within the standard library. This is a first step in making pipes mostly synchronous. r? `@m-ou-se`
2022-04-28Auto merge of #96393 - joboet:pthread_parker, r=thomccbors-9/+281
std: directly use pthread in UNIX parker implementation `Mutex` and `Condvar` are being replaced by more efficient implementations, which need thread parking themselves (see #93740). Therefore we should use the `pthread` synchronization primitives directly. Also, we can avoid allocating the mutex and condition variable because the `Parker` struct is being placed in an `Arc` anyways. This basically is just a copy of the current `Mutex` and `Condvar` code, which will however be removed (again, see #93740). An alternative implementation could be to use dedicated private `OsMutex` and `OsCondvar` types, but all the other platforms supported by std actually have their own thread parking primitives. I used `Pin` to guarantee a stable address for the `Parker` struct, while the current implementation does not, rather using extra unsafe declaration. Since the thread struct is shared anyways, I assumed this would not add too much clutter while being clearer.
2022-04-28Yield the thread when waiting to delete a fileChris Denton-0/+3
2022-04-28std: simplify UNIX parker timeoutsjoboet-59/+21
2022-04-27Note the importance of using sync pipesChris Denton-1/+19
2022-04-26Windows: Make stdin pipes synchronousChris Denton-31/+85
Stdin pipes do not need to be used asynchronously within the standard library.
2022-04-26Add `set_inheritable` for Windows `Handle`sChris Denton-0/+4
2022-04-26Retry deleting a directoryChris Denton-2/+15
It's possible that a file in the directory is pending deletion. In that case we might succeed after a few attempts.
2022-04-25Remove references to git.ioEric Huss-1/+2
2022-04-26Windows: Iterative `remove_dir_all`Chris Denton-77/+67
This will allow better strategies for use of memory and File handles. However, fully taking advantage of that is left to future work.
2022-04-25std: directly use pthread in UNIX parker implementationjoboet-7/+317
Mutex and Condvar are being replaced by more efficient implementations, which need thread parking themselves (see #93740). Therefore use the pthread synchronization primitives directly. Also, avoid allocating because the Parker struct is being placed in an Arc anyways.
2022-04-25Auto merge of #95246 - ChrisDenton:command-args, r=joshtriplettbors-91/+191
Windows Command: Don't run batch files using verbatim paths Fixes #95178 Note that the first commit does some minor refactoring (moving command line argument building to args.rs). The actual changes are in the second.
2022-04-24Auto merge of #94609 - esp-rs:esp-idf-stat-type-fixes, r=Mark-Simulacrumbors-3/+18
espidf: fix stat Marking as draft as currently dependant on [a libc fix](https://github.com/rust-lang/libc/pull/2708) and release.
2022-04-23std: `<ExitStatus as Display>::fmt` name the signal it died fromMichael Howell-3/+66
2022-04-23Auto merge of #96314 - AronParker:issue-96297-fix, r=thomccbors-1/+7
Reduce allocations for path conversions on Windows Previously, UTF-8 to UTF-16 Path conversions on Windows unnecessarily allocate twice, as described in #96297. This commit fixes that issue.
2022-04-23Auto merge of #94887 - dylni:move-normpath-crate-impl-to-libstd, r=ChrisDentonbors-29/+115
Improve Windows path prefix parsing This PR fixes improves parsing of Windows path prefixes. `parse_prefix` now supports both types of separators on Windows (`/` and `\`).
2022-04-22Remove redundant type annotationAron Parker-1/+1
2022-04-22Reduce allocations for path conversions on WindowsAron Parker-1/+7
Previously, UTF-8 to UTF-16 Path conversions on Windows unnecessarily allocate twice, as described in #96297. This commit fixes that issue.
2022-04-21Rollup merge of #96193 - djkoloski:fuchsia_current_exe, r=tmandryDylan DPC-1/+21
[fuchsia] Add implementation for `current_exe` This implementation returns a best attempt at the current exe path. On fuchsia, fdio will always use `argv[0]` as the process name and if it is not set then an error will be returned. Because this is not guaranteed to be the case, this implementation returns an error if `argv` does not contain any elements.
2022-04-20Rollup merge of #96234 - goffrie:eloop, r=thomccDylan DPC-1/+2
remove_dir_all_recursive: treat ELOOP the same as ENOTDIR On older Linux kernels (I tested on 4.4, corresponding to Ubuntu 16.04), opening a symlink using `O_DIRECTORY | O_NOFOLLOW` returns `ELOOP` instead of `ENOTDIR`. We should handle it the same, since a symlink is still not a directory and needs to be `unlink`ed.
2022-04-20Rollup merge of #96206 - m-ou-se:wasm-futex-locks, r=alexcrichtonDylan DPC-358/+24
Use sys::unix::locks::futex* on wasm+atomics. This removes the wasm-specific lock implementations and instead re-uses the implementations from sys::unix. Tracking issue: https://github.com/rust-lang/rust/issues/93740 cc ``@alexcrichton``
2022-04-20Rollup merge of #96167 - CAD97:weak-dlsym-less-ptr-crime, r=thomccDylan DPC-17/+15
Replace sys/unix/weak AtomicUsize with AtomicPtr Should fix #96163. Can't easily test on Windows though...
2022-04-20remove_dir_all_recursive: treat ELOOP the same as ENOTDIRGeoffry Song-1/+2
2022-04-19[fuchsia] Add implementation for `current_exe`David Koloski-1/+21
This implementation returns a best attempt at the current exe path. On fuchsia, fdio will always use `argv[0]` as the process name and if it is not set then an error will be returned. Because this is not guaranteed to be the case, this implementation returns an error if `argv` does not contain any elements.
2022-04-19espidf: fix statScott Mabin-3/+18
* corect type usage with new type definitions in libc
2022-04-19Use futex locks on emscripten.Mara Bos-0/+1
2022-04-19Use futex locks on wasm+atomics.Mara Bos-354/+6
2022-04-19Make std::sys::wasm::futex consistent with unix::futex.Mara Bos-4/+18
2022-04-19Make std::sys::unix::futex consistent on emscripten.Mara Bos-22/+25
2022-04-18Auto merge of #96042 - m-ou-se:one-reentrant-mutex, r=Amanieubors-528/+6
Use a single ReentrantMutex implementation on all platforms. This replaces all platform specific ReentrantMutex implementations by the one I added in #95727 for Linux, since that one does not depend on any platform specific details. r? `@Amanieu`
2022-04-18Remove forgotten reexport of ReentrantMutex in sys::unsupported.Mara Bos-1/+1
2022-04-17Replace sys/unix/weak AtomicUsize with AtomicPtrCAD97-17/+15
2022-04-17Auto merge of #93530 - anonion0:pthread_sigmask_fix, r=JohnTitorbors-4/+5
fix error handling for pthread_sigmask(3) Errors from `pthread_sigmask(3)` were handled using `cvt()`, which expects a return value of `-1` on error and uses `errno`. However, `pthread_sigmask(3)` returns `0` on success and an error number otherwise. Fix it by replacing `cvt()` with `cvt_nz()`.