Skip to content

Commit

Permalink
Auto merge of #2947 - SteveLauC:euidaccess-and-eaccess, r=JohnTitor
Browse files Browse the repository at this point in the history
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`.
  • Loading branch information
bors committed Oct 9, 2022
2 parents 96c85c1 + e01c428 commit cfb68f4
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions libc-test/semver/linux-gnu.txt
Expand Up @@ -649,3 +649,5 @@ timex
utmpname
utmpx
utmpxname
euidaccess
eaccess
2 changes: 2 additions & 0 deletions libc-test/semver/linux-musl.txt
Expand Up @@ -48,3 +48,5 @@ process_vm_writev
pwritev64
reallocarray
timex
euidaccess
eaccess
3 changes: 3 additions & 0 deletions src/unix/linux_like/linux/gnu/mod.rs
Expand Up @@ -1329,6 +1329,9 @@ extern "C" {

pub fn memfd_create(name: *const ::c_char, flags: ::c_uint) -> ::c_int;
pub fn mlock2(addr: *const ::c_void, len: ::size_t, flags: ::c_uint) -> ::c_int;

pub fn euidaccess(pathname: *const ::c_char, mode: ::c_int) -> ::c_int;
pub fn eaccess(pathname: *const ::c_char, mode: ::c_int) -> ::c_int;
}

extern "C" {
Expand Down
3 changes: 3 additions & 0 deletions src/unix/linux_like/linux/musl/mod.rs
Expand Up @@ -754,6 +754,9 @@ extern "C" {
pub fn memfd_create(name: *const ::c_char, flags: ::c_uint) -> ::c_int;
pub fn mlock2(addr: *const ::c_void, len: ::size_t, flags: ::c_uint) -> ::c_int;
pub fn malloc_usable_size(ptr: *mut ::c_void) -> ::size_t;

pub fn euidaccess(pathname: *const ::c_char, mode: ::c_int) -> ::c_int;
pub fn eaccess(pathname: *const ::c_char, mode: ::c_int) -> ::c_int;
}

cfg_if! {
Expand Down

0 comments on commit cfb68f4

Please sign in to comment.