.Dd August 18, 2024 .Dt SETXATTR 2 .Os Camellia .Sh NAME .Nm setxattr .Nd set file attribute .Sh SYNOPSIS .In camellia/syscalls.h .Ft ssize_t .Fo _sys_setxattr .Fa "hid_t h" .Fa "const char *name" .Fa "const void *buf" .Fa "size_t len" .Fa "int flags" .Fc .Sh DESCRIPTION .Nm sets the attribute of .Fa h named by .Fa name to the contents of .Fa buf . .Fa flags is reserved for future use, for now it has to be 0. .Pp For more details see .Xr getxattr 2 . .Sh RETURN VALUES .Nm returns .Fa len or a negative value on failure. The most common errors are: .Bl -tag -width EGENERIC .It Er ENOSYS The filesystem doesn't support xattrs. .It Er EGENERIC The filesystem probably doesn't support xattrs, and it wasn't written very well. Sorry. .It Er EACCES You lack the permission to write this xattr. .El .Pp In theory filesystems can return a nonnegative value different from .Fa len , but that shouldn't ever happen. .Sh SEE ALSO .Xr getxattr 2 .Sh BUGS There's no way to delete attributes right now. This will probably be done with some sort of .Dv XATTR_DELETE flag. .Sh RATIONALE See .Xr getxattr 2 .