struct inheritance

Структура, характеризующая какие параметры наследуются процессом от родителя

Прототип:

#include <spawn.h>
typedef struct inheritance {
unsigned long flags;
pid_t pgroup; /* SPAWN_SETGROUP must be set in flags */
sigset_t sigmask; /* SPAWN_SETSIGMASK must be set in flags */
sigset_t sigdefault; /* SPAWN_SETSIGDEF must be set in flags */
sigset_t sigignore; /* SPAWN_SETSIGIGN must be set in flags */
unsigned long stack_max; /* SPAWN_SETSTACKMAX must be set in flags */
#if __INT_BITS__ != 32
long policy; /* SPAWN_EXPLICIT_SCHED must be set in flags */
#else
int policy; /* SPAWN_EXPLICIT_SCHED must be set in flags */
#endif
_Uint32t nd; /* SPAWN_SETND must be set in flags */
_Uint32t runmask; /* SPAWN_EXPLICIT_CPU must be set in flags */
struct sched_param param; /* SPAWN_EXPLICIT_SCHED must be set in flags */
} spawn_inheritance_type;

Описание:

Тип позволяет задавать перечень параметров, наследуемых процессом от родителя при создании. Структура включает следующие поля:

flags
Zero or more of the following bits:
SPAWN_ALIGN_DEFAULT
use the system's default settings for alignment.
SPAWN_ALIGN_FAULT
try to always fault data misalignment references.
SPAWN_ALIGN_NOFAULT
don't fault on misalignment; attempt to fix it (this may be slow).
SPAWN_CHECK_SCRIPT
start a shell, passing path as a script.
SPAWN_DEBUG
debug process (this is used only for debugging the kernel itself).
SPAWN_EXEC
cause the spawn to act like exec*(): replace the calling program in memory with the newly loaded program. If successful, no return is made to the calling program.
SPAWN_EXPLICIT_CPU
Set the runmask and inherit mask equal to the runmask member of the inheritance structure. If this flag isn't set, the child inherits the inherit mask of the calling thread.
SPAWN_EXPLICIT_SCHED
set the scheduling policy to the value of the policy member, and the scheduling parameters to the value of the param member.
SPAWN_HOLD
hold a process for debugging (i.e. send the SIGSTOP signal to the process before it executes its first instruction).
SPAWN_NOZOMBIE
prevent the child process from becoming a zombie on its death. No child return or exit information will be available.
SPAWN_PADDR64_SAFE
permit the selective to indicate that the process is known to operate safely with 64-bit addressing or doesn't care about the physical memory location.
SPAWN_SEARCH_PATH
search the PATH environment variable for the executable.
SPAWN_SETGROUP
set the child's process group to the value in the pgroup member. If this flag isn't set, the child process is part of the current process group.
SPAWN_SETND
spawn the child process on the node specified by the nd member.
SPAWN_SETSID
make the new process a session leader.
SPAWN_SETSIGDEF
use the sigdefault member to specify the child process's set of defaulted signals. If you don't specify this flag, the child process inherits the parent process's signal actions.
SPAWN_SETSIGIGN
set the handling for signals defined in the sigignore member to SIG_IGN.
SPAWN_SETSIGMASK
use the sigmask member to specify the child process's signal mask.
SPAWN_SETSTACKMAX
set the maximum stack size to the value of the stack_max member.
SPAWN_TCSETPGROUP
start a new terminal group.
The <spawn.h> file also defines SPAWN_ALIGN_MASK. It's a mask for the alignment flags listed above.
pgroup
The child process's group if you specify SPAWN_SETGROUP in the flags member. If SPAWN_SETGROUP is set in inherit.flags and inherit.pgroup is set to SPAWN_NEWPGROUP, the child process starts a new process group with the process group ID set to its process ID.
runmask
If you specify SPAWN_EXPLICIT_CPU in the flags member, the child process's runmask and inherit mask are set to the value of this member.
sigmask
The child process's signal mask if you specify SPAWN_SETSIGMASK in the flags member.
sigdefault
The child process's set of defaulted signals if you specify SPAWN_SETSIGDEF in the flags member.
sigignore
The child process's set of ignored signals if you specify SPAWN_SETSIGIGN in the flags member.
stack_max
The maximum stack size for the child process, if you set SPAWN_SETSTACKMAX in the flags member.
policy
The scheduling policy for the child process, if you set SPAWN_EXPLICIT_SCHED in the flags member. The policy must be one of the following:
SCHED_FIFO
a fixed-priority scheduler in which the highest priority ready thread runs until it blocks or is preempted by a higher priority thread.
SCHED_RR
similar to SCHED_FIFO, except that threads at the same priority level timeslice (round robin) every 4 × the clock period (see ClockPeriod()).
SCHED_OTHER
currently the same as SCHED_RR.
SCHED_SPORADIC
sporadic scheduling.
nd
The node descriptor of the remote node on which to spawn the child process. This member is used only if you set SPAWN_SETND in the flags member.

Note: If you want to spawn() remotely, set the nd member to the node descriptor. See the netmgr_strtond() function.

param
Scheduling parameters for the child process, if you set SPAWN_EXPLICIT_SCHED in the flags member. For more information, see the documentation for struct sched_param.

Классификация:

ЗОСРВ «Нейтрино»

Тематические ссылки:

spawn(), spawnp()




Предыдущий раздел: Описание API системной библиотеки