Skip to content

Add a wait mode that uses pidfd_open()#14

Merged
diazona merged 5 commits into
mainfrom
pidfd/1/dev
Jul 5, 2025
Merged

Add a wait mode that uses pidfd_open()#14
diazona merged 5 commits into
mainfrom
pidfd/1/dev

Conversation

@diazona

@diazona diazona commented Jul 5, 2025

Copy link
Copy Markdown
Owner

In this PR I'm adding a waiting mode based on pidfd_open(). The implementation is similar to the one given in the man page for that function, but that's kind of forced by the task: there isn't a lot of flexibility in how you write this code.

I also restructured the test script a bit to account for the fact that this is the second waiting mode that doesn't capture the exit code of the process being waited for.

Closes #4

diazona added 5 commits July 4, 2025 22:41
To support new waiting methods that don't provide the exit code of
the process being waited for, I'm changing the test script to recognize
an environment variable PWAIT_SKIP_EXIT_CODE_TESTS, which if set to any
nonempty value will cause the exit code tests to be skipped.

Now that the main test function in the test script, run_all_tests(),
supports skipping exit code tests, I changed the test configuration so
that testing the poll method will use that function as well. The tests
of the --delay option, which are specific to the polling method, will be
run from a separate test function.
This is very similar to the implementation in the man page for
pidfd_open (https://man7.org/linux/man-pages/man2/poll.2.html), but
that's mostly because there isn't a lot of flexibility in how you can
write code to do this.
This is necessary to have GitHub Actions workflows run after renaming
the default branch from master to main.
This is necessary for GHA workflows to run on this branch.
@diazona diazona merged commit 95ac5ae into main Jul 5, 2025
2 checks passed
@diazona diazona deleted the pidfd/1/dev branch July 5, 2025 19:43
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.

RFE: add support for pidfd_open()

1 participant