2 * Copyright (C) 2004 <solar@gentoo.org>
3 * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
5 * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
7 /* This file provides the following Extended Attribute system calls to uClibc.
9 * setxattr(), lsetxattr(), fsetxattr(),
10 * getxattr(), lgetxattr(), fgetxattr(),
11 * listxattr(), llistxattr(), flistxattr(),
12 * removexattr(), lremovexattr(), fremovexattr()
14 * Dec 2004 - <solar@gentoo.org>
17 /* Taken from the manpage.
18 * On success, a positive number is returned indicating the size of the
19 * extended attribute name list. On failure, -1 is returned and errno
20 * is set appropriately. If extended attributes are not supported by the
21 * filesystem, or are disabled, errno is set to ENOSYS.
24 #include <sys/syscall.h>
26 #include <sys/xattr.h>
30 _syscall5(int, setxattr, const char *, path, const char *, name,
31 const void *, value, size_t, size, int, flags)
35 _syscall5(int, lsetxattr, const char *, path, const char *, name,
36 const void *, value, size_t, size, int, flags)
40 _syscall5(int, fsetxattr, int, filedes, const char *, name, const void *,
41 value, size_t, size, int, flags)
46 _syscall4(ssize_t, getxattr, const char *, path, const char *, name,
47 void *, value, size_t, size)
51 _syscall4(ssize_t, lgetxattr, const char *, path, const char *, name,
52 void *, value, size_t, size)
56 _syscall4(ssize_t, fgetxattr, int, filedes, const char *, name, void *,
62 _syscall3(ssize_t, listxattr, const char *, path, char *, list, size_t,
66 #ifdef __NR_llistxattr
67 _syscall3(ssize_t, llistxattr, const char *, path, char *, list, size_t,
71 #ifdef __NR_flistxattr
72 _syscall3(ssize_t, flistxattr, int, filedes, char *, list, size_t, size)
76 #ifdef __NR_removexattr
77 _syscall2(int, removexattr, const char *, path, const char *, name)
80 #ifdef __NR_lremovexattr
81 _syscall2(int, lremovexattr, const char *, path, const char *, name)
84 #ifdef __NR_fremovexattr
85 _syscall2(int, fremovexattr, int, filedes, const char *, name)