Skip to content

Conversation

@GiuseppeCesarano
Copy link
Contributor

This patch ports Child.start_suspended to Linux.

Note: The doc-comment says that start_suspended is implemented for Darwin but giving a quick look to the file I can't find where this is achieved.

@GiuseppeCesarano
Copy link
Contributor Author

Following up the comment in the review, I can add std.posix.getpid to the std lib if you confirm that calling system.getpid in std.posix is a sufficient for other targets which are not Linux.

@alexrp
Copy link
Member

alexrp commented Nov 6, 2025

See #24027. Perhaps you can revive that one since the author hasn't responded to my review comments yet.

@alexrp alexrp self-assigned this Nov 6, 2025
@GiuseppeCesarano
Copy link
Contributor Author

I've used wait4 for riscv since there ins't the waitpid const in the syscalls consts.

But please note that wait4 is not a standard posix function but a BSD/Linux extension so I don't know if that's ok without restricting the the OS

Copy link
Member

@alexrp alexrp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

For the sake of clean history, can you squash this into two commits:

  • The addition of getpid and getppid to std.posix
  • The implementation of POSIX start_suspended support in std.process.Child

@GiuseppeCesarano GiuseppeCesarano changed the title Child.start_suspended ported to linux Child.start_suspended ported to posix Nov 7, 2025
@alexrp alexrp merged commit bf15c79 into ziglang:master Nov 7, 2025
9 checks passed
@alexrp
Copy link
Member

alexrp commented Nov 7, 2025

Thanks!

@alexrp alexrp removed their assignment Nov 7, 2025
@GiuseppeCesarano GiuseppeCesarano deleted the process branch November 8, 2025 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants