about summary refs log tree commit diff
path: root/library/std/src/sys/unix/process
AgeCommit message (Collapse)AuthorLines
2024-01-11std: begin moving platform support modules into `pal`joboet-3235/+0
2023-12-03library: use c string literalsklensy-5/+4
2023-11-19Don't set cmsg fields in msghdr if we have no cmsg to sendThe 8472-3/+4
2023-11-16if available use a Child's pidfd for kill/waitThe 8472-4/+72
2023-11-16update comment, we're currently using a different syscallThe 8472-1/+1
2023-11-16set CLOEXEC on pidfd received from child processThe 8472-3/+7
2023-10-22use visibility to check unused imports and delete some stmtsbohan-1/+1
2023-10-14Fix broken build on ESP-IDF caused by #115108ivmarkov-4/+24
2023-10-13Auto merge of #115108 - ijackson:broken-wait-status, r=dtolnaybors-50/+144
Fix exit status / wait status on non-Unix cfg(unix) platforms Fixes #114593 Needs FCP due to behavioural changes (NB only on non-Unix `#[cfg(unix)]` platforms). Also, I think this is likely to break in CI. I have not been yet able to compile the new bits of `process_unsupported.rs`, although I have compiled the new module. I'd like some help from people familiar with eg emscripten and fuchsia (which are going to be affected, I think).
2023-09-22Rollup merge of #114379 - RalfJung:command-removed-env-vars, r=m-ou-seMatthias Krüger-0/+17
Command: also print removed env vars There is no real shell syntax for unsetting an env var so easily, so we have to make one up. But we already do that for showing the 'program' name so I hope that's okay here, too. No strong opinion on what that should look like, I went with `unset(VAR_NAME)` for now.
2023-09-21added support for GNU/HurdSamuel Thibault-0/+13
2023-09-09Auto merge of #114590 - ijackson:stdio-stdio-2, r=dtolnaybors-1/+29
Allow redirecting subprocess stdout to our stderr etc. (redux) This is the code from #88561, tidied up, including review suggestions, and with the for-testing-only CI commit removed. FCP for the API completed in #88561. I have made a new MR to facilitate review. The discussion there is very cluttered and the branch is full of changes (in many cases as a result of changes to other Rust stdlib APIs since then). Assuming this MR is approvedl we should close that one. ### Reviewer doing a de novo review Just code review these four commits.. FCP discussion starts here: https://github.com/rust-lang/rust/pull/88561#issuecomment-1640527595 Portability tests: you can see that this branch works on Windows too by looking at the CI results in #88561, which has the same code changes as this branch but with an additional "DO NOT MERGE" commit to make the Windows tests run. ### Reviewer doing an incremental review from some version of #88561 Review the new commits since your last review. I haven't force pushed the branch there. git diff the two branches (eg `git diff 176886197d6..0842b69c219`). You'll see that the only difference is in gitlab CI files. You can also see that *this* MR doesn't touch those files.
2023-09-06fix typoRalf Jung-1/+1
Co-authored-by: Marcin S. <marcin@realemail.net>
2023-09-03Rollup merge of #115489 - saethlin:is-interrupted, r=thomccMatthias Krüger-1/+1
Use std::io::Error::is_interrupted everywhere In https://github.com/rust-lang/rust/pull/115228 I introduced this helper and started using it, this PR uses it to replace all applicable uses of `std::io::Error::kind`. The justification is the same; for whatever reason LLVM totally flops optimizing `Error::kind` so it's nice to use it less. FYI ``@mkroening`` I swear the hermit changes look good, but I was so sure about the previous PR.
2023-09-03Use std::io::Error::is_interrupted everywhereBen Kimock-1/+1
2023-09-01fix(std): Rename os_str_bytes to encoded_bytesEd Page-2/+2
2023-08-24also use 'env' for printing unsettingRalf Jung-7/+3
2023-08-24also print clearing the environment entirelyRalf Jung-12/+17
2023-08-24make unsetting env vars print as executable commandRalf Jung-2/+16
2023-08-24Command: also print removed env varsRalf Jung-0/+2
2023-08-22std: unix process_unsupported: Provide a wait status emulation (tidy)Ian Jackson-36/+39
Move tests into a module as demanded by tidy.
2023-08-22fixup! std: unix process: Test exit statuses / wait statusesIan Jackson-1/+1
2023-08-22std: unix process_unsupported: Provide a wait status emulation (fmt)Ian Jackson-15/+3
Worsify formatting as required by rustfmt.
2023-08-22fixup! std: unix process_unsupported: Provide a wait status emulationIan Jackson-1/+1
2023-08-22std: unix process: Test exit statuses / wait statusesIan Jackson-0/+33
This is a pretty basic test but should spot any other platforms which are `#[cfg(unix)]` but not Unix and where the wait status representation is wrong. (And any actual Unix platforms where it's not as expected, but I don't think they exist.)
2023-08-22std: unix process_unsupported: Provide a wait status emulationIan Jackson-50/+120
Fixes #114593 Needs FCP due to behavioural changes.
2023-08-09Rollup merge of #113939 - the8472:pidfd-from-child, r=Mark-SimulacrumMatthias Krüger-90/+156
open pidfd in child process and send to the parent via SOCK_SEQPACKET+CMSG This avoids using `clone3` when a pidfd is requested while still getting it in a 100% race-free manner by passing it up from the child process. This should solve most concerns in #82971
2023-08-08open pidfd in child process and send to the parent via SOCK_SEQPACKET+CMSGThe 8472-90/+156
This is a 100% race-free way to obtain a child's pidfd while avoiding `clone3`.
2023-08-08Rollup merge of #106425 - ijackson:exit-status-default, r=dtolnayMatthias Krüger-4/+4
Make ExitStatus implement Default And, necessarily, make it inhabited even on platforms without processes. I noticed while preparing https://github.com/rust-lang/rfcs/pull/3362 that there was no way for anyone to construct an `ExitStatus`. This would be insta-stable so needs an FCP.
2023-08-07impl Default for ExitStatusIan Jackson-4/+4
2023-08-07std::process (unix): Implement From<io::Stdout> etc. for imp::StdioIan Jackson-1/+29
This involves adding a new variant `imp::Stdio::StaticFd`. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2023-07-06Rollup merge of #113334 - fmease:revert-lexing-c-str-lits, r=compiler-errorsfee1-dead-4/+5
Revert the lexing of `c"…"` string literals Fixes \[after beta-backport\] #113235. Further progress is tracked in #113333. This PR *manually* reverts parts of #108801 (since a git-revert would've been too coarse-grained & messy) and git-reverts #111647. CC `@fee1-dead` (#108801) `@klensy` (#111647) r? `@compiler-errors` `@rustbot` label F-c_str_literals beta-nominated
2023-07-05Revert "use c literals in library"León Orell Valerian Liehr-4/+5
This reverts commit f212ba6d6d60963c8101bb24fc3e53fca80c046f.
2023-07-05Auto merge of #112594 - ChrisDenton:process=-kill, r=Amanieubors-10/+4
Return `Ok` on kill if process has already exited This will require an FCP from `@rust-lang/libs-api.` Fixes #112423. See that issue for more details.
2023-07-01Return `Ok` on kill if process has already exitedChris Denton-10/+4
2023-06-21Actually save all the filesThom Chiovoloni-7/+6
2023-06-21Avoid fork/exec spawning on tvOS/watchOS, as those functions are marked as ↵Thom Chiovoloni-4/+48
prohibited
2023-06-13fix: get the l4re target working againHenrik Böving-1/+17
2023-06-03Auto merge of #109432 - flba-eb:108594_forkspawn_exponential_backoff, ↵bors-14/+62
r=workingjubilee QNX Neutrino: exponential backoff when fork/spawn needs a retry Fixes #108594: When retrying, sleep with an exponential duration. When sleep duration is lower than minimum possible sleeping time, yield instead (this will not be often due to the exponential increase of duration). Minimum possible sleeping time is determined using `libc::clock_getres` but only when spawn/fork failed the first time in a request. This is cached using a LazyLock. CC `@gh-tr` r? `@workingjubilee` `@rustbot` label +O-neutrino
2023-06-02Only determine clock res once; give up before sleeping more than 1 secondFlorian Bartels-23/+37
2023-06-02Retry to fork/spawn with exponential backoffFlorian Bartels-10/+44
2023-05-31use c literals in libraryklensy-5/+4
2023-05-13refactor: Remove redundant, private OsStr::bytesEd Page-2/+2
2023-05-07PS Vita std supportNikolay Arhipov-1/+1
2023-04-26Spelling library/Josh Soref-2/+2
* advance * aligned * borrowed * calculate * debugable * debuggable * declarations * desugaring * documentation * enclave * ignorable * initialized * iterator * kaboom * monomorphization * nonexistent * optimizer * panicking * process * reentrant * rustonomicon * the * uninitialized Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-12remove some unneeded importsKaDiWa-2/+0
2023-02-28Retry to spawn/fork up to 3 times when it failed because of an interruptionFlorian Bartels-2/+64
2023-02-28Add QNX Neutrino support to libstdFlorian Bartels-3/+7
Co-authored-by: gh-tr <troach@qnx.com>
2023-01-18signal update string representation for haiku.David Carlier-0/+2
2023-01-14Remove various double spaces in source comments.André Vennberg-14/+14