Blame misc/sys/xattr.h

Packit 6c4009
/* Copyright (C) 2002-2018 Free Software Foundation, Inc.
Packit 6c4009
   This file is part of the GNU C Library.
Packit 6c4009
Packit 6c4009
   The GNU C Library is free software; you can redistribute it and/or
Packit 6c4009
   modify it under the terms of the GNU Lesser General Public
Packit 6c4009
   License as published by the Free Software Foundation; either
Packit 6c4009
   version 2.1 of the License, or (at your option) any later version.
Packit 6c4009
Packit 6c4009
   The GNU C Library is distributed in the hope that it will be useful,
Packit 6c4009
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 6c4009
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 6c4009
   Lesser General Public License for more details.
Packit 6c4009
Packit 6c4009
   You should have received a copy of the GNU Lesser General Public
Packit 6c4009
   License along with the GNU C Library; if not, see
Packit 6c4009
   <http://www.gnu.org/licenses/>.  */
Packit 6c4009
Packit 6c4009
#ifndef _SYS_XATTR_H
Packit 6c4009
#define _SYS_XATTR_H	1
Packit 6c4009
Packit 6c4009
#include <features.h>
Packit 6c4009
#include <sys/types.h>
Packit 6c4009
Packit 6c4009
Packit 6c4009
__BEGIN_DECLS
Packit 6c4009
Packit 6c4009
/* The following constants should be used for the fifth parameter of
Packit 6c4009
   `*setxattr'.  */
Packit 6c4009
#ifndef __USE_KERNEL_XATTR_DEFS
Packit 6c4009
enum
Packit 6c4009
{
Packit 6c4009
  XATTR_CREATE = 1,	/* set value, fail if attr already exists.  */
Packit 6c4009
#define XATTR_CREATE	XATTR_CREATE
Packit 6c4009
  XATTR_REPLACE = 2	/* set value, fail if attr does not exist.  */
Packit 6c4009
#define XATTR_REPLACE	XATTR_REPLACE
Packit 6c4009
};
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
/* Set the attribute NAME of the file pointed to by PATH to VALUE (which
Packit 6c4009
   is SIZE bytes long).  Return 0 on success, -1 for errors.  */
Packit 6c4009
extern int setxattr (const char *__path, const char *__name,
Packit 6c4009
		     const void *__value, size_t __size, int __flags)
Packit 6c4009
	__THROW;
Packit 6c4009
Packit 6c4009
/* Set the attribute NAME of the file pointed to by PATH to VALUE (which is
Packit 6c4009
   SIZE bytes long), not following symlinks for the last pathname component.
Packit 6c4009
   Return 0 on success, -1 for errors.  */
Packit 6c4009
extern int lsetxattr (const char *__path, const char *__name,
Packit 6c4009
		      const void *__value, size_t __size, int __flags)
Packit 6c4009
	__THROW;
Packit 6c4009
Packit 6c4009
/* Set the attribute NAME of the file descriptor FD to VALUE (which is SIZE
Packit 6c4009
   bytes long).  Return 0 on success, -1 for errors.  */
Packit 6c4009
extern int fsetxattr (int __fd, const char *__name, const void *__value,
Packit 6c4009
		      size_t __size, int __flags) __THROW;
Packit 6c4009
Packit 6c4009
/* Get the attribute NAME of the file pointed to by PATH to VALUE (which is
Packit 6c4009
   SIZE bytes long).  Return 0 on success, -1 for errors.  */
Packit 6c4009
extern ssize_t getxattr (const char *__path, const char *__name,
Packit 6c4009
			 void *__value, size_t __size) __THROW;
Packit 6c4009
Packit 6c4009
/* Get the attribute NAME of the file pointed to by PATH to VALUE (which is
Packit 6c4009
   SIZE bytes long), not following symlinks for the last pathname component.
Packit 6c4009
   Return 0 on success, -1 for errors.  */
Packit 6c4009
extern ssize_t lgetxattr (const char *__path, const char *__name,
Packit 6c4009
			  void *__value, size_t __size) __THROW;
Packit 6c4009
Packit 6c4009
/* Get the attribute NAME of the file descriptor FD to VALUE (which is SIZE
Packit 6c4009
   bytes long).  Return 0 on success, -1 for errors.  */
Packit 6c4009
extern ssize_t fgetxattr (int __fd, const char *__name, void *__value,
Packit 6c4009
			  size_t __size) __THROW;
Packit 6c4009
Packit 6c4009
/* List attributes of the file pointed to by PATH into the user-supplied
Packit 6c4009
   buffer LIST (which is SIZE bytes big).  Return 0 on success, -1 for
Packit 6c4009
   errors.  */
Packit 6c4009
extern ssize_t listxattr (const char *__path, char *__list, size_t __size)
Packit 6c4009
	__THROW;
Packit 6c4009
Packit 6c4009
/* List attributes of the file pointed to by PATH into the user-supplied
Packit 6c4009
   buffer LIST (which is SIZE bytes big), not following symlinks for the
Packit 6c4009
   last pathname component.  Return 0 on success, -1 for errors.  */
Packit 6c4009
extern ssize_t llistxattr (const char *__path, char *__list, size_t __size)
Packit 6c4009
	__THROW;
Packit 6c4009
Packit 6c4009
/* List attributes of the file descriptor FD into the user-supplied buffer
Packit 6c4009
   LIST (which is SIZE bytes big).  Return 0 on success, -1 for errors.  */
Packit 6c4009
extern ssize_t flistxattr (int __fd, char *__list, size_t __size)
Packit 6c4009
	__THROW;
Packit 6c4009
Packit 6c4009
/* Remove the attribute NAME from the file pointed to by PATH.  Return 0
Packit 6c4009
   on success, -1 for errors.  */
Packit 6c4009
extern int removexattr (const char *__path, const char *__name) __THROW;
Packit 6c4009
Packit 6c4009
/* Remove the attribute NAME from the file pointed to by PATH, not
Packit 6c4009
   following symlinks for the last pathname component.  Return 0 on
Packit 6c4009
   success, -1 for errors.  */
Packit 6c4009
extern int lremovexattr (const char *__path, const char *__name) __THROW;
Packit 6c4009
Packit 6c4009
/* Remove the attribute NAME from the file descriptor FD.  Return 0 on
Packit 6c4009
   success, -1 for errors.  */
Packit 6c4009
extern int fremovexattr (int __fd, const char *__name) __THROW;
Packit 6c4009
Packit 6c4009
__END_DECLS
Packit 6c4009
Packit 6c4009
#endif	/* sys/xattr.h  */