xattr.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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. #include <features.h>
  23. #include <errno.h>
  24. #ifndef ENOATTR
  25. # define ENOATTR ENODATA /* No such attribute */
  26. #endif
  27. #define XATTR_CREATE 0x1 /* set value, fail if attr already exists */
  28. #define XATTR_REPLACE 0x2 /* set value, fail if attr does not exist */
  29. #ifndef __THROW
  30. # ifndef __GNUC_PREREQ
  31. # define __GNUC_PREREQ(maj, min) (0)
  32. # endif
  33. # if defined __cplusplus && __GNUC_PREREQ (2,8)
  34. # define __THROW throw ()
  35. # else
  36. # define __THROW
  37. # endif
  38. #endif
  39. #ifdef __cplusplus
  40. extern "C" {
  41. #endif
  42. extern int setxattr (const char *__path, const char *__name,
  43. const void *__value, size_t __size, int __flags) __THROW;
  44. extern int lsetxattr (const char *__path, const char *__name,
  45. const void *__value, size_t __size, int __flags) __THROW;
  46. extern int fsetxattr (int __filedes, const char *__name,
  47. const void *__value, size_t __size, int __flags) __THROW;
  48. extern ssize_t getxattr (const char *__path, const char *__name,
  49. void *__value, size_t __size) __THROW;
  50. extern ssize_t lgetxattr (const char *__path, const char *__name,
  51. void *__value, size_t __size) __THROW;
  52. extern ssize_t fgetxattr (int __filedes, const char *__name,
  53. void *__value, size_t __size) __THROW;
  54. extern ssize_t listxattr (const char *__path, char *__list,
  55. size_t __size) __THROW;
  56. extern ssize_t llistxattr (const char *__path, char *__list,
  57. size_t __size) __THROW;
  58. extern ssize_t flistxattr (int __filedes, char *__list,
  59. size_t __size) __THROW;
  60. extern int removexattr (const char *__path, const char *__name) __THROW;
  61. extern int lremovexattr (const char *__path, const char *__name) __THROW;
  62. extern int fremovexattr (int __filedes, const char *__name) __THROW;
  63. #ifdef __cplusplus
  64. }
  65. #endif
  66. #endif /* __XATTR_H__ */