tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: poll(): IN/OUT vs {RD,WR}NORM



Maybe not an explanation, but looking at the doc on OSX is maybe a bit of an explanation:

     POLLIN         Data other than high priority data may be read without
blocking. This is equivalent to ( POLLRDNORM | POLLRDBAND
                    ).

     POLLNVAL       The file descriptor is not open.  This flag is output
only, and ignored if present in the input events bitmask.

     POLLOUT        Normal data may be written without blocking.  This is
                    equivalent to POLLWRNORM.

     POLLPRI        High priority data may be read without blocking.

     POLLRDBAND     Priority data may be read without blocking.

     POLLRDNORM     Normal data may be read without blocking.

     POLLWRBAND     Priority data may be written without blocking.

     POLLWRNORM     Normal data may be written without blocking.

     The distinction between normal, priority, and high-priority data is
     specific to particular file types or devices.


Which could/would explain why POLLIN isn't equivalent to POLLRDNORM.

Also, I suspect mouse was thinking of the TCP URG concept, and not PUSH when he wrote what he did, but I don't know for sure.

  Johnny


On 2024-05-28 02:42, Simon Burge wrote:
Mouse wrote:

In sys/sys/poll.h, I see (in 1.4T, -current according to cvsweb, and
everything I've checked in between):

#define POLLIN          0x0001
#define POLLPRI         0x0002
#define POLLOUT         0x0004
#define POLLRDNORM      0x0040
#define POLLWRNORM      POLLOUT
#define POLLRDBAND      0x0080
#define POLLWRBAND      0x0100

I can understand treating POLLWRNORM as identical to POLLOUT.  But why
the distinction between POLLRDNORM and POLLIN?  Might anyone know the
reason and be willing to explain?

I'd hazard a guess that you'll likely not get an explanation.

...  I'd still be curious where it came from.

Those answers are CVS:

   thoreau 55002> cvs annotate -r1.1 sys/sys/poll.h | grep define.POLL
   Annotations for sys/sys/poll.h
   ***************
   1.1          (mycroft  07-Sep-96): #define        POLLIN          0x0001
   1.1          (mycroft  07-Sep-96): #define        POLLPRI         0x0002
   1.1          (mycroft  07-Sep-96): #define        POLLOUT         0x0004
   1.1          (mycroft  07-Sep-96): #define        POLLRDNORM      0x0040
   1.1          (mycroft  07-Sep-96): #define        POLLWRNORM      POLLOUT
   1.1          (mycroft  07-Sep-96): #define        POLLRDBAND      0x0080
   1.1          (mycroft  07-Sep-96): #define        POLLWRBAND      0x0100
   1.1          (mycroft  07-Sep-96): #define        POLLERR         0x0008
   1.1          (mycroft  07-Sep-96): #define        POLLHUP         0x0010
   1.1          (mycroft  07-Sep-96): #define        POLLNVAL        0x0020
   thoreau 55003> cvs log -N -r1.1 sys/sys/poll.h
   ...
   ----------------------------
   revision 1.1
   date: 1996-09-08 03:42:49 +1000;  author: mycroft;  state: Exp;
   Definitions for poll(2).  Prototype it here.
   =============================================================================

Cheers,
Simon.

--
Johnny Billquist                  || "I'm on a bus
                                  ||  on a psychedelic trip
email: bqt%softjar.se@localhost             ||  Reading murder books
pdp is alive!                     ||  tryin' to stay hip" - B. Idol


Home | Main Index | Thread Index | Old Index