Skip to content

Commit

Permalink
Auto merge of #3374 - SteveLauC:close_range-closefrom-FreeBSD, r=John…
Browse files Browse the repository at this point in the history
…Titor

feat: closefrom() and close_range() for FreeBSD

This PR

1. add `closefrom()` for all the FreeBSD versions since this is available since FreeBSD 8.0
2. add `close_range()` for FreeBSD 13/14

    `close_range()` seems to be available since FreeBSD 12.2, so I am not sure what we should do about FreeBSD 12 here :<

Ref:

* [Man page for `closefrom()` on FreeBSD 11](https://man.freebsd.org/cgi/man.cgi?query=closefrom&apropos=0&sektion=2&manpath=FreeBSD+11.4-RELEASE+and+Ports&arch=default&format=html)
* [Man page for `close_range()` on FreeBSD 12.2 RELEASE](https://man.freebsd.org/cgi/man.cgi?query=close_range&apropos=0&sektion=2&manpath=FreeBSD+12.2-RELEASE&arch=default&format=html)
  • Loading branch information
bors committed Oct 7, 2023
2 parents d80e8bd + 02d78dc commit 422616b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions libc-test/semver/freebsd.txt
Expand Up @@ -2237,3 +2237,5 @@ xucred
eaccess
dirname
basename
closefrom
close_range
2 changes: 2 additions & 0 deletions src/unix/bsd/freebsdlike/freebsd/mod.rs
Expand Up @@ -5422,6 +5422,8 @@ extern "C" {
new_value: *const itimerspec,
old_value: *mut itimerspec,
) -> ::c_int;
pub fn closefrom(lowfd: ::c_int);
pub fn close_range(lowfd: ::c_uint, highfd: ::c_uint, flags: ::c_int) -> ::c_int;
}

#[link(name = "memstat")]
Expand Down

0 comments on commit 422616b

Please sign in to comment.