linux-parisc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH] parisc: Define O_NONBLOCK to become 000200000
@ 2020-08-29 12:20 Helge Deller
  2020-10-20 17:21 ` Jeroen Roovers
  0 siblings, 1 reply; 24+ messages in thread
From: Helge Deller @ 2020-08-29 12:20 UTC (permalink / raw)
  To: linux-parisc, James Bottomley, John David Anglin

HPUX has separate NDELAY & NONBLOCK values. In the past we wanted to
be able to run HP-UX binaries natively on parisc Linux which is why
we defined O_NONBLOCK to 000200004 to distinguish NDELAY & NONBLOCK
bits.
But with 2 bits set in this bitmask we often ran into compatibility
issues with other Linux applications which often only test one bit (or
even compare the values).

To avoid such issues in the future, this patch changes O_NONBLOCK to
become 000200000. That way old programs will still be functional, and
for new programs we now have only one bit set.

Update the comment about SOCK_NONBLOCK too.

Signed-off-by: Helge Deller <deller@gmx.de>

diff --git a/arch/parisc/include/asm/socket.h b/arch/parisc/include/asm/socket.h
index 79feff1b0721..33500c9f6e5e 100644
--- a/arch/parisc/include/asm/socket.h
+++ b/arch/parisc/include/asm/socket.h
@@ -4,8 +4,8 @@

 #include <uapi/asm/socket.h>

-/* O_NONBLOCK clashes with the bits used for socket types.  Therefore we
- * have to define SOCK_NONBLOCK to a different value here.
+/* O_NONBLOCK clashed with the bits used for socket types.  Therefore we
+ * had to define SOCK_NONBLOCK to a different value here.
  */
 #define SOCK_NONBLOCK	0x40000000

diff --git a/arch/parisc/include/uapi/asm/fcntl.h b/arch/parisc/include/uapi/asm/fcntl.h
index e19adc65b1d0..03dee816cb13 100644
--- a/arch/parisc/include/uapi/asm/fcntl.h
+++ b/arch/parisc/include/uapi/asm/fcntl.h
@@ -8,7 +8,7 @@
 #define O_LARGEFILE	000004000
 #define __O_SYNC	000100000
 #define O_SYNC		(__O_SYNC|O_DSYNC)
-#define O_NONBLOCK	000200004 /* HPUX has separate NDELAY & NONBLOCK */
+#define O_NONBLOCK	000200000
 #define O_NOCTTY	000400000 /* not fcntl */
 #define O_DSYNC		001000000
 #define O_NOATIME	004000000

^ permalink raw reply related	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2020-10-25 11:48 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-29 12:20 [RFC PATCH] parisc: Define O_NONBLOCK to become 000200000 Helge Deller
2020-10-20 17:21 ` Jeroen Roovers
2020-10-21  6:07   ` Helge Deller
2020-10-22 15:38     ` Jeroen Roovers
2020-10-22 16:14       ` Helge Deller
2020-10-22 16:40         ` [RFC PATCH] parisc: Add wrapper syscalls to fix O_NONBLOCK flag usage Helge Deller
2020-10-22 19:11           ` Meelis Roos
2020-10-22 20:29             ` Helge Deller
2020-10-23  7:02               ` Jeroen Roovers
2020-10-23  8:35                 ` Helge Deller
2020-10-23  8:53                   ` Jeroen Roovers
2020-10-23 18:15                     ` Helge Deller
2020-10-22 20:00           ` Jeroen Roovers
2020-10-23  7:25           ` Rolf Eike Beer
2020-10-23  8:18             ` Helge Deller
2020-10-23  8:31               ` Helge Deller
2020-10-23  8:58                 ` Rolf Eike Beer
2020-10-23 18:18           ` [RFC PATCH v3] " Helge Deller
2020-10-24  8:22             ` Jeroen Roovers
2020-10-24  8:24               ` Jeroen Roovers
2020-10-24  8:34                 ` Helge Deller
2020-10-24 14:11                   ` John David Anglin
2020-10-24  9:59             ` Jeroen Roovers
2020-10-25 11:48               ` Helge Deller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).