fsetxattr(2)


NAME

   setxattr, lsetxattr, fsetxattr - set an extended attribute value

SYNOPSIS

   #include <sys/types.h>
   #include <attr/xattr.h>

   int setxattr (const char *path, const char *name,
                   const void *value, size_t size, int flags);
   int lsetxattr (const char *path, const char *name,
                   const void *value, size_t size, int flags);
   int fsetxattr (int filedes, const char *name,
                   const void *value, size_t size, int flags);

DESCRIPTION

   Extended attributes are name:value pairs associated with inodes (files,
   directories,  symlinks,  etc).   They  are  extensions  to  the  normal
   attributes which are associated with all inodes in the system (i.e. the
   stat(2) data).  A complete overview of extended attributes concepts can
   be found in attr(5).

   setxattr  sets  the  value of the extended attribute identified by name
   and associated with the given path in the filesystem.  The size of  the
   value must be specified.

   lsetxattr  is  identical  to setxattr, except in the case of a symbolic
   link, where the extended attribute is set on the link itself,  not  the
   file that it refers to.

   fsetxattr  is identical to setxattr, only the extended attribute is set
   on the open file pointed to by filedes  (as  returned  by  open(2))  in
   place of path.

   An  extended  attribute  name  is a simple NULL-terminated string.  The
   name includes a namespace prefix  -  there  may  be  several,  disjoint
   namespaces  associated  with  an  individual  inode.   The  value of an
   extended attribute is a chunk of arbitrary textual or  binary  data  of
   specified length.

   The  flags  parameter  can  be  used  to  refine  the  semantics of the
   operation.  XATTR_CREATE specifies a pure create, which  fails  if  the
   named attribute exists already.  XATTR_REPLACE specifies a pure replace
   operation, which fails if the named attribute does not  already  exist.
   By  default  (no flags), the extended attribute will be created if need
   be, or will simply replace the value if the attribute exists.

RETURN VALUE

   On success, zero is returned.  On failure, -1 is returned and errno  is
   set appropriately.

   If  XATTR_CREATE  is specified, and the attribute exists already, errno
   is set to EEXIST.  If XATTR_REPLACE is  specified,  and  the  attribute
   does not exist, errno is set to ENOATTR.

   If  there  is  insufficient  space  remaining  to  store  the  extended
   attribute,  errno  is  set  to  either  ENOSPC,  or  EDQUOT  if   quota
   enforcement was the cause.

   If  extended  attributes  are  not  supported by the filesystem, or are
   disabled, errno is set to ENOTSUP.

   The errors documented for the stat(2) system call are  also  applicable
   here.

AUTHORS

   Andreas   Gruenbacher,  <a.gruenbacher@bestbits.at>  and  the  SGI  XFS
   development team, <linux-xfs@oss.sgi.com>.  Please send any bug reports
   or comments to these addresses.

SEE ALSO

   getfattr(1),  setfattr(1), open(2), stat(2), getxattr(2), listxattr(2),
   removexattr(2), and attr(5).


More Linux Commands

manpages/erfcf.3.html
erfcf(3) - complementary error function - Linux manual page
The erfc() function returns the complementary error function of x, that is, 1.0 - erf(x). RETURN VALUE On success, these functions return the complementary erro

manpages/gnutls_certificate_set_openpgp_key_file2.3.html
gnutls_certificate_set_openpgp_key_file2(3) - API function
This funtion is used to load OpenPGP keys into the GnuTLS credential structure. The file should contain at least one valid non encrypted subkey. The special key

manpages/lgamma.3.html
lgamma(3) - log gamma function (Library - Linux man page)...
For the definition of the Gamma function, see tgamma(3). The lgamma() function returns the natural logarithm of the absolute value of the Gamma function. The si

manpages/close.2.html
close(2) - close a file descriptor - Linux manual page......
close() closes a file descriptor, so that it no longer refers to any file and may be reused. Any record locks (see fcntl(2)) held on the file it was associated

manpages/XkbAllocGeomDoodads.3.html
XkbAllocGeomDoodads(3) - Allocate doodads that are global to
XkbAllocGeomDoodads.3 - Xkb provides a number of functions to allocate and free subcomponents of a keyboard geometry. Use these functions to create or modify ke

manpages/grmiregistry.1.html
grmiregistry(1) - - Remote object registry - Linux man page
grmiregistry starts a remote object registry on the current host. If no port number is specified, then port 1099 is used. OPTIONS Registry process control: -res

manpages/ps2pdf13.1.html
ps2pdf13(1) - Convert PostScript to PDF 1.3 (Acrobat 4-and-l
The ps2pdf scripts are work-alikes for nearly all the functionality (but not the user interface) of Adobes Acrobat(TM) Distiller(TM) product: they convert PostS

manpages/manconv.1.html
manconv(1) - convert manual page from one encoding to anothe
manconv converts a manual page from one encoding to another, like iconv. Unlike iconv, it can try multiple possible input encodings in sequence. This is useful

manpages/XML::XPath::Node::Element.3pm.html
XML::XPath::Node::Element(3pm) - an (Man Page)....
new ( name, prefix ) Create a new Element node with name name and prefix prefix. The name be prefix:local if prefix is defined. I know that sounds wierd, but it

manpages/Tcl_ReadRaw.3.html
Tcl_ReadRaw(3) - buffered I/O facilities using channels.....
The Tcl channel mechanism provides a device-independent and platform-independent mechanism for performing buffered input and output operations on a variety of f

manpages/perl583delta.1.html
perl583delta(1) - what is new for perl v5.8.3 (Man Page)....
This document describes differences between the 5.8.2 release and the 5.8.3 release. If you are upgrading from an earlier release such as 5.6.1, first read the

manpages/gnutls_rsa_params_deinit.3.html
gnutls_rsa_params_deinit(3) - API function - Linux man page
This function will deinitialize the RSA parameters structure. REPORTING BUGS Report bugs to &lt;bug-gnutls@gnu.org&gt;. GnuTLS home page: http://www.gnu.org/software/





We can't live, work or learn in freedom unless the software we use is free.