1 .\" Copyright (c) 2018 Mariusz Zaborski <oshogbo@FreeBSD.org>
2 .\" All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\" notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\" notice, this list of conditions and the following disclaimer in the
11 .\" documentation and/or other materials provided with the distribution.
13 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
14 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
17 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 .Nd "casper service declaration macro"
38 .In libcasper_service.h
40 typedef int service_limit_func_t(const nvlist_t *, const nvlist_t *);
42 typedef int service_command_func_t(const char *, const nvlist_t *, nvlist_t *,
46 .Fn CREATE_SERVICE "name" "limit_func" "command_func" "flags"
50 macro to create a new Casper service.
53 is a string containing the service name, which will be used in the
54 .Xr cap_service_open 3 ,
55 function to identify it.
60 .Li service_limit_func_t .
61 The first argument of the function contains
63 old service limits and second one the new limits.
64 If the services wasn't limited the old limits will be set to
66 This function should not allow to extend service limits and only limit it
71 .Li service_command_func_t .
72 First argument is the name of the command that should be executed.
75 contains the current limits.
79 The last one contains an output
81 which contains the response from Casper.
85 argument defines limits of the service.
86 The supported flags are:
87 .Bl -ohang -offset indent
88 .It CASPER_SERVICE_STDIO
89 The Casper service has access to the stdio descriptors from the process it was
92 The Casper service has access to all descriptors besides stdio descriptors from
93 the process it was spawned from.
94 .It CASPER_SERVICE_NO_UNIQ_LIMITS
95 The whole Casper communication is using
109 library first appeared in
114 library was implemented by
115 .An Pawel Jakub Dawidek Aq Mt pawel@dawidek.net
116 under sponsorship from the FreeBSD Foundation.
119 new architecture was implemented by
120 .An Mariusz Zaborski Aq Mt oshogbo@FreeBSD.org