Skip to content
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

Add close_range() system call #43

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

Conversation

ricardobranco777
Copy link

@ricardobranco777 ricardobranco777 commented Feb 16, 2025

Adapt existing code in compat_linux for close_range and make it use the new native system call.

The existing test code for closefrom(3) was adapted and extended for close_range(2).

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

CLOSE_RANGE_UNSHARE was removed as it doesn't make sense on NetBSD which lacks unshare(2). From the Linux documentation:

       CLOSE_RANGE_UNSHARE is conceptually equivalent to
           unshare(CLONE_FILES);
           close_range(first, last, 0);

@ricardobranco777 ricardobranco777 force-pushed the close_range branch 5 times, most recently from 9c2c2ee to b118f47 Compare February 16, 2025 20:20
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