Hello!
> purpose but, unfortunately, it is not maskable (why ???).
Standards require this.
Apparently, SVR4 poll() was not designed to understand bidirectional close.
It was mainly for terminal io and does not fit even for wouldbe generic
STREAMS io.
It can be modified to make _maskable_ POLLINEOF to get close
in read direction and _maskable_ POLLOUTEOF to invalidate write direction.
And reserving unmaskable POLLHUP for the case, when no io events
are expected in future. But even existing SVR4 interface is still
enough for any practical purposes yet.
> Write succeeds in this case, I tested it,
It succeeds locally by the same reason, why this condition is not
set in poll. We simply do not know this at the moment of write()/poll().
But after rtt the connection will be reset and POLLERR will be set.
Alexey
|