Skip to content

Commit 422616b

Browse files
committed
Auto merge of #3374 - SteveLauC:close_range-closefrom-FreeBSD, r=JohnTitor
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)
2 parents d80e8bd + 02d78dc commit 422616b

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

libc-test/semver/freebsd.txt

+2
Original file line numberDiff line numberDiff line change
@@ -2237,3 +2237,5 @@ xucred
22372237
eaccess
22382238
dirname
22392239
basename
2240+
closefrom
2241+
close_range

src/unix/bsd/freebsdlike/freebsd/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -5422,6 +5422,8 @@ extern "C" {
54225422
new_value: *const itimerspec,
54235423
old_value: *mut itimerspec,
54245424
) -> ::c_int;
5425+
pub fn closefrom(lowfd: ::c_int);
5426+
pub fn close_range(lowfd: ::c_uint, highfd: ::c_uint, flags: ::c_int) -> ::c_int;
54255427
}
54265428

54275429
#[link(name = "memstat")]

0 commit comments

Comments
 (0)