removeea Subroutine


Removes an extended attribute.


#include <sys/ea.h>

int removeea(const char *path, const char *name);
int fremoveea(int filedes, const char *name);
int lremoveea(const char *path, const char *name);


Extended attributes are name:value pairs associated with the file system objects (such as files, directories, and symlinks). They are extensions to the normal attributes that are associated with all objects in the file system (that is, the stat(2) data).

Do not define an extended attribute name with the 8-character prefix "(0xF8)SYSTEM(0xF8)". Prefix "(0xF8)SYSTEM(0xF8)" is reserved for system use only.

Note: 0xF8 represents a non-printable character.

The removeea subroutine removes the extended attribute identified by name and associated with the given path in the file system. The fremoveea subroutine is identical to removeea, except that it takes a file descriptor instead of a path. The lremoveea subroutine is identical to removeea, except, in the case of a symbolic link, the link itself is interrogated rather than the file that it refers to.


Item Description
path The path name of the file.
name The name of the extended attribute. An extended attribute name is a NULL-terminated string.
filedes A file descriptor for the file.

Return Values

If the removeea subroutine succeeds, 0 is returned. Upon failure, -1 is returned and errno is set appropriately.

Error Codes

Item Description
EACCES Caller lacks write permission on the base file, or lacks the appropriate ACL privileges for named attribute delete.
EFAULT A bad address was passed for path or name.
EFORMAT File system is capable of supporting EAs, but EAs are disabled.
EINVAL A path-like name should not be used (such as zml/file, . and ..).
ENOATTR The named attribute does not exist, or tthe process has no access to this attribute.
ENOTSUP Extended attributes are not supported by the file system.