summaryrefslogtreecommitdiff
path: root/man/setxattr.2
blob: 0690d35e46f1344b1080ca533a39cd690e7b56b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.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 .