musl/arch
Rich Felker 6ad514e4e2 fix clash between sys/user.h and kernel ptrace.h on powerpc[64], sh
due to historical accident/sloppiness in glibc, the powerpc,
powerpc64, and sh versions of struct user, defined by sys/user.h, used
struct pt_regs from the kernel asm/ptrace.h for their regs member.
this made it impossible to define the type in an API-compatible manner
without either including asm/ptrace.h like glibc does (contrary to our
policy of not depending on kernel headers), or clashing with
asm/ptrace.h's definition of struct pt_regs if both headers are
included (which is almost always the case in software using
sys/user.h).

for a long time I viewed this problem as having no reasonable fix. I
even explored the possibility of having the powerpc[64] and sh
versions of user.h just include the kernel header (breaking with
policy), but that looked like it might introduce new clashes with
sys/ptrace.h. and it would also bring in a lot of additional cruft
that makes no sense for sys/user.h to expose. glibc goes out of its
way to suppress some of that with #undef, possibly leading to
different problems. this is a rabbit-hole that should be explored no
further.

as it turns out, however, nothing actually uses struct user
sufficiently to care about the type of the regs member; most software
including sys/user.h does not even use struct user at all. so, the
problem can be fixed just by doing away with the insistence on strict
glibc API compatibility for the struct tag of the regs member.

rather than renaming the tag, which might lead to the new name
entering use as API, simply use an untagged structure inside struct
user with the same members/layout as struct pt_regs.

for sh, struct pt_dspregs is just removed entirely since it was not
used.
2019-08-19 00:32:11 -04:00
..
aarch64 remove gratuitously-different arch-specific bits/ipc.h files 2019-07-30 14:23:56 -04:00
arm move IPC_STAT definition to a new bits/ipcstat.h file 2019-08-02 00:08:23 -04:00
generic move IPC_STAT definition to a new bits/ipcstat.h file 2019-08-02 00:08:23 -04:00
i386 move IPC_STAT definition to a new bits/ipcstat.h file 2019-08-02 00:08:23 -04:00
m68k move IPC_STAT definition to a new bits/ipcstat.h file 2019-08-02 00:08:23 -04:00
microblaze move IPC_STAT definition to a new bits/ipcstat.h file 2019-08-02 00:08:23 -04:00
mips move IPC_STAT definition to a new bits/ipcstat.h file 2019-08-02 00:08:23 -04:00
mips64 get/setsockopt: add fallback for new time64 SO_RCVTIMEO/SO_SNDTIMEO 2019-07-31 20:20:57 -04:00
mipsn32 move IPC_STAT definition to a new bits/ipcstat.h file 2019-08-02 00:08:23 -04:00
or1k move IPC_STAT definition to a new bits/ipcstat.h file 2019-08-02 00:08:23 -04:00
powerpc fix clash between sys/user.h and kernel ptrace.h on powerpc[64], sh 2019-08-19 00:32:11 -04:00
powerpc64 fix clash between sys/user.h and kernel ptrace.h on powerpc[64], sh 2019-08-19 00:32:11 -04:00
riscv64 re-add ELF gregs and fpregs types to riscv64 user.h 2019-08-13 22:05:38 -04:00
s390x remove gratuitously-different arch-specific bits/ipc.h files 2019-07-30 14:23:56 -04:00
sh fix clash between sys/user.h and kernel ptrace.h on powerpc[64], sh 2019-08-19 00:32:11 -04:00
x32 move IPC_64 from public bits/ipc.h to syscall_arch.h 2019-07-30 14:23:56 -04:00
x86_64 remove arch-specific bits/ipc.h that are identical to generic 2019-07-30 14:23:56 -04:00