Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ipc/shm: uapi: remove dependency on libc

Using libc types and headers from the UAPI headers is problematic as it
introduces a dependency on a full C toolchain. shm.h does not even use
any symbols from the libc header as the usage of getpagesize() was removed
a decade ago in commit 060028bac94b ("ipc/shm.c: increase the defaults for
SHMALL, SHMMAX")

Drop the unnecessary inclusion.

Link: https://lkml.kernel.org/r/20251222-uapi-shm-v1-1-270bb7f75d97@linutronix.de
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Cc: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Thomas Weißschuh and committed by
Andrew Morton
1965bbb8 d30aca3e

-3
-3
include/uapi/linux/shm.h
··· 5 5 #include <linux/ipc.h> 6 6 #include <linux/errno.h> 7 7 #include <asm-generic/hugetlb_encode.h> 8 - #ifndef __KERNEL__ 9 - #include <unistd.h> 10 - #endif 11 8 12 9 /* 13 10 * SHMMNI, SHMMAX and SHMALL are default upper limits which can be