Blame sysdeps/unix/sysv/linux/bits/sched.h

Packit 6c4009
/* Definitions of constants and data structure for POSIX 1003.1b-1993
Packit 6c4009
   scheduling interface.
Packit 6c4009
   Copyright (C) 1996-2018 Free Software Foundation, Inc.
Packit 6c4009
   This file is part of the GNU C Library.
Packit 6c4009
Packit 6c4009
   The GNU C Library is free software; you can redistribute it and/or
Packit 6c4009
   modify it under the terms of the GNU Lesser General Public
Packit 6c4009
   License as published by the Free Software Foundation; either
Packit 6c4009
   version 2.1 of the License, or (at your option) any later version.
Packit 6c4009
Packit 6c4009
   The GNU C Library is distributed in the hope that it will be useful,
Packit 6c4009
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 6c4009
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 6c4009
   Lesser General Public License for more details.
Packit 6c4009
Packit 6c4009
   You should have received a copy of the GNU Lesser General Public
Packit 6c4009
   License along with the GNU C Library; if not, see
Packit 6c4009
   <http://www.gnu.org/licenses/>.  */
Packit 6c4009
Packit 6c4009
#ifndef _BITS_SCHED_H
Packit 6c4009
#define _BITS_SCHED_H 1
Packit 6c4009
Packit 6c4009
#ifndef _SCHED_H
Packit 6c4009
# error "Never include <bits/sched.h> directly; use <sched.h> instead."
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
/* Scheduling algorithms.  */
Packit 6c4009
#define SCHED_OTHER		0
Packit 6c4009
#define SCHED_FIFO		1
Packit 6c4009
#define SCHED_RR		2
Packit 6c4009
#ifdef __USE_GNU
Packit 6c4009
# define SCHED_BATCH		3
Packit 6c4009
# define SCHED_ISO		4
Packit 6c4009
# define SCHED_IDLE		5
Packit 6c4009
# define SCHED_DEADLINE		6
Packit 6c4009
Packit 6c4009
# define SCHED_RESET_ON_FORK	0x40000000
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
#ifdef __USE_GNU
Packit 6c4009
/* Cloning flags.  */
Packit 6c4009
# define CSIGNAL       0x000000ff /* Signal mask to be sent at exit.  */
Packit 6c4009
# define CLONE_VM      0x00000100 /* Set if VM shared between processes.  */
Packit 6c4009
# define CLONE_FS      0x00000200 /* Set if fs info shared between processes.  */
Packit 6c4009
# define CLONE_FILES   0x00000400 /* Set if open files shared between processes.  */
Packit 6c4009
# define CLONE_SIGHAND 0x00000800 /* Set if signal handlers shared.  */
Packit 6c4009
# define CLONE_PTRACE  0x00002000 /* Set if tracing continues on the child.  */
Packit 6c4009
# define CLONE_VFORK   0x00004000 /* Set if the parent wants the child to
Packit 6c4009
				     wake it up on mm_release.  */
Packit 6c4009
# define CLONE_PARENT  0x00008000 /* Set if we want to have the same
Packit 6c4009
				     parent as the cloner.  */
Packit 6c4009
# define CLONE_THREAD  0x00010000 /* Set to add to same thread group.  */
Packit 6c4009
# define CLONE_NEWNS   0x00020000 /* Set to create new namespace.  */
Packit 6c4009
# define CLONE_SYSVSEM 0x00040000 /* Set to shared SVID SEM_UNDO semantics.  */
Packit 6c4009
# define CLONE_SETTLS  0x00080000 /* Set TLS info.  */
Packit 6c4009
# define CLONE_PARENT_SETTID 0x00100000 /* Store TID in userlevel buffer
Packit 6c4009
					   before MM copy.  */
Packit 6c4009
# define CLONE_CHILD_CLEARTID 0x00200000 /* Register exit futex and memory
Packit 6c4009
					    location to clear.  */
Packit 6c4009
# define CLONE_DETACHED 0x00400000 /* Create clone detached.  */
Packit 6c4009
# define CLONE_UNTRACED 0x00800000 /* Set if the tracing process can't
Packit 6c4009
				      force CLONE_PTRACE on this clone.  */
Packit 6c4009
# define CLONE_CHILD_SETTID 0x01000000 /* Store TID in userlevel buffer in
Packit 6c4009
					  the child.  */
Packit 6c4009
# define CLONE_NEWCGROUP    0x02000000	/* New cgroup namespace.  */
Packit 6c4009
# define CLONE_NEWUTS	0x04000000	/* New utsname group.  */
Packit 6c4009
# define CLONE_NEWIPC	0x08000000	/* New ipcs.  */
Packit 6c4009
# define CLONE_NEWUSER	0x10000000	/* New user namespace.  */
Packit 6c4009
# define CLONE_NEWPID	0x20000000	/* New pid namespace.  */
Packit 6c4009
# define CLONE_NEWNET	0x40000000	/* New network namespace.  */
Packit 6c4009
# define CLONE_IO	0x80000000	/* Clone I/O context.  */
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
#include <bits/types/struct_sched_param.h>
Packit 6c4009
Packit 6c4009
__BEGIN_DECLS
Packit 6c4009
Packit 6c4009
#ifdef __USE_GNU
Packit 6c4009
/* Clone current process.  */
Packit 6c4009
extern int clone (int (*__fn) (void *__arg), void *__child_stack,
Packit 6c4009
		  int __flags, void *__arg, ...) __THROW;
Packit 6c4009
Packit 6c4009
/* Unshare the specified resources.  */
Packit 6c4009
extern int unshare (int __flags) __THROW;
Packit 6c4009
Packit 6c4009
/* Get index of currently used CPU.  */
Packit 6c4009
extern int sched_getcpu (void) __THROW;
Packit 6c4009
Packit 6c4009
/* Switch process to namespace of type NSTYPE indicated by FD.  */
Packit 6c4009
extern int setns (int __fd, int __nstype) __THROW;
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
__END_DECLS
Packit 6c4009
Packit 6c4009
#endif /* bits/sched.h */