Changeset View
Changeset View
Standalone View
Standalone View
lib/libcasper/libcasper/libcasper_service.3
Show First 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | |||||
typedef int service_command_func_t(const char *, const nvlist_t *, nvlist_t *, | typedef int service_command_func_t(const char *, const nvlist_t *, nvlist_t *, | ||||
nvlist_t *); | nvlist_t *); | ||||
.Ed | .Ed | ||||
.Fn CREATE_SERVICE "name" "limit_func" "command_func" "flags" | .Fn CREATE_SERVICE "name" "limit_func" "command_func" "flags" | ||||
.Sh DESCRIPTION | .Sh DESCRIPTION | ||||
The | The | ||||
.Nm CREATE_SERVICE | .Nm CREATE_SERVICE | ||||
macro to create a new Casper service. | macro is used to create a new Casper service. | ||||
0mp: In the other manual page, the name of the service seems to be consistently lowercase "casper". | |||||
The | The | ||||
.Fa name | .Fa name | ||||
is a string containing the service name, which will be used in the | is a string containing the service name, which will be used in the | ||||
.Xr cap_service_open 3 , | .Xr cap_service_open 3 , | ||||
function to identify it. | function to identify it. | ||||
.Pp | .Pp | ||||
The | The | ||||
.Fa limit_func | .Fa limit_func | ||||
is a function of type | is a function of type | ||||
.Li service_limit_func_t . | .Li service_limit_func_t | ||||
The first argument of the function contains | where the first argument of the function contains an containing | ||||
Done Inline ActionsThis sentence does not read well. "containing" does not seem to fit at all, does it? 0mp: This sentence does not read well. "containing" does not seem to fit at all, does it? | |||||
Not Done Inline ActionsThere's a period missing at the end of this sentence. debdrup: There's a period missing at the end of this sentence. | |||||
.Xr nvlist 9 , | .Xr nvlist 9 , | ||||
old service limits and second one the new limits. | old service limits and the second argument contains the new limits. | ||||
If the services wasn't limited the old limits will be set to | If the service wasn't limited then the old limits will be set to | ||||
Done Inline ActionsI think that mandoc -Tlint recommends to avoid contractions in manual pages. 0mp: I think that `mandoc -Tlint` recommends to avoid contractions in manual pages. | |||||
Done Inline ActionsHow about? where the first argument of the function contains an .Xr nvlist 9 of old service limits and the second argument contains the new limits 0mp: How about?
```
where the first argument of the function contains an
.Xr nvlist 9
of old… | |||||
.Dv NULL . | .Dv NULL . | ||||
This function should not allow to extend service limits and only limit it | This function must not allow the extension of service limits. | ||||
further. | |||||
The | The | ||||
.Fa command_func | .Fa command_func | ||||
is a function of type | is a function of type | ||||
.Li service_command_func_t . | .Li service_command_func_t | ||||
First argument is the name of the command that should be executed. | where the first argument is the name of the command that should be executed. | ||||
The first | The first | ||||
.Xr nvlist 9 | .Xr nvlist 9 | ||||
contains the current limits. | contains the current limits and the second contains an | ||||
Next one contains a | |||||
.Xr nvlist 9 | .Xr nvlist 9 | ||||
with current request. | with the current request. | ||||
The last one contains an output | The last argument contains a return value | ||||
.Xr nvlist 9 | .Xr nvlist 9 | ||||
which contains the response from Casper. | which contains the response from Casper. | ||||
.Pp | .Pp | ||||
The | The | ||||
.Fa flags | .Fa flags | ||||
argument defines limits of the service. | argument defines the limits of the service. | ||||
The supported flags are: | The supported flags are: | ||||
.Bl -ohang -offset indent | .Bl -ohang -offset indent | ||||
.It CASPER_SERVICE_STDIO | .It CASPER_SERVICE_STDIO | ||||
The Casper service has access to the stdio descriptors from the process it was | The Casper service has access to the stdio descriptors from the process it was | ||||
spawned from. | spawned from. | ||||
.It CASPER_SERVICE_FD | .It CASPER_SERVICE_FD | ||||
The Casper service has access to all descriptors besides stdio descriptors from | The Casper service has access to all of the descriptors, | ||||
the process it was spawned from. | besides the stdio descriptors, | ||||
from the process it was spawned from. | |||||
.It CASPER_SERVICE_NO_UNIQ_LIMITS | .It CASPER_SERVICE_NO_UNIQ_LIMITS | ||||
The whole Casper communication is using | The whole Casper communication is using an | ||||
.Xr nvlist 9 | .Xr nvlist 9 | ||||
with | with the | ||||
.Xr NVLIST_NO_UNIQ 9 | .Xr NVLIST_NO_UNIQ 9 | ||||
flag. | flag. | ||||
.El | .El | ||||
.Sh SEE ALSO | .Sh SEE ALSO | ||||
.Xr cap_enter 2 , | .Xr cap_enter 2 , | ||||
.Xr libcasper 3 , | .Xr libcasper 3 , | ||||
.Xr capsicum 4 , | .Xr capsicum 4 , | ||||
.Xr nv 9 | .Xr nv 9 | ||||
Show All 16 Lines |
In the other manual page, the name of the service seems to be consistently lowercase "casper". I'm not sure if we need to make it consistent across all manual pages.