summaryrefslogtreecommitdiff
path: root/include/sched.h
AgeCommit message (Collapse)AuthorLines
2023-02-23fix incorrect unit for CPU_SETSIZE macroRich Felker-1/+1
this macro is supposed to reflect the number of members (bits) in cpu_set_t, not the storage size (bytes).
2020-09-09sched.h: add CLONE_NEWTIME from linux v5.6Szabolcs Nagy-0/+1
reuses a bit from CSIGNAL so it can only be used with unshare and clone3, added in linux commit 769071ac9f20b6a447410c7eaa55d1a5233ef40c ns: Introduce Time Namespace
2019-10-28prepare struct sched_param for change in time_t definitionRich Felker-0/+4
the time_t members in struct sched_param are just reserved space to preserve size and alignment. when time_t changes to 64-bit on 32-bit archs, this structure should not change. make definition conditional on _REDIR_TIME64 to match the size of the old time_t, which can be assumed to be long if _REDIR_TIME64 is defined.
2019-10-28add time64 symbol name redirects to public headers, under arch controlRich Felker-0/+4
a _REDIR_TIME64 macro is introduced, which the arch's alltypes.h is expected to define, to control redirection of symbol names for interfaces that involve time_t and derived types. this ensures that object files will only be linked to libc interfaces matching the ABI whose headers they were compiled against. along with time32 compat shims, which will be introduced separately, the redirection also makes it possible for a single libc (static or shared) to be used with object files produced with either the old (32-bit time_t) headers or the new ones after 64-bit time_t switchover takes place. mixing of such object files (or shared libraries) in the same program will also be possible, but must be done with care; ABI between libc and a consumer of the libc interfaces is guaranteed to match by the the symbol name redirection, but pairwise ABI between consumers of libc that define interfaces between each other in terms of time_t is not guaranteed to match. this change adds a dependency on an additional "GNU C" feature to the public headers for existing 32-bit archs, which is generally undesirable; however, the feature is one which glibc has depended on for a long time, and thus which any viable alternative compiler is going to need to provide. 64-bit archs are not affected, nor will future 32-bit archs be, regardless of whether they are "new" on the kernel side (e.g. riscv32) or just newly-added (e.g. a new sparc or xtensa port). the same applies to newly-added ABIs for existing machine-level archs.
2019-09-11sched.h: add CLONE_PIDFD from linux v5.2Szabolcs Nagy-0/+1
when set a pidfd is stored in parent_tidptr, see linux commit b3e5838252665ee4cfa76b82bdf1198dca81e5be clone: add CLONE_PIDFD
2019-08-14remove sporadic server members from struct sched_paramRich Felker-4/+6
these members are associated with an unsupported option group. with time_t changing size on 32-bit archs, all interfaces taking struct sched_param arguments would need redirection and compat shims in order to be able to continue offering these members, for no benefit. just convert them to reserved space instead.
2017-09-28fix use of memset without declaration in sched.h cpu set macrosRich Felker-0/+1
patch by Jörg Krause.
2016-09-19fix undefined behavior in sched.h cpu_set_t usageRich Felker-3/+3
since cpu sets can be dynamically allocated and have variable size, accessing their contents via ->__bits is not valid; performing pointer arithmetic outside the range of the size of the declared __bits array results in undefined beahavior. instead, only use cpu_set_t for fixed-size cpu set objects (instantiated by the caller) and as an abstract pointer type for dynamically allocated ones. perform all accesses simply by casting the abstract pointer type cpuset_t * back to unsigned long *.
2016-06-09add CLONE_NEWCGROUP clone flag, new in linux v4.6Szabolcs Nagy-0/+1
flag for new cgroup namespace, added in linux commit 5e2bec7c2248ae27c5b16cd97215ae05c1d39179
2016-03-02add sched_getcpuNathan Zadoks-0/+1
This is a GNU extension, but a fairly minor one, for a system call that otherwise has no libc wrapper.
2014-08-13fix CPU_EQUAL macro in sched.hSzabolcs Nagy-1/+1
2014-05-30add sched_{get,set}attr syscall numbers and SCHED_DEADLINE macroSzabolcs Nagy-0/+1
linux 3.14 introduced sched_getattr and sched_setattr syscalls in commit d50dde5a10f305253cbc3855307f608f8a3c5f73 and the related SCHED_DEADLINE scheduling policy in commit aab03e05e8f7e26f51dee792beddcb5cca9215a5 but struct sched_attr "extended scheduling parameters data structure" is not yet exported to userspace (necessary for using the syscalls) so related uapi definitions are not added yet.
2014-02-11fix signed and unsigned comparision in macros in public headersSzabolcs Nagy-1/+1
gcc -Wsign-compare warns about expanded macros that were defined in standard headers (before gcc 4.8) which can make builds fail that use -Werror. changed macros: WIFSIGNALED, __CPU_op_S
2013-08-10add cpu affinity interfacesRich Felker-0/+61
this first commit just includes the CPU_* and sched_* interfaces, not the pthread_* interfaces, which may be added later. simple sanity-check testing has been done for the basic interfaces, but most of the macros have not yet been tested.
2012-11-11add support for thread scheduling (POSIX TPS option)Rich Felker-0/+3
linux's sched_* syscalls actually implement the TPS (thread scheduling) functionality, not the PS (process scheduling) functionality which the sched_* functions are supposed to have. omitting support for the PS option (and having the sched_* interfaces fail with ENOSYS rather than omitting them, since some broken software assumes they exist) seems to be the only conforming way to do this on linux.
2012-09-08add acct, accept4, setns, and dup3 syscalls (linux extensions)Rich Felker-0/+1
based on patch by Justin Cormack
2012-09-07default features: make musl usable without feature test macrosRich Felker-0/+2
the old behavior of exposing nothing except plain ISO C can be obtained by defining __STRICT_ANSI__ or using a compiler option (such as -std=c99) that predefines it. the new default featureset is POSIX with XSI plus _BSD_SOURCE. any explicit feature test macros will inhibit the default. installation docs have also been updated to reflect this change.
2012-04-29add linux-specific unshare syscall wrapperRich Felker-0/+1
2011-09-18overhaul clone syscall wrappingRich Felker-0/+27
several things are changed. first, i have removed the old __uniclone function signature and replaced it with the "standard" linux __clone/clone signature. this was necessary to expose clone to applications anyway, and it makes it easier to port __clone to new archs, since it's now testable independently of pthread_create. secondly, i have removed all references to the ugly ldt descriptor structure (i386 only) from the c code and pthread structure. in places where it is needed, it is now created on the stack just when it's needed, in assembly code. thus, the i386 __clone function takes the desired thread pointer as its argument, rather than an ldt descriptor pointer, just like on all other sane archs. this should not affect applications since there is really no way an application can use clone with threads/tls in a way that doesn't horribly conflict with and clobber the underlying implementation's use. applications are expected to use clone only for creating actual processes, possibly with new namespace features and whatnot.
2011-02-12initial check-in, version 0.5.0v0.5.0Rich Felker-0/+37