]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/l4re-core/uclibc/lib/contrib/uclibc/libc/sysdeps/linux/common/xattr.c
Update
[l4.git] / l4 / pkg / l4re-core / uclibc / lib / contrib / uclibc / libc / sysdeps / linux / common / xattr.c
1 /*
2  * Copyright (C) 2004 <solar@gentoo.org>
3  * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
4  *
5  * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
6  */
7 /* This file provides the following Extended Attribute system calls to uClibc.
8  *
9  *      setxattr(), lsetxattr(), fsetxattr(),
10  *      getxattr(), lgetxattr(), fgetxattr(),
11  *      listxattr(), llistxattr(), flistxattr(),
12  *      removexattr(), lremovexattr(), fremovexattr()
13  *
14  * Dec 2004 - <solar@gentoo.org>
15  */
16
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.
22  */
23
24 #include <sys/syscall.h>
25 #include <unistd.h>
26 #include <sys/xattr.h>
27
28 /* sets */
29 #ifdef __NR_setxattr
30 _syscall5(int, setxattr, const char *, path, const char *, name,
31         const void *, value, size_t, size, int, flags)
32 #endif
33
34 #ifdef __NR_lsetxattr
35 _syscall5(int, lsetxattr, const char *, path, const char *, name,
36         const void *, value, size_t, size, int, flags)
37 #endif
38
39 #ifdef __NR_fsetxattr
40 _syscall5(int, fsetxattr, int, filedes, const char *, name, const void *,
41         value, size_t, size, int, flags)
42 #endif
43
44 /* gets */
45 #ifdef __NR_getxattr
46 _syscall4(ssize_t, getxattr, const char *, path, const char *, name,
47         void *, value, size_t, size)
48 #endif
49
50 #ifdef __NR_lgetxattr
51 _syscall4(ssize_t, lgetxattr, const char *, path, const char *, name,
52         void *, value, size_t, size)
53 #endif
54
55 #ifdef __NR_fgetxattr
56 _syscall4(ssize_t, fgetxattr, int, filedes, const char *, name, void *,
57         value, size_t, size)
58 #endif
59
60 /* list */
61 #ifdef __NR_listxattr
62 _syscall3(ssize_t, listxattr, const char *, path, char *, list, size_t,
63         size)
64 #endif
65
66 #ifdef __NR_llistxattr
67 _syscall3(ssize_t, llistxattr, const char *, path, char *, list, size_t,
68         size)
69 #endif
70
71 #ifdef __NR_flistxattr
72 _syscall3(ssize_t, flistxattr, int, filedes, char *, list, size_t, size)
73 #endif
74
75 /* remove */
76 #ifdef __NR_removexattr
77 _syscall2(int, removexattr, const char *, path, const char *, name)
78 #endif
79
80 #ifdef __NR_lremovexattr
81 _syscall2(int, lremovexattr, const char *, path, const char *, name)
82 #endif
83
84 #ifdef __NR_fremovexattr
85 _syscall2(int, fremovexattr, int, filedes, const char *, name)
86 #endif