Skip to content

Add close_range(3) function #56

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: trunk
Choose a base branch
from

Conversation

ricardobranco777
Copy link

@ricardobranco777 ricardobranco777 commented Jul 19, 2025

Add close_range(3) function. This uses the fcntl approach suggested to me by Robert Elz to avoid adding a newsystem call like in #43

The manpage was adapted from FreeBSD using the Linux names for the parameters:
https://man.freebsd.org/cgi/man.cgi?query=close_range&sektion=2&n=1

Fixes kern/59081

@ricardobranco777 ricardobranco777 force-pushed the close_rangex branch 4 times, most recently from d97c3eb to c4dbf8c Compare July 19, 2025 19:17
@ricardobranco777
Copy link
Author

Tests passed.

$ cd /usr/tests/lib/libc/gen
$ atf-run t_close_range
...
tp-start: 1752952904.803727, t_close_range, 7
tc-start: 1752952904.803756, close_range_above
tc-end: 1752952904.808162, close_range_above, passed
tc-start: 1752952904.808253, close_range_basic
tc-end: 1752952904.809940, close_range_basic, passed
tc-start: 1752952904.810021, close_range_buffer
tc-end: 1752952904.811619, close_range_buffer, passed
tc-start: 1752952904.811699, close_range_cloexec
tc-end: 1752952904.813614, close_range_cloexec, passed
tc-start: 1752952904.813697, close_range_err
tc-end: 1752952904.815713, close_range_err, passed
tc-start: 1752952904.815836, close_range_invalid_flag
tc-end: 1752952904.817856, close_range_invalid_flag, passed
tc-start: 1752952904.817918, close_range_one
tc-end: 1752952904.819005, close_range_one, passed
tp-end: 1752952904.819145, t_close_range

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.

1 participant