Skip to content

Commit

Permalink
netbsd ext attrs api addition
Browse files Browse the repository at this point in the history
  • Loading branch information
devnexen committed Nov 5, 2021
1 parent 2638ea2 commit 6e94888
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
12 changes: 12 additions & 0 deletions libc-test/semver/netbsd.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1165,6 +1165,10 @@ fchdir
fchflags
fdatasync
fdopendir
fgetxattr
flistxattr
fremovexattr
fsetxattr
flags_to_string
fmemopen
forkpty
Expand Down Expand Up @@ -1210,6 +1214,7 @@ getutmpx
getutxent
getutxid
getutxline
getxattr
glob
glob_t
globfree
Expand Down Expand Up @@ -1240,7 +1245,10 @@ labs
lastlog
lastlogx
lchflags
lgetxattr
lio_listio
listxattr
llistxaatr
localeconv_l
lockf
login
Expand All @@ -1250,6 +1258,8 @@ logoutx
logwtmp
logwtmpx
login_tty
lremovexattr
lsetxattr
lutimes
lwpid_t
madvise
Expand Down Expand Up @@ -1361,6 +1371,7 @@ regexec
regfree
regmatch_t
regoff_t
removexattr
sched_getparam
sched_getscheduler
sched_get_priority_max
Expand Down Expand Up @@ -1395,6 +1406,7 @@ setservent
settimeofday
setutent
setutxent
setxattr
shmat
shmatt_t
shmctl
Expand Down
44 changes: 44 additions & 0 deletions src/unix/bsd/netbsdlike/netbsd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 6e94888

Please sign in to comment.