* Added new library libgnu.so, which will contain GNU compatibility interfaces

(analoguously to libbsd.so).
* Added an implementation of the GNU/Linux xattr interface. xattrs are mapped
  to Haiku attributes with type B_XATTR_TYPE. Haiku attributes are mapped to
  xattrs by moving them into the "user.haiku." namespace and appending the
  type to their name. Complete, but utterly untested yet.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32427 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2009-08-15 21:29:02 +00:00
parent c527fef824
commit 9996b69b8b
4 changed files with 399 additions and 0 deletions
+50
View File
@@ -0,0 +1,50 @@
/*
* Copyright 2009, Haiku Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*
* The GNU/Linux xattr interface. Actual xattrs are identity-mapped into the
* Haiku attribute namespace with type B_XATTR_TYPE. Haiku attributes are mapped
* into a user xattr namespace, the attribute types encoded in the names.
*/
#ifndef _GNU_SYS_CDEFS_H
#define _GNU_SYS_CDEFS_H
#include <sys/cdefs.h>
#include <sys/types.h>
/* constants for [l,f]setxattr() */
#define XATTR_CREATE 1 /* fail if attribute exists */
#define XATTR_REPLACE 2 /* fail if attribute doesn't exist yet */
__BEGIN_DECLS
ssize_t getxattr(const char* path, const char* attribute, void* buffer,
size_t size);
ssize_t lgetxattr(const char* path, const char* attribute, void* buffer,
size_t size);
ssize_t fgetxattr(int fd, const char* attribute, void* buffer, size_t size);
int setxattr(const char* path, const char* attribute, const void* buffer,
size_t size, int flags);
int lsetxattr(const char* path, const char* attribute, const void* buffer,
size_t size, int flags);
int fsetxattr(int fd, const char* attribute, const void* buffer,
size_t size, int flags);
int removexattr (const char* path, const char* attribute);
int lremovexattr (const char* path, const char* attribute);
int fremovexattr (int fd, const char* attribute);
ssize_t listxattr(const char* path, char* buffer, size_t size);
ssize_t llistxattr(const char* path, char* buffer, size_t size);
ssize_t flistxattr(int fd, char* buffer, size_t size);
__END_DECLS
#endif /* _GNU_SYS_CDEFS_H */