Skip to content

Commit cfb68f4

Browse files
committed
Auto merge of #2947 - SteveLauC:euidaccess-and-eaccess, r=JohnTitor
add euidaccess and eaccess on gnu/musl linux [man page for these two functions](https://man7.org/linux/man-pages/man3/euidaccess.3.html) `uClibc` does not support them, so these two functions can not be put in `linux/mod.rs`.
2 parents 96c85c1 + e01c428 commit cfb68f4

File tree

4 files changed

+10
-0
lines changed

4 files changed

+10
-0
lines changed

libc-test/semver/linux-gnu.txt

+2
Original file line numberDiff line numberDiff line change
@@ -649,3 +649,5 @@ timex
649649
utmpname
650650
utmpx
651651
utmpxname
652+
euidaccess
653+
eaccess

libc-test/semver/linux-musl.txt

+2
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,5 @@ process_vm_writev
4848
pwritev64
4949
reallocarray
5050
timex
51+
euidaccess
52+
eaccess

src/unix/linux_like/linux/gnu/mod.rs

+3
Original file line numberDiff line numberDiff line change
@@ -1329,6 +1329,9 @@ extern "C" {
13291329

13301330
pub fn memfd_create(name: *const ::c_char, flags: ::c_uint) -> ::c_int;
13311331
pub fn mlock2(addr: *const ::c_void, len: ::size_t, flags: ::c_uint) -> ::c_int;
1332+
1333+
pub fn euidaccess(pathname: *const ::c_char, mode: ::c_int) -> ::c_int;
1334+
pub fn eaccess(pathname: *const ::c_char, mode: ::c_int) -> ::c_int;
13321335
}
13331336

13341337
extern "C" {

src/unix/linux_like/linux/musl/mod.rs

+3
Original file line numberDiff line numberDiff line change
@@ -754,6 +754,9 @@ extern "C" {
754754
pub fn memfd_create(name: *const ::c_char, flags: ::c_uint) -> ::c_int;
755755
pub fn mlock2(addr: *const ::c_void, len: ::size_t, flags: ::c_uint) -> ::c_int;
756756
pub fn malloc_usable_size(ptr: *mut ::c_void) -> ::size_t;
757+
758+
pub fn euidaccess(pathname: *const ::c_char, mode: ::c_int) -> ::c_int;
759+
pub fn eaccess(pathname: *const ::c_char, mode: ::c_int) -> ::c_int;
757760
}
758761

759762
cfg_if! {

0 commit comments

Comments
 (0)