The translation is temporarily closed for contributions due to maintenance, please come back later.

Source string Read only

(itstool) path: sect1/para
Context English State
Even <literal>root</literal> users within the <application>jail</application> are not allowed to unset or modify any file flags, such as immutable, append-only, and undeleteable flags, if the securelevel is greater than 0.
static int
if (!priv_check_cred(cred, PRIV_VFS_SYSFLAGS, 0)) {
if (ip-&gt;i_flags
error = securelevel_gt(cred, 0);
if (error)
return (error);
priv_check_cred(struct ucred *cred, int priv, int flags)
error = prison_priv_check(cred, priv);
if (error)
return (error);
prison_priv_check(struct ucred *cred, int priv)
switch (priv) {
if (jail_chflags_allowed)
return (0);
return (EPERM);
The SYSINIT Framework
<primary>dynamic initialization</primary>
<primary>kernel initialization</primary> <secondary>dynamic</secondary>
<primary>kernel modules</primary>
<primary>kernel linker</primary>
SYSINIT is the framework for a generic call sort and dispatch mechanism. FreeBSD currently uses it for the dynamic initialization of the kernel. SYSINIT allows FreeBSD's kernel subsystems to be reordered, and added, removed, and replaced at kernel link time when the kernel or one of its modules is loaded without having to edit a statically ordered initialization routing and recompile the kernel. This system also allows kernel modules, currently called <firstterm>KLD's</firstterm>, to be separately compiled, linked, and initialized at boot time and loaded even later while the system is already running. This is accomplished using the <quote>kernel linker</quote> and <quote>linker sets</quote>.
Linker Set
A linker technique in which the linker gathers statically declared data throughout a program's source files into a single contiguously addressable unit of data.
SYSINIT Operation
<primary>linker sets</primary>
SYSINIT relies on the ability of the linker to take static data declared at multiple locations throughout a program's source and group it together as a single contiguous chunk of data. This linker technique is called a <quote>linker set</quote>. SYSINIT uses two linker sets to maintain two data sets containing each consumer's call order, function, and a pointer to the data to pass to that function.
SYSINIT uses two priorities when ordering the functions for execution. The first priority is a subsystem ID giving an overall order for SYSINIT's dispatch of functions. Current predeclared ID's are in <filename>&lt;sys/kernel.h&gt;</filename> in the enum list <literal>sysinit_sub_id</literal>. The second priority used is an element order within the subsystem. Current predeclared subsystem element orders are in <filename>&lt;sys/kernel.h&gt;</filename> in the enum list <literal>sysinit_elem_order</literal>.
There are currently two uses for SYSINIT. Function dispatch at system startup and kernel module loads, and function dispatch at system shutdown and kernel module unload. Kernel subsystems often use system startup SYSINIT's to initialize data structures, for example the process scheduling subsystem uses a SYSINIT to initialize the run queue data structure. Device drivers should avoid using <literal>SYSINIT()</literal> directly. Instead drivers for real devices that are part of a bus structure should use <literal>DRIVER_MODULE()</literal> to provide a function that detects the device and, if it is present, initializes the device. It will do a few things specific to devices and then call <literal>SYSINIT()</literal> itself. For pseudo-devices, which are not part of a bus structure, use <literal>DEV_MODULE()</literal>.
SYSINIT(uniquifier, subsystem, order, func, ident)
SYSUNINIT(uniquifier, subsystem, order, func, ident)
The <literal>SYSINIT()</literal> macro creates the necessary SYSINIT data in SYSINIT's startup data set for SYSINIT to sort and dispatch a function at system startup and module load. <literal>SYSINIT()</literal> takes a uniquifier that SYSINIT uses to identify the particular function dispatch data, the subsystem order, the subsystem element order, the function to call, and the data to pass the function. All functions must take a constant pointer argument.
Example of a <literal>SYSINIT()</literal>
#include &lt;sys/kernel.h&gt;

void foo_null(void *unused)

struct foo foo_voodoo = {

void foo_arg(void *vdata)
struct foo *foo = (struct foo *)vdata;
SYSINIT(bar, SI_SUB_FOO, SI_ORDER_FOO, foo_arg, &amp;foo_voodoo);
Note that <literal>SI_SUB_FOO</literal> and <literal>SI_ORDER_FOO</literal> need to be in the <literal>sysinit_sub_id</literal> and <literal>sysinit_elem_order</literal> enum's as mentioned above. Either use existing ones or add your own to the enum's. You can also use math for fine-tuning the order a SYSINIT will run in. This example shows a SYSINIT that needs to be run just barely before the SYSINIT's that handle tuning kernel parameters.
Example of Adjusting <literal>SYSINIT()</literal> Order
static void
mptable_register(void *dummy __unused)


mptable_register, NULL);
The <literal>SYSUNINIT()</literal> macro behaves similarly to the <literal>SYSINIT()</literal> macro except that it adds the SYSINIT data to SYSINIT's shutdown data set.


No matching activity found.

Browse all component changes

Things to check

Multiple failing checks

Following checks are failing:
Zero-width space: Portuguese (Brazil)
Mismatched full stop: Portuguese (Brazil)
Trailing space: Portuguese (Brazil)


Source information

Source string comment
(itstool) path: sect1/para
Source string location
String age
a year ago
Source string age
a year ago
Translation file
books/arch-handbook.pot, string 541