| Age | Commit message (Collapse) | Author | Lines |
|
THREAD_NAME_MAX is 32 (31 max + 1 for the null terminator).
|
|
follow-up #123233
|
|
|
|
|
|
|
|
std library thread.rs: fix NetBSD code for ILP32 CPUs.
|
|
Unix: Support more platforms with `preadv` and `pwritev`
- `aix`, `dragonfly` and `openbsd` with direct call
- `watchos` with weak linkage
cc #89517
|
|
408c0ea2162b ("unix time module now return result") dropped the From
impl for SystemTime, breaking the hurd and horizon builds.
Fixes #123032
|
|
|
|
|
|
std::thread: refine available_parallelism for solaris/illumos.
Rather than the system-wide available cpus fallback solution, we fetch the cpus bound to the current process.
|
|
Fix build failure on ARM/AArch64/PowerPC/RISC-V FreeBSD/NetBSD
Fixes https://github.com/rust-lang/rust/pull/121881#discussion_r1536764650
Checked targets: aarch64-unknown-freebsd, powerpc64-unknown-freebsd, armv7-unknown-freebsd, riscv64gc-unknown-freebsd, aarch64-unknown-netbsd.
r? ``@Amanieu``
cc ``@devnexen``
|
|
|
|
Rather than the system-wide available cpus fallback solution, we fetch
the cpus bound to the current process.
|
|
|
|
Expand sys/os for UEFI
- Implement current_exe() and getcwd()
|
|
|
|
Replace visibility test with reachability test in dead code detection
Fixes https://github.com/rust-lang/rust/issues/119545
Also included is a fix for an error now flagged by the lint
|
|
std::net: adding acceptfilter feature for netbsd/freebsd.
similar to linux's ext deferaccept, to filter incoming connections before accept.
|
|
similar to linux's ext deferaccept, to filter incoming connections
before accept.
|
|
SeqCst isn't necessary in any of these cases.
|
|
The SeqCst wasn't synchronizing with anything. Relaxed is enough.
|
|
SeqCst is unnecessary. Release+Acquire is the right ordering for a
mutex.
|
|
Relaxed is enough to ensure fetch_add(1) returns each integer exactly
once.
|
|
SeqCst is unnecessary. Release+Acquire is the right ordering for a
mutex.
|
|
SeqCst is unnecessary here.
|
|
|
|
- Implement current_exe()
- Cache device_path_to_text protocol
Signed-off-by: Ayush Singh <ayushdevel1325@gmail.com>
|
|
Bump windows-bindgen to 0.55.0
windows-bindgen is the crate used to generate std's Windows API bindings.
Not many changes for us, it's mostly just simplifying the generate code (e.g. no more `-> ()`). The one substantial change is some structs now use `i8` byte arrays instead of `u8`. However, this only impacts one test.
|
|
change std::process to drop supplementary groups based on CAP_SETGID
A trivial rebase of #95982
Should fix #39186 (from what I can tell)
Original description:
> Fixes #88716
>
> * Before this change, when a process was given a uid via `std::os::unix::process::CommandExt.uid`, there would be a `setgroups` call (when the process runs) to clear supplementary groups for the child **if the parent was root** (to remove potentially unwanted permissions).
> * After this change, supplementary groups are cleared if we have permission to do so, that is, if we have the CAP_SETGID capability.
>
> This new behavior was agreed upon in #88716 but there was a bit of uncertainty from `@Amanieu` here: [#88716 (comment)](https://github.com/rust-lang/rust/issues/88716#issuecomment-973366600)
>
> > I agree with this change, but is it really necessary to ignore an EPERM from setgroups? If you have permissions to change UID then you should also have permissions to change groups. I would feel more comfortable if we documented set_uid as requiring both UID and GID changing permissions.
>
> The way I've currently written it, we ignore an EPERM as that's what #88716 originally suggested. I'm not at all an expert in any of this so I'd appreciate feedback on whether that was the right way to go.
|
|
unix time module now return result
First try to fix #108277 without break anything.
if anyone who read this know tips to be able to check compilation for different target I could use some help. So far I installed many target with rustup but `./x check --all-targets` doesn't seem to use them.
TODO:
- [x] better error
- [ ] test, how ?
`@rustbot` label -S-waiting-on-author +S-waiting-on-review
|
|
This commit provides a component model intrinsic in the standard library
by default on the `wasm32-wasip2` target. This intrinsic is not
required by the component model itself but is quite common to use, for
example it's needed if a wasm module receives a string or a list.
The intention of this commit is to provide an overridable definition in
the standard library through a weak definition of this function. That
means that downstream crates can provide their own customized and more
specific versions if they'd like, but the standard library's version
should suffice for general-purpose use.
|
|
The ordering of targets in `pal/mod.rs` did not end up using the wasip2
implementation, so after reordering that I've edited the implementation
to compile correctly.
|
|
|
|
|
|
|
|
The dead_code lint was previously eroneously missing this dead code.
Since this lint bug has been fixed, the unused field need
to be removed or marked as `#[allow(dead_code)]`.
These structures API is common to all platforms so the code cannot be
removed and is hence marked allow(dead_code).
|
|
The dead_code lint was previously eroneously missing this dead code.
Since this lint bug has been fixed, the unused field need
to be removed or marked as `#[allow(dead_code)]`.
Given the nature of this code, I don't feel confident removing the field
so it is only marked as allow(dead_code).
|
|
|
|
Rollup of 9 pull requests
Successful merges:
- #121148 (Add slice::try_range)
- #121633 (Win10: Use `GetSystemTimePreciseAsFileTime` directly)
- #121840 (Expose the Freeze trait again (unstably) and forbid implementing it manually)
- #121907 (skip sanity check for non-host targets in `check` builds)
- #122002 (std::threads: revisit stack address calculation on netbsd.)
- #122108 (Add `target.*.runner` configuration for targets)
- #122298 (RawVec::into_box: avoid unnecessary intermediate reference)
- #122315 (Allow multiple `impl Into<{D,Subd}iagMessage>` parameters in a function.)
- #122326 (Optimize `process_heap_alloc`)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
Optimize `process_heap_alloc`
This optimizes `process_heap_alloc` introduced in https://github.com/rust-lang/rust/pull/120205.
From:
```
.text:0000000180027ED0 ; std::sys::pal::windows::alloc::process_heap_alloc::h703a613b3e25ff93
.text:0000000180027ED0 public _ZN3std3sys3pal7windows5alloc18process_heap_alloc17h703a613b3e25ff93E
.text:0000000180027ED0 _ZN3std3sys3pal7windows5alloc18process_heap_alloc17h703a613b3e25ff93E proc near
.text:0000000180027ED0 ; CODE XREF: std::sys::pal::common::alloc::realloc_fallback::hc4c96b4c24d03e77+23↑p
.text:0000000180027ED0 ; std::sys::pal::common::alloc::realloc_fallback::hc4c96b4c24d03e77+55↑p ...
.text:0000000180027ED0 push rsi
.text:0000000180027ED1 push rdi
.text:0000000180027ED2 sub rsp, 28h
.text:0000000180027ED6 mov rsi, rdx
.text:0000000180027ED9 mov edi, ecx
.text:0000000180027EDB mov rcx, cs:_ZN3std3sys3pal7windows5alloc4HEAP17hb53ca4010cc29b62E ; std::sys::pal::windows::alloc::HEAP::hb53ca4010cc29b62
.text:0000000180027EE2 test rcx, rcx
.text:0000000180027EE5 jnz short loc_180027EFC
.text:0000000180027EE7 call cs:__imp_GetProcessHeap
.text:0000000180027EED test rax, rax
.text:0000000180027EF0 jz short loc_180027F0E
.text:0000000180027EF2 mov rcx, rax
.text:0000000180027EF5 mov cs:_ZN3std3sys3pal7windows5alloc4HEAP17hb53ca4010cc29b62E, rax ; std::sys::pal::windows::alloc::HEAP::hb53ca4010cc29b62
.text:0000000180027EFC
.text:0000000180027EFC loc_180027EFC: ; CODE XREF: std::sys::pal::windows::alloc::process_heap_alloc::h703a613b3e25ff93+15↑j
.text:0000000180027EFC mov edx, edi
.text:0000000180027EFE mov r8, rsi
.text:0000000180027F01 add rsp, 28h
.text:0000000180027F05 pop rdi
.text:0000000180027F06 pop rsi
.text:0000000180027F07 jmp cs:__imp_HeapAlloc
.text:0000000180027F0E ; ---------------------------------------------------------------------------
.text:0000000180027F0E
.text:0000000180027F0E loc_180027F0E: ; CODE XREF: std::sys::pal::windows::alloc::process_heap_alloc::h703a613b3e25ff93+20↑j
.text:0000000180027F0E xor eax, eax
.text:0000000180027F10 add rsp, 28h
.text:0000000180027F14 pop rdi
.text:0000000180027F15 pop rsi
.text:0000000180027F16 retn
.text:0000000180027F16 _ZN3std3sys3pal7windows5alloc18process_heap_alloc17h703a613b3e25ff93E endp
```
to
```
.text:0000000180027EE0 ; std::sys::pal::windows::alloc::process_heap_alloc::h70f9d61a631e5c16
.text:0000000180027EE0 public _ZN3std3sys3pal7windows5alloc18process_heap_alloc17h70f9d61a631e5c16E
.text:0000000180027EE0 _ZN3std3sys3pal7windows5alloc18process_heap_alloc17h70f9d61a631e5c16E proc near
.text:0000000180027EE0 ; CODE XREF: std::sys::pal::common::alloc::realloc_fallback::hc4c96b4c24d03e77+23↑p
.text:0000000180027EE0 ; std::sys::pal::common::alloc::realloc_fallback::hc4c96b4c24d03e77+54↑p ...
.text:0000000180027EE0 mov rcx, cs:_ZN3std3sys3pal7windows5alloc4HEAP17hb53ca4010cc29b62E ; std::sys::pal::windows::alloc::HEAP::hb53ca4010cc29b62
.text:0000000180027EE7 test rcx, rcx
.text:0000000180027EEA jz short loc_180027EF3
.text:0000000180027EEC jmp cs:__imp_HeapAlloc
.text:0000000180027EF3 ; ---------------------------------------------------------------------------
.text:0000000180027EF3
.text:0000000180027EF3 loc_180027EF3: ; CODE XREF: std::sys::pal::windows::alloc::process_heap_alloc::h70f9d61a631e5c16+A↑j
.text:0000000180027EF3 mov ecx, edx
.text:0000000180027EF5 mov rdx, r8
.text:0000000180027EF8 jmp std__sys__pal__windows__alloc__process_heap_init_and_alloc
.text:0000000180027EF8 _ZN3std3sys3pal7windows5alloc18process_heap_alloc17h70f9d61a631e5c16E endp
```
r? `@ChrisDenton`
|
|
r=workingjubilee,riastradh
std::threads: revisit stack address calculation on netbsd.
like older linux glibc versions, we need to get the guard size
and increasing the stack's bottom address accordingly.
|
|
Win10: Use `GetSystemTimePreciseAsFileTime` directly
On Windows 10 we can use `GetSystemTimePreciseAsFileTime` directly instead of lazy loading it (with a fallback).
|
|
Convert `Unix{Datagram,Stream}::{set_}passcred()` to per-OS traits
These methods are the pre-stabilized API for obtaining peer credentials from an `AF_UNIX` socket, part of the `unix_socket_ancillary_data` feature.
Their current behavior is to get/set one of the `SO_PASSCRED` (Linux), `LOCAL_CREDS_PERSISTENT` (FreeBSD), or `LOCAL_CREDS` (NetBSD) socket options. On other targets the `{set_}passcred()` methods do not exist.
There are two problems with this approach:
1. Having public methods only exist for certain targets isn't permitted in a stable `std` API.
2. These options have generally similar purposes, but they are non-POSIX and their details can differ in subtle and surprising ways (such as whether they continue to be set after the next call to `recvmsg()`).
Splitting into OS-specific extension traits is the preferred solution to both problems.
|
|
|
|
std::rand: enable getrandom for dragonflybsd too.
|
|
Dynamically size sigaltstk in std
On modern Linux with Intel AMX and 1KiB matrices,
Arm SVE with potentially 2KiB vectors,
and RISCV Vectors with up to 16KiB vectors,
we must handle dynamic signal stack sizes.
We can do so unconditionally by using getauxval,
but assuming it may return 0 as an answer,
thus falling back to the old constant if needed.
Fixes https://github.com/rust-lang/rust/issues/107795
|
|
Implement junction_point
Implements https://github.com/rust-lang/rust/issues/121709
We already had a private implementation that we use for tests so we could just make that public. Except it was very hacky as it was only ever intended for use in testing. I've made an improved version that at least handles path conversion correctly and has less need for things like the `Align8` hack. There's still room for further improvement though.
|
|
|
|
|