Просмотр исходного кода

hppa: fix inotify/signalfd/timerfd flag values

parisc uses different O_* bits than the generic ABI (O_NONBLOCK is
000200004, O_CLOEXEC is 010000000).  IN_/SFD_/TFD_NONBLOCK and _CLOEXEC
are defined in terms of those, but hppa had no arch-specific
bits/{inotify,signalfd,timerfd}.h, so it inherited the generic 00004000 /
02000000 values.  inotify_init1(IN_NONBLOCK), signalfd(..., SFD_NONBLOCK)
and timerfd_create(..., TFD_NONBLOCK) therefore passed flags the parisc
kernel rejects with EINVAL, failing tst-inotify, tst-signalfd and
tst-timerfd.

Add hppa bits/inotify.h, bits/signalfd.h and bits/timerfd.h with the
parisc values, as already done for sparc and mips.

Verified with tst-inotify/tst-signalfd/tst-timerfd under qemu-system-hppa.

Signed-off-by: Ramin Moussavi <ramin.moussavi@yacoub.de>
Ramin Moussavi 1 неделя назад
Родитель
Сommit
2f8d80db7a

+ 19 - 0
libc/sysdeps/linux/hppa/bits/inotify.h

@@ -0,0 +1,19 @@
+/*
+ * Copyright (C) 2026 Ramin Moussavi <ramin.moussavi@yacoub.de>
+ *
+ * Licensed under the LGPL v2.1 or later, see the file COPYING.LIB
+ * in this tarball.
+ */
+
+#ifndef	_SYS_INOTIFY_H
+# error "Never use <bits/inotify.h> directly; include <sys/inotify.h> instead."
+#endif
+
+/* Flags for the parameter of inotify_init1.  */
+enum
+  {
+    IN_CLOEXEC = 010000000,
+#define IN_CLOEXEC IN_CLOEXEC
+    IN_NONBLOCK = 00200004
+#define IN_NONBLOCK IN_NONBLOCK
+  };

+ 19 - 0
libc/sysdeps/linux/hppa/bits/signalfd.h

@@ -0,0 +1,19 @@
+/*
+ * Copyright (C) 2026 Ramin Moussavi <ramin.moussavi@yacoub.de>
+ *
+ * Licensed under the LGPL v2.1 or later, see the file COPYING.LIB
+ * in this tarball.
+ */
+
+#ifndef	_SYS_SIGNALFD_H
+# error "Never use <bits/signalfd.h> directly; include <sys/signalfd.h> instead."
+#endif
+
+/* Flags for signalfd.  */
+enum
+  {
+    SFD_CLOEXEC = 010000000,
+#define SFD_CLOEXEC SFD_CLOEXEC
+    SFD_NONBLOCK = 00200004
+#define SFD_NONBLOCK SFD_NONBLOCK
+  };

+ 19 - 0
libc/sysdeps/linux/hppa/bits/timerfd.h

@@ -0,0 +1,19 @@
+/*
+ * Copyright (C) 2026 Ramin Moussavi <ramin.moussavi@yacoub.de>
+ *
+ * Licensed under the LGPL v2.1 or later, see the file COPYING.LIB
+ * in this tarball.
+ */
+
+#ifndef	_SYS_TIMERFD_H
+# error "Never use <bits/timerfd.h> directly; include <sys/timerfd.h> instead."
+#endif
+
+/* Bits to be set in the FLAGS parameter of `timerfd_create'.  */
+enum
+  {
+    TFD_CLOEXEC = 010000000,
+#define TFD_CLOEXEC TFD_CLOEXEC
+    TFD_NONBLOCK = 00200004
+#define TFD_NONBLOCK TFD_NONBLOCK
+  };