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/Mail::SpamAssassin::Plugin::AWL.3pm.html
Mail::SpamAssassin::Plugin::AWL(3pm) - Normalize scores via
This plugin module provides support for the auto-whitelist. It keeps track of the average SpamAssassin score for senders. Senders are tracked using a combinatio
manpages/ldap_compare_ext.3.html
ldap_compare_ext(3) - Perform an LDAP compare operation.....
The ldap_compare_ext_s() routine is used to perform an LDAP compare operation synchronously. It takes dn, the DN of the entry upon which to perform the compare,
manpages/skill.1.html
skill(1) - send a signal or report process status (ManPage)
These tools are obsolete and unportable. The command syntax is poorly defined. Consider using the killall, pkill, and pgrep commands instead. The default signal
manpages/xdr_union.3.html
xdr_union(3) - library routines for external data representa
These routines allow C programmers to describe arbitrary data structures in a machine-independent fashion. Data for remote procedure calls are transmitted using
manpages/usleep.3.html
usleep(3) - suspend execution for microsecond intervals.....
The usleep() function suspends execution of the calling thread for (at least) usec microseconds. The sleep may be lengthened slightly by any system activity or
manpages/ModPerl::Registry.3pm.html
ModPerl::Registry(3pm) - Run unaltered CGI scripts persisten
URIs in the form of http://example.com/perl/test.pl will be compiled as the body of a Perl subroutine and executed. Each child process will compile the subrouti
manpages/PTBatcherGUI.1.html
PTBatcherGUI(1) - Hugin batch processor - Linux manual page
A GUI Batch Processor for managing the stitching of a queue of hugin .pto projects. OPTIONS -h|--help Show usage message -b|--batch Run batch immediately -p|--p
manpages/html2text.1.html
html2text(1) an advanced HTMLtotext converter (Man Page)....
html2text reads HTML documents from the input-urls, formats each of them into a stream of plain text characters, and writes the result to standard output (or in
manpages/catch.n.html
catch(n) - Evaluate script and trap exceptional returns.....
The catch command may be used to prevent errors from aborting command interpretation. The catch command calls the Tcl interpreter recursively to execute script,
manpages/use_extended_names.3ncurses.html
use_extended_names(3ncurses) - miscellaneous curses extensio
use_extended_names.3ncurses - These functions are extensions to the curses library which do not fit easily into other categories. Use curses_version() to get th
manpages/Tcl_CommandTraceInfo.3.html
Tcl_CommandTraceInfo(3) - monitor renames and deletes of a c
Tcl_TraceCommand allows a C procedure to monitor operations performed on a Tcl command, so that the C procedure is invoked whenever the command is renamed or de
manpages/Tcl_SetChannelError.3.html
Tcl_SetChannelError(3) - functions to create/intercept Tcl e
The current definition of a Tcl channel driver does not permit the direct return of arbitrary error messages, except for the setting and retrieval of channel op
