No description
  • C 97.9%
  • Assembly 1.4%
  • Makefile 0.3%
  • Perl 0.1%
Find a file
Kir Kolyshkin b3104d3d91 sched/headers: Move 'struct sched_param' out of uapi, to work around glibc/musl breakage
Both glibc and musl define 'struct sched_param' in sched.h, while kernel
has it in uapi/linux/sched/types.h, making it cumbersome to use
sched_getattr(2) or sched_setattr(2) from userspace.

For example, something like this:

	#include <sched.h>
	#include <linux/sched/types.h>

	struct sched_attr sa;

will result in "error: redefinition of ‘struct sched_param’" (note the
code doesn't need sched_param at all -- it needs struct sched_attr
plus some stuff from sched.h).

The situation is, glibc is not going to provide a wrapper for
sched_{get,set}attr, thus the need to include linux/sched_types.h
directly, which leads to the above problem.

Thus, the userspace is left with a few sub-par choices when it wants to
use e.g. sched_setattr(2), such as maintaining a copy of struct
sched_attr definition, or using some other ugly tricks.

OTOH, 'struct sched_param' is well known, defined in POSIX, and it won't
be ever changed (as that would break backward compatibility).

So, while 'struct sched_param' is indeed part of the kernel uapi,
exposing it the way it's done now creates an issue, and hiding it
(like this patch does) fixes that issue, hopefully without creating
another one: common userspace software rely on libc headers, and as
for "special" software (like libc), it looks like glibc and musl
do not rely on kernel headers for 'struct sched_param' definition
(but let's Cc their mailing lists in case it's otherwise).

The alternative to this patch would be to move struct sched_attr to,
say, linux/sched.h, or linux/sched/attr.h (the new file).

Oh, and here is the previous attempt to fix the issue:

  https://lore.kernel.org/all/20200528135552.GA87103@google.com/

While I support Linus arguments, the issue is still here
and needs to be fixed.

[ mingo: Linus is right, this shouldn't be needed - but on the other
         hand I agree that this header is not really helpful to
	 user-space as-is. So let's pretend that
	 <uapi/linux/sched/types.h> is only about sched_attr, and
	 call this commit a workaround for user-space breakage
	 that it in reality is ... Also, remove the Fixes tag. ]

