2 * Copyright 2008, Ingo Weinhold, ingo_weinhold@gmx.de.
3 * Distributed under the terms of the MIT License.
5 #ifndef FS_ATTR_BSDXATTR_H
6 #define FS_ATTR_BSDXATTR_H
8 /*! Included by fs_attr_untyped.cpp. Interfaces with BSD xattr support.
12 #include <sys/xattr.h>
15 // the namespace all attributes live in
16 static const char* kAttributeNamespace
= "user.haiku.";
17 static const int kAttributeNamespaceLen
= 11;
21 list_attributes(int fd
, const char* path
, char* buffer
, size_t bufferSize
)
24 return flistxattr(fd
, buffer
, bufferSize
, 0);
25 return listxattr(path
, buffer
, bufferSize
, XATTR_NOFOLLOW
);
30 get_attribute(int fd
, const char* path
, const char* attribute
, void* buffer
,
34 return fgetxattr(fd
, attribute
, buffer
, bufferSize
, 0, 0);
35 return getxattr(path
, attribute
, buffer
, bufferSize
, 0, XATTR_NOFOLLOW
);
40 set_attribute(int fd
, const char* path
, const char* attribute
,
41 const void* buffer
, size_t bufferSize
)
44 return fsetxattr(fd
, attribute
, buffer
, bufferSize
, 0, 0);
45 return setxattr(path
, attribute
, buffer
, bufferSize
, 0, XATTR_NOFOLLOW
);
50 remove_attribute(int fd
, const char* path
, const char* attribute
)
53 return fremovexattr(fd
, attribute
, 0);
54 return removexattr(path
, attribute
, XATTR_NOFOLLOW
);
58 #endif // FS_ATTR_BSDXATTR_H