statea Subroutine

Purpose

Provides information about an extended attribute.

Syntax

#include <sys/ea.h>

int statea(const char *path, const char *name, struct stat64x *buffer)
int fstatea(int filedes, const char *name, struct stat64x *buffer)
int lstatea(const char *path, const char *name, struct stat64x *buffer)

Description

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 of the 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 statea subroutine gets information about the extended attribute name name associated with the file system object specified by path. The fstatea subroutine is identical to statea, except that it takes a file descriptor instead of a path. The lstatea subroutine is identical to statea, except, in the case of a symbolic link, the link itself is interrogated rather than the file that it refers to.

The statea subroutine uses a stat64x structure to return the information. Note that all values in this structure are 64-bit, including the devices and size. A normal struct stat cannot be passed to statea. For more information, see the stat, fstat, lstat, statx, fstatx, statxat, fstatat, fullstat, ffullstat, stat64, fstat64, lstat64, stat64x, fstat64x, lstat64x, or stat64xat Subroutine.

Parameters

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.
buffer A pointer to the stat structure in which information is returned.
filedes A file descriptor for the file.

Return Values

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

Error Codes

Item Description
EACCES Caller lacks read permission on the base file, or lacks the appropriate ACL privileges for named attribute lookup.
EFAULT A bad address was passed for path, name, or buffer.
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 ..).
ENAMETOOLONG The path or name value is too long.
ENOATTR No attribute named name is present.
ENOTSUP Extended attributes are not supported by the file system.