Extended attributes
A non-POSIX extension to file attributes called extended attributes can be implemented by a PFS. Unlike regular attributes, which are typically defined and accessed as fields in various file control structures, extended attributes can be defined as another interface to the existing attribute values or as additional structures and accessed from a name or value interface. You can use the setxattr, removexattr, getxattr, and listxattr functions to work with extended attributes. The set, remove, and get functions have name and value arguments and the list function returns a list of names.
| Xattr name | Existing attribute (BPXYATT) | Restrictions and commands |
|---|---|---|
trusted.apfauth |
attapfauth |
Set and remove functions are limited according to “general flags” restrictions. |
trusted.sharelib |
attsharelib |
Set and remove functions are limited according to “general flags” restrictions. |
trusted progctl |
attprogctl |
Set and remove functions are limited according to “general flags” restrictions. |
system.noshareas |
attnoshareas |
Set and remove functions are limited according to “general flags” restrictions. |
system.filefmt |
attfilefmt |
None. |
system.filetag |
attfiletag |
None. |
system.seclabel |
attseclabel |
None. |
system.useraudit |
attuseraudit |
None. |
system.auditoraudit |
attauditoraudit |
None. |
system.auditid |
Not an attribute. Equivalent to field ST_AUDITID in BPXYSTAT | Read-only |
system.dmodelacl |
ST_DMODELACL in BPXYSTAT | Read-only |
system.fmodelacl |
ST_FMODELACL in BPXYSTAT | Read-only |
system.accessacl |
ST_ACCESSACL in BPXYSTAT | Read-only |
system.createtime |
ST_CREATETIME in BPXYSTAT | Read-only |
user.* |
No equivalent | Needs specific PFS support. |
In the table, all but one of the supported extended attributes corresponds to existing file attributes and are accessed by using the existing interface. However, if a PFS will support the “user.*” attribute namespace, it must implement a new IOCTL command as shown in the implementation notes in vn_ioctl — I/O control.
