getxattr, lgetxattr, fgetxattr - retrieve an extended attribute value


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

   ssize_t getxattr (const char *path, const char *name,
                        void *value, size_t size);
   ssize_t lgetxattr (const char *path, const char *name,
                        void *value, size_t size);
   ssize_t fgetxattr (int filedes, const char *name,
                        void *value, size_t size);


   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).

   getxattr  retrieves  the  value of the extended attribute identified by
   name and associated with the given path in the filesystem.  The  length
   of the attribute value is returned.

   lgetxattr  is  identical  to getxattr, except in the case of a symbolic
   link, where the link itself is  interrogated,  not  the  file  that  it
   refers to.

   fgetxattr  is  identical  to getxattr, only the open file pointed to by
   filedes (as returned by open(2)) is interrogated 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.

   An empty buffer of size zero can be passed into these calls  to  return
   the  current size of the named extended attribute, which can be used to
   estimate the size of a buffer which is sufficiently large to  hold  the
   value associated with the extended attribute.

   The  interface  is  designed to allow guessing of initial buffer sizes,
   and to enlarge buffers when the return value indicates that the  buffer
   provided was too small.


   On  success,  a  positive number is returned indicating the size of the
   extended attribute value.  On failure, -1 is returned and errno is  set

   If  the named attribute does not exist, or the process has no access to
   this attribute, errno is set to ENOATTR.

   If the size of the value buffer is too small to hold the result,  errno
   is set to ERANGE.

   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


   Andreas   Gruenbacher,  <>  and  the  SGI  XFS
   development team, <>.  Please send any bug reports
   or comments to these addresses.


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

More Linux Commands

pcre16_config(3) Perl-compatible regular expressions........
This function makes it possible for a client program to find out which optional features are available in the version of the PCRE library it is using. The argum

postalias(1) - Postfix alias database maintenance (ManPage)
The postalias(1) command creates or queries one or more Postfix alias databases, or updates an existing one. The input and output file formats are expected to b

binary(n) - Insert and extract fields from binary strings...
This command provides facilities for manipulating binary data. The subcommand binary format creates a binary string from normal Tcl values. For example, given t

xdr_getpos(3) - library routines for external data represent
These routines allow C programmers to describe arbitrary data structures in a machine-independent fashion. Data for remote procedure calls are transmitted using

Tcl_DumpActiveMemory(3) - Validated memory allocation interf
These functions provide access to Tcl memory debugging information. They are only functional when Tcl has been compiled with TCL_MEM_DEBUG defined at compile-ti

nm(1) - list symbols from object files - Linux manual page
GNU nm lists the symbols from object files objfile.... If no object files are listed as arguments, nm assumes the file a.out. For each symbol, nm shows: * The s

pselect(2) - synchronous I/O multiplexing - Linux man page
select() and pselect() allow a program to monitor multiple file descriptors, waiting until one or more of the file descriptors become ready for some class of I/

XcmsSetWhitePoint(3) - modifying CCC attributes (Man Page)
The XcmsSetWhitePoint function changes the Client White Point in the specified CCC. Note that the pixel member is ignored and that the color specification is le

DisplayHeightMM(3) - image format functions and macros......
The XListPixmapFormats function returns an array of XPixmapFormatValues structures that describe the types of Z format images supported by the specified display

systemd-update-utmp-runlevel.service(8) Write audit and utmp
systemd-update-utmp-runlevel.service is a service that writes SysV runlevel changes to utmp and wtmp, as well as the audit logs, as they occur. systemd-update-u

Tcl_GetChannelType(3) - procedures for creating and manipula
Tcl uses a two-layered channel architecture. It provides a generic upper layer to enable C and Tcl programs to perform input and output using the same APIs for

XFetchBytes(3) - manipulate cut and paste buffers (ManPage)
The data can have embedded null characters and need not be null-terminated. The cut buffers contents can be retrieved later by any client calling XFetchBytes. X

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