Skip to content

Commit

Permalink
feat: add close_range for glibc
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveLauC committed Oct 6, 2023
1 parent c7a860d commit 173757d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions libc-test/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3378,6 +3378,7 @@ fn test_linux(target: &str) {
"sys/fanotify.h",
// <sys/auxv.h> is not present on uclibc
[!uclibc]: "sys/auxv.h",
[gnu]: "linux/close_range.h",
}

// note: aio.h must be included before sys/mount.h
Expand Down
1 change: 1 addition & 0 deletions libc-test/semver/linux-gnu.txt
Original file line number Diff line number Diff line change
Expand Up @@ -665,3 +665,4 @@ getmntent_r
putpwent
putgrent
execveat
close_range
7 changes: 7 additions & 0 deletions src/unix/linux_like/linux/gnu/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1399,6 +1399,13 @@ extern "C" {
envp: *const *mut c_char,
flags: ::c_int,
) -> ::c_int;

// Added in `glibc` 2.34
pub fn close_range(
first: ::c_uint,
last: ::c_uint,
flags: ::c_int,
) -> ::c_int;
}

cfg_if! {
Expand Down

0 comments on commit 173757d

Please sign in to comment.