summaryrefslogtreecommitdiff
path: root/static/freebsd/man3/libcasper_service.3
diff options
context:
space:
mode:
Diffstat (limited to 'static/freebsd/man3/libcasper_service.3')
-rw-r--r--static/freebsd/man3/libcasper_service.3119
1 files changed, 119 insertions, 0 deletions
diff --git a/static/freebsd/man3/libcasper_service.3 b/static/freebsd/man3/libcasper_service.3
new file mode 100644
index 00000000..201c19c7
--- /dev/null
+++ b/static/freebsd/man3/libcasper_service.3
@@ -0,0 +1,119 @@
+.\" Copyright (c) 2018 Mariusz Zaborski <oshogbo@FreeBSD.org>
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.Dd November 15, 2021
+.Dt LIBCASPER 3
+.Os
+.Sh NAME
+.Nm CREATE_SERVICE
+.Nd "casper service declaration macro"
+.Sh LIBRARY
+.Lb libcasper
+.Sh SYNOPSIS
+.In sys/nv.h
+.In libcasper.h
+.In libcasper_service.h
+.Bd -literal
+typedef int service_limit_func_t(const nvlist_t *, const nvlist_t *);
+
+typedef int service_command_func_t(const char *, const nvlist_t *, nvlist_t *,
+ nvlist_t *);
+
+.Ed
+.Fn CREATE_SERVICE "name" "limit_func" "command_func" "flags"
+.Sh DESCRIPTION
+The
+.Nm CREATE_SERVICE
+macro is used to create a new casper service.
+The
+.Fa name
+is a string containing the service name, which will be used in the
+.Xr cap_service_open 3 ,
+function to identify it.
+.Pp
+The
+.Fa limit_func
+is a function of type
+.Li service_limit_func_t
+where the first argument of the function contains an
+.Xr nvlist 9 ,
+old service limits and
+the second argument contains the new limits.
+If the service was not limited then the old limits will be set to
+.Dv NULL .
+This function must not allow the extension of service limits.
+The
+.Fa command_func
+is a function of type
+.Li service_command_func_t
+where the first argument is the name of the command that should be executed.
+The first
+.Xr nvlist 9
+contains the current limits and the second contains an
+.Xr nvlist 9
+with the current request.
+The last argument contains a return value
+.Xr nvlist 9
+which contains the response from casper.
+.Pp
+The
+.Fa flags
+argument defines the limits of the service.
+The supported flags are:
+.Bl -ohang -offset indent
+.It CASPER_SERVICE_STDIO
+The casper service has access to the stdio descriptors from the process it was
+spawned from.
+.It CASPER_SERVICE_FD
+The casper service has access to all of the descriptors,
+besides the stdio descriptors,
+from the process it was spawned from.
+.It CASPER_SERVICE_NO_UNIQ_LIMITS
+The whole casper communication is using an
+.Xr nvlist 9
+with the
+.Dv NV_FLAG_NO_UNIQUE
+flag.
+.El
+.Sh SEE ALSO
+.Xr cap_enter 2 ,
+.Xr libcasper 3 ,
+.Xr capsicum 4 ,
+.Xr nv 9
+.Sh HISTORY
+The
+.Nm libcasper
+library first appeared in
+.Fx 10.3 .
+.Sh AUTHORS
+The
+.Nm libcasper
+library was implemented by
+.An Pawel Jakub Dawidek Aq Mt pawel@dawidek.net
+under sponsorship from the FreeBSD Foundation.
+The
+.Nm libcasper
+new architecture was implemented by
+.An Mariusz Zaborski Aq Mt oshogbo@FreeBSD.org
+.