1/* 2 * Copyright 2009, Haiku Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 * 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. 8 */ 9#ifndef _GNU_SYS_CDEFS_H 10#define _GNU_SYS_CDEFS_H 11 12 13#include <sys/cdefs.h> 14#include <sys/types.h> 15 16 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 */ 20 21 22__BEGIN_DECLS 23 24 25ssize_t getxattr(const char* path, const char* attribute, void* buffer, 26 size_t size); 27ssize_t lgetxattr(const char* path, const char* attribute, void* buffer, 28 size_t size); 29ssize_t fgetxattr(int fd, const char* attribute, void* buffer, size_t size); 30 31int setxattr(const char* path, const char* attribute, const void* buffer, 32 size_t size, int flags); 33int lsetxattr(const char* path, const char* attribute, const void* buffer, 34 size_t size, int flags); 35int fsetxattr(int fd, const char* attribute, const void* buffer, 36 size_t size, int flags); 37 38int removexattr (const char* path, const char* attribute); 39int lremovexattr (const char* path, const char* attribute); 40int fremovexattr (int fd, const char* attribute); 41 42ssize_t listxattr(const char* path, char* buffer, size_t size); 43ssize_t llistxattr(const char* path, char* buffer, size_t size); 44ssize_t flistxattr(int fd, char* buffer, size_t size); 45 46 47__END_DECLS 48 49 50#endif /* _GNU_SYS_CDEFS_H */ 51