2 * Copyright 2009, Haiku Inc. All Rights Reserved.
3 * Distributed under the terms of the MIT License.
5 * The GNU/Linux xattr interface. Actual xattrs are identity-mapped into the
6 * Haiku attribute namespace with type B_XATTR_TYPE. Haiku attributes are mapped
7 * into a user xattr namespace, the attribute types encoded in the names.
9 #ifndef _GNU_SYS_CDEFS_H
10 #define _GNU_SYS_CDEFS_H
13 #include <sys/cdefs.h>
14 #include <sys/types.h>
17 /* constants for [l,f]setxattr() */
18 #define XATTR_CREATE 1 /* fail if attribute exists */
19 #define XATTR_REPLACE 2 /* fail if attribute doesn't exist yet */
25 ssize_t
getxattr(const char* path
, const char* attribute
, void* buffer
,
27 ssize_t
lgetxattr(const char* path
, const char* attribute
, void* buffer
,
29 ssize_t
fgetxattr(int fd
, const char* attribute
, void* buffer
, size_t size
);
31 int setxattr(const char* path
, const char* attribute
, const void* buffer
,
32 size_t size
, int flags
);
33 int lsetxattr(const char* path
, const char* attribute
, const void* buffer
,
34 size_t size
, int flags
);
35 int fsetxattr(int fd
, const char* attribute
, const void* buffer
,
36 size_t size
, int flags
);
38 int removexattr (const char* path
, const char* attribute
);
39 int lremovexattr (const char* path
, const char* attribute
);
40 int fremovexattr (int fd
, const char* attribute
);
42 ssize_t
listxattr(const char* path
, char* buffer
, size_t size
);
43 ssize_t
llistxattr(const char* path
, char* buffer
, size_t size
);
44 ssize_t
flistxattr(int fd
, char* buffer
, size_t size
);
50 #endif /* _GNU_SYS_CDEFS_H */