From 6e94888765d0efe1bfd9e9a976bcb42bf5c7eb87 Mon Sep 17 00:00:00 2001 From: David Carlier Date: Fri, 5 Nov 2021 12:05:57 +0000 Subject: [PATCH] netbsd ext attrs api addition --- libc-test/semver/netbsd.txt | 12 ++++++++ src/unix/bsd/netbsdlike/netbsd/mod.rs | 44 +++++++++++++++++++++++++++ 2 files changed, 56 insertions(+) diff --git a/libc-test/semver/netbsd.txt b/libc-test/semver/netbsd.txt index b58ddd4e06d3c..fe6b5bf86adc4 100644 --- a/libc-test/semver/netbsd.txt +++ b/libc-test/semver/netbsd.txt @@ -1165,6 +1165,10 @@ fchdir fchflags fdatasync fdopendir +fgetxattr +flistxattr +fremovexattr +fsetxattr flags_to_string fmemopen forkpty @@ -1210,6 +1214,7 @@ getutmpx getutxent getutxid getutxline +getxattr glob glob_t globfree @@ -1240,7 +1245,10 @@ labs lastlog lastlogx lchflags +lgetxattr lio_listio +listxattr +llistxaatr localeconv_l lockf login @@ -1250,6 +1258,8 @@ logoutx logwtmp logwtmpx login_tty +lremovexattr +lsetxattr lutimes lwpid_t madvise @@ -1361,6 +1371,7 @@ regexec regfree regmatch_t regoff_t +removexattr sched_getparam sched_getscheduler sched_get_priority_max @@ -1395,6 +1406,7 @@ setservent settimeofday setutent setutxent +setxattr shmat shmatt_t shmctl diff --git a/src/unix/bsd/netbsdlike/netbsd/mod.rs b/src/unix/bsd/netbsdlike/netbsd/mod.rs index 678402f4a859a..da08473ea8192 100644 --- a/src/unix/bsd/netbsdlike/netbsd/mod.rs +++ b/src/unix/bsd/netbsdlike/netbsd/mod.rs @@ -2620,6 +2620,50 @@ extern "C" { tpe: ::c_int, ); + pub fn getxattr( + path: *const ::c_char, + name: *const ::c_char, + value: *mut ::c_void, + size: ::size_t, + ) -> ::ssize_t; + pub fn lgetxattr( + path: *const ::c_char, + name: *const ::c_char, + value: *mut ::c_void, + size: ::size_t, + ) -> ::ssize_t; + pub fn fgetxattr( + filedes: ::c_int, + name: *const ::c_char, + value: *mut ::c_void, + size: ::size_t, + ) -> ::ssize_t; + pub fn setxattr( + path: *const ::c_char, + name: *const ::c_char, + value: *const ::c_void, + size: ::size_t, + ) -> ::c_int; + pub fn lsetxattr( + path: *const ::c_char, + name: *const ::c_char, + value: *const ::c_void, + size: ::size_t, + ) -> ::c_int; + pub fn fsetxattr( + filedes: ::c_int, + name: *const ::c_char, + value: *const ::c_void, + size: ::size_t, + flags: ::c_int, + ) -> ::c_int; + pub fn listxattr(path: *const ::c_char, list: *mut ::c_char, size: ::size_t) -> ::ssize_t; + pub fn llistxattr(path: *const ::c_char, list: *mut ::c_char, size: ::size_t) -> ::ssize_t; + pub fn flistxattr(filedes: ::c_int, list: *mut ::c_char, size: ::size_t) -> ::ssize_t; + pub fn removexattr(path: *const ::c_char, name: *const ::c_char) -> ::c_int; + pub fn lremovexattr(path: *const ::c_char, name: *const ::c_char) -> ::c_int; + pub fn fremovexattr(fd: ::c_int, path: *const ::c_char, name: *const ::c_char) -> ::c_int; + pub fn string_to_flags( string_p: *mut *mut ::c_char, setp: *mut ::c_ulong,