Change-Id: I3943f8f4a11a9007ccc392de3ece9e62841e8fcb
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/20230808030357.1213829-1-kolyshkin@gmail.com
2025-06-28 22:04:18 -04:00
arch troika/kane: Disable useless CONFIG_DEVTMPFS 2025-02-05 13:33:58 -05:00
block Merge branch 'android-4.14-p' into android-exynos-4.14-ww-9610-minor_up-dev 2019-05-02 15:37:01 +09:00
certs This is the 4.14.69 stable release 2018-09-10 09:24:54 +02:00
crypto Merge branch 'android-4.14-p' into android-exynos-4.14-ww-9610-minor_up-dev 2019-05-02 15:37:01 +09:00
Documentation bpf: Add kconfig knob for disabling unpriv bpf by default 2024-05-16 10:58:25 +03:00
drivers UPSTREAM: HID: core: zero-initialize the report buffer 2025-03-07 00:33:17 -05:00
firmware [RAMEN9610-8778][9610] firmware: change acpm plugin type ihex to fw 2018-12-03 14:48:41 +09:00
fs Revert "fs: sdfat: Add config option to register sdFAT for VFAT" 2024-07-03 15:44:13 +00:00
include sched/headers: Move 'struct sched_param' out of uapi, to work around glibc/musl breakage 2025-06-28 22:04:18 -04:00
init bpf: Add kconfig knob for disabling unpriv bpf by default 2024-05-16 10:58:25 +03:00
ipc This is the 4.14.68 stable release 2018-09-05 12:21:00 +02:00
kernel UPSTREAM: bpf: fix rcu annotations in compute_effective_progs() 2024-05-16 10:58:26 +03:00
lib bpf: add also cbpf long jump test cases with heavy expansion 2024-05-16 10:58:25 +03:00
mm mm: prevent a warning when casting void* -> enum 2022-04-17 14:38:01 -04:00
net nl80211: add WPA3 definition for SAE authentication 2024-12-14 15:56:10 -05:00
samples samples/bpf: Fix the error return code of xdp_redirect's main() 2024-05-16 10:58:24 +03:00
scripts kbuild: use HOSTLDFLAGS for single .c executables 2022-11-02 16:16:07 -04:00
security UPSTREAM: security: selinux: allow per-file labeling for bpffs 2023-12-31 17:11:47 -05:00
sound UPSTREAM: ALSA: usb-audio: Fix a DMA to stack memory bug 2025-02-06 21:17:58 -05:00
tools bpf: Fix the off-by-two error in range markings 2024-05-16 10:58:25 +03:00
usr init: Add CONFIG_INITRAMFS_IGNORE_SKIP_FLAG 2023-11-27 14:54:28 -05:00
virt KVM: Reject device ioctls from processes other than the VM's creator 2019-04-03 06:25:20 +02:00
.cocciconfig
.get_maintainer.ignore
.gitattributes .gitattributes: set git diff driver for C source code files 2016-10-07 18:46:30 -07:00
.gitignore [RAMEN9610-14770] wlbt: .gitignore: ignore files generated during Q build 2019-06-28 23:44:55 +09:00
.mailmap .mailmap: Add Maciej W. Rozycki's Imagination e-mail address 2017-11-10 12:16:15 -08:00
Android.mk Android: Add empty Android.mk file 2022-01-21 17:22:01 +00:00
AndroidKernel.mk pass Q build 2021-02-07 17:37:02 +08:00
build.config.cuttlefish.aarch64 ANDROID: Move from clang r346389b to r349610. 2019-04-25 11:41:33 -07:00
build.config.cuttlefish.x86_64 ANDROID: Move from clang r346389b to r349610. 2019-04-25 11:41:33 -07:00
build.config.erd9610 [RAMEN9610-14519] Add config for support erd9610_Q_defconfig 2019-06-28 23:44:52 +09:00
build.config.erd9610_pqr [RAMEN9610-21772] arm64: configs: add erd9610_pqr_defconfig 2020-10-30 16:02:47 +08:00
build.config.goldfish.arm ANDROID: build.config: enforce trace_printk check 2018-05-04 15:22:33 -07:00
build.config.goldfish.arm64 ANDROID: build.config: enforce trace_printk check 2018-05-04 15:22:33 -07:00
build.config.goldfish.mips ANDROID: build.config: enforce trace_printk check 2018-05-04 15:22:33 -07:00
build.config.goldfish.mips64 ANDROID: build.config: enforce trace_printk check 2018-05-04 15:22:33 -07:00
build.config.goldfish.x86 ANDROID: build.config: enforce trace_printk check 2018-05-04 15:22:33 -07:00
build.config.goldfish.x86_64 ANDROID: build.config: enforce trace_printk check 2018-05-04 15:22:33 -07:00
COPYING
CREDITS MAINTAINERS: update TPM driver infrastructure changes 2017-11-09 17:58:40 -08:00
defconfig.mk clean the kernel configs and include samsung user kernel config by default 2021-02-07 17:36:55 +08:00
Kbuild License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
Kconfig License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
MAINTAINERS [RAMEN9610-21746]FROMLIST: HID: nintendo: add nintendo switch controller driver 2020-11-06 03:12:58 +09:00
Makefile remove libdss from Makefile 2022-01-21 17:22:00 +00:00
README README: add a new README file, pointing to the Documentation/ 2016-10-24 08:12:35 -02:00
verity_dev_keys.x509 x86_64_cuttlefish_defconfig: enable verity cert 2018-07-26 10:37:46 -07:00

Linux kernel
============

This file was moved to Documentation/admin-guide/README.rst

Please notice that there are several guides for kernel developers and users.
These guides can be rendered in a number of formats, like HTML and PDF.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.
See Documentation/00-INDEX for a list of what is contained in each file.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.