xref: /freebsd/lib/libc/gen/cap_sandboxed.3 (revision 06c3fb2749bda94cb5201f81ffdb8fa6c3161b2e)
1.\"
2.\" Copyright (c) 2012 The FreeBSD Foundation
3.\"
4.\" This documentation was written by Pawel Jakub Dawidek under sponsorship
5.\" from the FreeBSD Foundation.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\" 1. Redistributions of source code must retain the above copyright
11.\"    notice, this list of conditions and the following disclaimer.
12.\" 2. Redistributions in binary form must reproduce the above copyright
13.\"    notice, this list of conditions and the following disclaimer in the
14.\"    documentation and/or other materials provided with the distribution.
15.\"
16.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26.\" SUCH DAMAGE.
27.\"
28.Dd May 5, 2020
29.Dt CAP_SANDBOXED 3
30.Os
31.Sh NAME
32.Nm cap_sandboxed
33.Nd Check if in a capability mode sandbox
34.Sh LIBRARY
35.Lb libc
36.Sh SYNOPSIS
37.In sys/capsicum.h
38.In stdbool.h
39.Ft bool
40.Fn cap_sandboxed "void"
41.Sh DESCRIPTION
42.Fn cap_sandboxed
43returns
44.Va true
45if the process is in a capability mode sandbox or
46.Va false
47if it is not.
48This function is a more handy alternative to the
49.Xr cap_getmode 2
50system call as it always succeeds, so there is no need for error checking.
51If the support for capability mode is not compiled into the kernel,
52.Fn cap_sandboxed
53will always return
54.Va false .
55.Sh RETURN VALUES
56Function
57.Fn cap_sandboxed
58is always successful and will return either
59.Va true
60or
61.Va false .
62.Sh SEE ALSO
63.Xr cap_enter 2 ,
64.Xr capsicum 4
65.Sh HISTORY
66The
67.Fn cap_sandboxed
68function first appeared in
69.Fx 9.2 .
70.Sh AUTHORS
71This function was implemented and manual page was written by
72.An Pawel Jakub Dawidek Aq Mt pawel@dawidek.net
73under sponsorship of the FreeBSD Foundation.
74