1 /* 2 * Copyright (c) 2001-2002 Silicon Graphics, Inc. 3 * All Rights Reserved. 4 * 5 * This program is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU Lesser General Public License as published by 7 * the Free Software Foundation; either version 2.1 of the License, or (at 8 * your option) any later version. 9 * 10 * This program is distributed in the hope that it will be useful, but WITHOUT 11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public 13 * License for more details. 14 * 15 * You should have received a copy of the GNU Lesser General Public 16 * License along with this program. If not, see 17 * <http://www.gnu.org/licenses/>. 18 * 19 */ 20 #ifndef __XATTR_H__ 21 #define __XATTR_H__ 22 23 #include <features.h> 24 25 #include <errno.h> 26 #ifndef ENOATTR 27 # define ENOATTR ENODATA /* No such attribute */ 28 #endif 29 30 #define XATTR_CREATE 0x1 /* set value, fail if attr already exists */ 31 #define XATTR_REPLACE 0x2 /* set value, fail if attr does not exist */ 32 33 34 __BEGIN_DECLS 35 36 extern int setxattr (const char *__path, const char *__name, 37 const void *__value, size_t __size, int __flags) __THROW; 38 extern int lsetxattr (const char *__path, const char *__name, 39 const void *__value, size_t __size, int __flags) __THROW; 40 extern int fsetxattr (int __filedes, const char *__name, 41 const void *__value, size_t __size, int __flags) __THROW; 42 43 extern ssize_t getxattr (const char *__path, const char *__name, 44 void *__value, size_t __size) __THROW; 45 extern ssize_t lgetxattr (const char *__path, const char *__name, 46 void *__value, size_t __size) __THROW; 47 extern ssize_t fgetxattr (int __filedes, const char *__name, 48 void *__value, size_t __size) __THROW; 49 50 extern ssize_t listxattr (const char *__path, char *__list, 51 size_t __size) __THROW; 52 extern ssize_t llistxattr (const char *__path, char *__list, 53 size_t __size) __THROW; 54 extern ssize_t flistxattr (int __filedes, char *__list, 55 size_t __size) __THROW; 56 57 extern int removexattr (const char *__path, const char *__name) __THROW; 58 extern int lremovexattr (const char *__path, const char *__name) __THROW; 59 extern int fremovexattr (int __filedes, const char *__name) __THROW; 60 61 __END_DECLS 62 63 #endif /* __XATTR_H__ */ 64