2
.\" $Id: _setfilecap.2,v 1.1.1.1 1999/04/17 22:16:31 morgan Exp $
3
.\" written by Andrew Main <zefram@dcs.warwick.ac.uk>
5
.TH _SETFILECAP 2 "26th April 1997" "Linux 2.1" "Linux Programmer's Manual"
7
_setfilecap, _getfilecap, _fsetfilecap, _fgetfilecap \- set/get file capabilities
9
.B #include <sys/capability.h>
11
.BI "int _setfilecap(char const *" filename ", size_t " usize ", __cap_s const *" iset ", __cap_s const *" pset ", __cap_s const *" eset );
13
.BI "int _getproccap(char const *" filename ", size_t " usize ", __cap_s *" iset ", __cap_s *" pset ", __cap_s *" eset );
15
.BI "int _fsetfilecap(int " fd ", size_t " usize ", __cap_s const *" iset ", __cap_s const *" pset ", __cap_s const *" eset );
17
.BI "int _fgetproccap(int " fd ", size_t " usize ", __cap_s *" iset ", __cap_s *" pset ", __cap_s *" eset );
25
Inheritable, Permitted and Effective capabilities to the sets specified.
26
A NULL pointer specifies that a set should not be changed.
29
does the same thing to the file referenced by file descriptor
35
copy the file's capability sets into the sets provided.
36
A NULL pointer specifies that a set should not be returned.
40
argument specifies the size of the user-space capability sets, in bytes.
41
If the kernel uses a different size internally, it will truncate or
42
zero-fill as required.
44
Files don't actually have a proper Effective capability set. Instead they
45
have a single-bit flag, that indicates that the set is either full or
46
empty. When setting a file's capabilities, that flag will be set if
47
and only if the Effective set specified has at least one bit set.
49
On success, zero is returned. On error, -1 is returned, and
55
One of the capability arguments or the filename was an invalid data pointer.
58
An attempt was made to set non-empty capabilities on a file,
59
and the caller does not have the
64
An attempt was made to set capabilities on a file, and
65
the effective UID does not match the owner of the file, and the caller
71
An attempt was made to set non-empty capabilities on a file
72
residing on a file system that does not support them.
75
An attempt was made to set capabilities on a file residing
76
on a read-only file system.
83
The file specified does not exist.
86
Insufficient kernel memory was available.
89
A component of the path prefix is not a directory.
92
Search permission is denied on a component of the path prefix.
96
containes a circular reference (via symlinks).
100
is not a valid file descriptor.
103
A hard error occurred while reading or writing the file system.
106
The POSIX.1e capability system was not configured into the kernel.
108
These system calls are specific to Linux.
109
The portable interfaces are
110
.IR cap_set_file (3),
111
.IR cap_get_file (3),