Skip to content

Commit a149c0e

Browse files
Alexander Polakovroot
Alexander Polakov
authored and
root
committed
Add getxattr()/setxattr() variations
1 parent f25765f commit a149c0e

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

libc-test/build.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ fn main() {
114114
cfg.header("linux/netlink.h");
115115
}
116116
cfg.header("sched.h");
117+
cfg.header("attr/xattr.h");
117118
}
118119

119120
if freebsd {

src/unix/notbsd/linux/mod.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,12 @@ extern {
334334
len: ::off_t) -> ::c_int;
335335
pub fn readahead(fd: ::c_int, offset: ::off64_t,
336336
count: ::size_t) -> ::ssize_t;
337+
pub fn getxattr(path: *const c_char, name: *const c_char, value: *mut ::c_void, size: ::size_t) -> ::ssize_t;
338+
pub fn lgetxattr(path: *const c_char, name: *const c_char, value: *mut ::c_void, size: ::size_t) -> ::ssize_t;
339+
pub fn fgetxattr(filedes: ::c_int, name: *const c_char, value: *mut ::c_void, size: ::size_t) -> ::ssize_t;
340+
pub fn setxattr(path: *const c_char, name: *const c_char, value: *const ::c_void, size: ::size_t, flags: ::c_int) -> ::c_int;
341+
pub fn lsetxattr(path: *const c_char, name: *const c_char, value: *const ::c_void, size: ::size_t, flags: ::c_int) -> ::c_int;
342+
pub fn fsetxattr(filedes: ::c_int, name: *const c_char, value: *const ::c_void, size: ::size_t, flags: ::c_int) -> ::c_int;
337343
}
338344

339345
cfg_if! {

0 commit comments

Comments
 (0)