Skip to contentSkip to conversation

sparc vs sparc64: O_NDELAY and O_NONBLOCK mismatch in kernel and in glibc

DISCUSSION David Miller 1 participant 1 message Aug 11, 2020

lore
Share & tools
lore
#0 lore raw

From: Sergei Trofimovich <[email protected]>
Date: Fri, 29 May 2020 10:40:19 +0100

Quoted 5 lines

Question time:

1. Why is sparc32 special? Does it have something to do with compatibility to other OSes of that time? (Solaris? BSD?)

Quoted 8 lines

fs/fcntl.c has kernel handling:

        /* required for strict SunOS emulation */
        if (O_NONBLOCK != O_NDELAY)
               if (arg & O_NDELAY)
                   arg |= O_NONBLOCK;

but why does it leak to to userspace header definition?

I think it should not.

The original sparc value was meant to match the SunOS value exactly in order to make the SunOS emulation support easier.

The current situation is a mess and I don't doubt that it accounts for various kinds of weird behavior we've seen over the years :-/