linux/include/uapi/linux/sched.h

/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#ifndef _UAPI_LINUX_SCHED_H
#define _UAPI_LINUX_SCHED_H

#include <linux/types.h>

/*
 * cloning flags:
 */
#define CSIGNAL
#define CLONE_VM
#define CLONE_FS
#define CLONE_FILES
#define CLONE_SIGHAND
#define CLONE_PIDFD
#define CLONE_PTRACE
#define CLONE_VFORK
#define CLONE_PARENT
#define CLONE_THREAD
#define CLONE_NEWNS
#define CLONE_SYSVSEM
#define CLONE_SETTLS
#define CLONE_PARENT_SETTID
#define CLONE_CHILD_CLEARTID
#define CLONE_DETACHED
#define CLONE_UNTRACED
#define CLONE_CHILD_SETTID
#define CLONE_NEWCGROUP
#define CLONE_NEWUTS
#define CLONE_NEWIPC
#define CLONE_NEWUSER
#define CLONE_NEWPID
#define CLONE_NEWNET
#define CLONE_IO

/* Flags for the clone3() syscall. */
#define CLONE_CLEAR_SIGHAND
#define CLONE_INTO_CGROUP

/*
 * cloning flags intersect with CSIGNAL so can be used with unshare and clone3
 * syscalls only:
 */
#define CLONE_NEWTIME

#ifndef __ASSEMBLY__
/**
 * struct clone_args - arguments for the clone3 syscall
 * @flags:        Flags for the new process as listed above.
 *                All flags are valid except for CSIGNAL and
 *                CLONE_DETACHED.
 * @pidfd:        If CLONE_PIDFD is set, a pidfd will be
 *                returned in this argument.
 * @child_tid:    If CLONE_CHILD_SETTID is set, the TID of the
 *                child process will be returned in the child's
 *                memory.
 * @parent_tid:   If CLONE_PARENT_SETTID is set, the TID of
 *                the child process will be returned in the
 *                parent's memory.
 * @exit_signal:  The exit_signal the parent process will be
 *                sent when the child exits.
 * @stack:        Specify the location of the stack for the
 *                child process.
 *                Note, @stack is expected to point to the
 *                lowest address. The stack direction will be
 *                determined by the kernel and set up
 *                appropriately based on @stack_size.
 * @stack_size:   The size of the stack for the child process.
 * @tls:          If CLONE_SETTLS is set, the tls descriptor
 *                is set to tls.
 * @set_tid:      Pointer to an array of type *pid_t. The size
 *                of the array is defined using @set_tid_size.
 *                This array is used to select PIDs/TIDs for
 *                newly created processes. The first element in
 *                this defines the PID in the most nested PID
 *                namespace. Each additional element in the array
 *                defines the PID in the parent PID namespace of
 *                the original PID namespace. If the array has
 *                less entries than the number of currently
 *                nested PID namespaces only the PIDs in the
 *                corresponding namespaces are set.
 * @set_tid_size: This defines the size of the array referenced
 *                in @set_tid. This cannot be larger than the
 *                kernel's limit of nested PID namespaces.
 * @cgroup:       If CLONE_INTO_CGROUP is specified set this to
 *                a file descriptor for the cgroup.
 *
 * The structure is versioned by size and thus extensible.
 * New struct members must go at the end of the struct and
 * must be properly 64bit aligned.
 */
struct clone_args {};
#endif

#define CLONE_ARGS_SIZE_VER0
#define CLONE_ARGS_SIZE_VER1
#define CLONE_ARGS_SIZE_VER2

/*
 * Scheduling policies
 */
#define SCHED_NORMAL
#define SCHED_FIFO
#define SCHED_RR
#define SCHED_BATCH
/* SCHED_ISO: reserved but not implemented yet */
#define SCHED_IDLE
#define SCHED_DEADLINE
#define SCHED_EXT

/* Can be ORed in to make sure the process is reverted back to SCHED_NORMAL on fork */
#define SCHED_RESET_ON_FORK

/*
 * For the sched_{set,get}attr() calls
 */
#define SCHED_FLAG_RESET_ON_FORK
#define SCHED_FLAG_RECLAIM
#define SCHED_FLAG_DL_OVERRUN
#define SCHED_FLAG_KEEP_POLICY
#define SCHED_FLAG_KEEP_PARAMS
#define SCHED_FLAG_UTIL_CLAMP_MIN
#define SCHED_FLAG_UTIL_CLAMP_MAX

#define SCHED_FLAG_KEEP_ALL

#define SCHED_FLAG_UTIL_CLAMP

#define SCHED_FLAG_ALL

#endif /* _UAPI_LINUX_SCHED_H */