Add getxattr()/setxattr()/listxattr()/removexattr() variations

This commit is contained in:
Alexander Polakov 2015-12-01 15:29:05 +03:00 committed by root
parent 6a13db97fb
commit 30baed0f7e
2 changed files with 28 additions and 0 deletions

View File

@ -109,6 +109,10 @@ fn main() {
}
}
if linux {
cfg.header("sys/xattr.h");
}
if linux || android {
cfg.header("netpacket/packet.h");
cfg.header("net/ethernet.h");

View File

@ -334,6 +334,30 @@ extern {
len: ::off_t) -> ::c_int;
pub fn readahead(fd: ::c_int, offset: ::off64_t,
count: ::size_t) -> ::ssize_t;
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,
flags: ::c_int) -> ::c_int;
pub fn lsetxattr(path: *const c_char, name: *const c_char,
value: *const ::c_void, size: ::size_t,
flags: ::c_int) -> ::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(filedes: ::c_int, name: *const c_char) -> ::c_int;
}
cfg_if! {