parisc: Add wrapper syscalls to fix O_NONBLOCK flag usage
authorHelge Deller <deller@gmx.de>
Thu, 22 Oct 2020 16:40:07 +0000 (18:40 +0200)
committerHelge Deller <deller@gmx.de>
Fri, 23 Oct 2020 18:14:07 +0000 (20:14 +0200)
commit44a4c9e443674e6cd3368d3e642dfe9c429d5525
treec5fd06a96b1b0a190434fdbf1ad91406c6871086
parent879bc2d27904354b98ca295b6168718e045c4aa2
parisc: Add wrapper syscalls to fix O_NONBLOCK flag usage

The commit 75ae04206a4d ("parisc: Define O_NONBLOCK to become
000200000") changed the O_NONBLOCK constant to have only one bit set
(like all other architectures). This change broke some existing
userspace code (e.g.  udevadm, systemd-udevd, elogind) which called
specific syscalls which do strict value checking on their flag
parameter.

This patch adds wrapper functions for the relevant syscalls. The
wrappers masks out any old invalid O_NONBLOCK flags, reports in the
syslog if the old O_NONBLOCK value was used and then calls the target
syscall with the new O_NONBLOCK value.

Fixes: 75ae04206a4d ("parisc: Define O_NONBLOCK to become 000200000")
Signed-off-by: Helge Deller <deller@gmx.de>
Tested-by: Meelis Roos <mroos@linux.ee>
Tested-by: Jeroen Roovers <jer@xs4all.nl>
arch/parisc/kernel/sys_parisc.c
arch/parisc/kernel/syscalls/syscall.tbl