]> git.ipfire.org Git - thirdparty/glibc.git/blame - misc/sys/xattr.h
Update copyright notices with scripts/update-copyrights
[thirdparty/glibc.git] / misc / sys / xattr.h
CommitLineData
d4697bc9 1/* Copyright (C) 2002-2014 Free Software Foundation, Inc.
c0ad824e
AJ
2 This file is part of the GNU C Library.
3
4 The GNU C Library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Lesser General Public
6 License as published by the Free Software Foundation; either
7 version 2.1 of the License, or (at your option) any later version.
8
9 The GNU C Library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Lesser General Public License for more details.
13
14 You should have received a copy of the GNU Lesser General Public
59ba27a6
PE
15 License along with the GNU C Library; if not, see
16 <http://www.gnu.org/licenses/>. */
c0ad824e
AJ
17
18#ifndef _SYS_XATTR_H
19#define _SYS_XATTR_H 1
20
21#include <features.h>
7daaea8b 22#include <sys/types.h>
c0ad824e
AJ
23
24
c0ad824e
AJ
25__BEGIN_DECLS
26
27/* The following constants should be used for the fifth parameter of
28 `*setxattr'. */
29enum
30{
31 XATTR_CREATE = 1, /* set value, fail if attr already exists. */
32#define XATTR_CREATE XATTR_CREATE
33 XATTR_REPLACE = 2 /* set value, fail if attr does not exist. */
34#define XATTR_REPLACE XATTR_REPLACE
35};
36
37/* Set the attribute NAME of the file pointed to by PATH to VALUE (which
38 is SIZE bytes long). Return 0 on success, -1 for errors. */
a784e502
UD
39extern int setxattr (const char *__path, const char *__name,
40 const void *__value, size_t __size, int __flags)
c0ad824e
AJ
41 __THROW;
42
43/* Set the attribute NAME of the file pointed to by PATH to VALUE (which is
44 SIZE bytes long), not following symlinks for the last pathname component.
45 Return 0 on success, -1 for errors. */
a784e502
UD
46extern int lsetxattr (const char *__path, const char *__name,
47 const void *__value, size_t __size, int __flags)
c0ad824e
AJ
48 __THROW;
49
50/* Set the attribute NAME of the file descriptor FD to VALUE (which is SIZE
51 bytes long). Return 0 on success, -1 for errors. */
a784e502 52extern int fsetxattr (int __fd, const char *__name, const void *__value,
c0ad824e
AJ
53 size_t __size, int __flags) __THROW;
54
55/* Get the attribute NAME of the file pointed to by PATH to VALUE (which is
56 SIZE bytes long). Return 0 on success, -1 for errors. */
a784e502 57extern ssize_t getxattr (const char *__path, const char *__name,
c0ad824e
AJ
58 void *__value, size_t __size) __THROW;
59
60/* Get the attribute NAME of the file pointed to by PATH to VALUE (which is
61 SIZE bytes long), not following symlinks for the last pathname component.
62 Return 0 on success, -1 for errors. */
a784e502 63extern ssize_t lgetxattr (const char *__path, const char *__name,
c0ad824e
AJ
64 void *__value, size_t __size) __THROW;
65
66/* Get the attribute NAME of the file descriptor FD to VALUE (which is SIZE
67 bytes long). Return 0 on success, -1 for errors. */
a784e502 68extern ssize_t fgetxattr (int __fd, const char *__name, void *__value,
c0ad824e
AJ
69 size_t __size) __THROW;
70
71/* List attributes of the file pointed to by PATH into the user-supplied
72 buffer LIST (which is SIZE bytes big). Return 0 on success, -1 for
73 errors. */
a784e502 74extern ssize_t listxattr (const char *__path, char *__list, size_t __size)
c0ad824e
AJ
75 __THROW;
76
77/* List attributes of the file pointed to by PATH into the user-supplied
78 buffer LIST (which is SIZE bytes big), not following symlinks for the
79 last pathname component. Return 0 on success, -1 for errors. */
a784e502 80extern ssize_t llistxattr (const char *__path, char *__list, size_t __size)
c0ad824e
AJ
81 __THROW;
82
83/* List attributes of the file descriptor FD into the user-supplied buffer
84 LIST (which is SIZE bytes big). Return 0 on success, -1 for errors. */
85extern ssize_t flistxattr (int __fd, char *__list, size_t __size)
86 __THROW;
87
88/* Remove the attribute NAME from the file pointed to by PATH. Return 0
89 on success, -1 for errors. */
a784e502 90extern int removexattr (const char *__path, const char *__name) __THROW;
c0ad824e
AJ
91
92/* Remove the attribute NAME from the file pointed to by PATH, not
93 following symlinks for the last pathname component. Return 0 on
94 success, -1 for errors. */
a784e502 95extern int lremovexattr (const char *__path, const char *__name) __THROW;
c0ad824e
AJ
96
97/* Remove the attribute NAME from the file descriptor FD. Return 0 on
98 success, -1 for errors. */
a784e502 99extern int fremovexattr (int __fd, const char *__name) __THROW;
c0ad824e
AJ
100
101__END_DECLS
102
103#endif /* sys/xattr.h */