On Mon, May 27, 2024 at 08:27:28PM -0400, 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? > > [...] > > -current's manpage's BUGS entry implies, to me, that this distinction > is something of a historical accident that should be fixed, but, even > if that reading is correct, I'd still be curious where it came from.
In NetBSD's implementation, the distinction is a bug and there are (or were as of when I put that text in the man page) only a handful of cases where they're different, all of which could clearly be interpreted as mistakes. (I don't remember why cleaning them up wasn't on the agenda at the time, probably lack of immediate resources for tackling invasive patches.) The research I did when I rewrote the page indicated that it was correct for POLLRDNORM and POLLIN to be the same, but I don't remember the details. I can't remember or not if that involved finding and discounting docs that claimed POLLIN was the same as POLLRDNORM|POLLRDBAND, like the one cited upthread. I think it may have, because I definitely recall having to dig a fair amount to find anything other than the same set of vague descriptions we had in the older poll(2). I'm not sure if I have any notes from then, probably not. There are a whole bunch of remaining unanswered questions, though, which are sitting in PR 55983. -- David A. Holland dholl...@netbsd.org