diff --git a/lib/libsys/open.2.xattr b/lib/libsys/open.2 --- a/lib/libsys/open.2.xattr +++ b/lib/libsys/open.2 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd February 28, 2025 +.Dd April 3, 2025 .Dt OPEN 2 .Os .Sh NAME @@ -210,6 +210,8 @@ open file referenced by .Fa fd if path is empty +.It Dv O_NAMEDATTR +open a named attribute or named attribute directory .El .Pp Exactly one of the flags @@ -499,6 +501,44 @@ .Dv O_CLOEXEC flag. .Pp +The +.Dv O_NAMEDATTR +flag specifies that a named attribute or named attribute directory be +opened. +For +.Fn open +or +.Fn openat +where the +.Fa fd +represents an open file in the file system's directory namespace, +this option flag indicates that the named attribute directory should +be opened. +If the +.Dv O_CREAT +flag has been specified as well, the named attribute directory will be +created if it does not exist. +If the +.Dv O_CREAT +flag has not been specified and there is no named attribute directory +for the file object, an +.Fn open +or +.Fn openat +will return +.Er ENOATTR . +If the +.Fn openat +argument +.Fa fd +is an open named attribute directory, the +.Fa path +argument must be a single component name and is the name of a named +attribute for the file object. +(See +.Xr named_attribute 9 +for more information.) +.Pp The system imposes a limit on the number of file descriptors open simultaneously by one process. The @@ -730,6 +770,10 @@ .Dv vfs.lookup_cap_dotdot .Xr sysctl 3 is set, and the process is in capability mode. +.It Bq Er ENOATTR +.Dv O_NAMEDATTR +has been specified, but there is no named attribute or named attribute +directory. .El .Sh SEE ALSO .Xr chmod 2 , @@ -745,7 +789,8 @@ .Xr umask 2 , .Xr write 2 , .Xr fopen 3 , -.Xr capsicum 4 +.Xr capsicum 4 , +.Xr named_attribute 9 .Sh STANDARDS These functions are specified by .St -p1003.1-2008 . @@ -794,6 +839,8 @@ .Fx 8.0 . .Dv O_DSYNC appeared in 13.0. +.Dv O_NAMEDATTR +appeared in 15.0. .Sh BUGS The .Fa mode