LIBCASPER(3)
πΈ NAME πΈ
okay bestie, welcome to the libcasper manual page β specifically the CREATE_SERVICE moment. This macro is a casper service declaration macro, and yes, itβs the main character here. π
CREATE_SERVICEβ casper service declaration macro β¨
π«Ά LIBRARY π«Ά
itβs giving: library βlibcasperβ. no notes. π
β¨ SYNOPSIS β¨
copy these exactly, bestie β character for character, no improv:
#include <sys/nv.h>
#include <libcasper.h>
#include <libcasper_service.h>
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 *);
CREATE_SERVICE(name, limit_func, command_func, flags);
π DESCRIPTION π
The CREATE_SERVICE macro is used to create a new casper service. The name is a string containing the service name, which will be used in the cap_service_open(3) function to identify it. iconic behavior, honestly. π
The limit_func is a function of type service_limit_func_t where the first argument of the function contains an nvlist(9) with 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 NULL. π¨ Important: this function must not allow the extension of service limits. hard no, bestie.
The command_func is a function of type service_command_func_t where the first argument is the name of the command that should be executed. The first nvlist(9) contains the current limits and the second contains an nvlist(9) with the current request. The last argument contains a return value nvlist(9) which contains the response from casper. the way that whole pipeline works is lowkey elegant. π¦
The flags argument defines the limits of the service. The supported flags are:
π© supported flags π©
CASPER_SERVICE_STDIOβ the casper service has access to the stdio descriptors from the process it was spawned from. π₯οΈCASPER_SERVICE_FDβ the casper service has access to all of the descriptors, besides the stdio descriptors, from the process it was spawned from. πCASPER_SERVICE_NO_UNIQ_LIMITSβ the whole casper communication is using annvlist(9)with theNV_FLAG_NO_UNIQUEflag. π₯
π SEE ALSO π
π°οΈ HISTORY π°οΈ
The libcasper library first appeared in FreeBSD 10.3. a whole era. β
π AUTHORS π
The libcasper library was implemented by Pawel Jakub Dawidek <pawel@dawidek.net> under sponsorship from the FreeBSD Foundation. The libcasper new architecture was implemented by Mariusz Zaborski <oshogbo@FreeBSD.org>. absolute icons, fr fr. π«Ά
Debian β’ November 15, 2021 β’ LIBCASPER(3) β thatβs the footer, bestie: Debian, dated November 15, 2021, manual page LIBCASPER(3). mwah ππ
π¦ where this page comes from
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- Copyright (c) 2018 Mariusz Zaborski <oshogbo@FreeBSD.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms