The epoll behavior for Unix socket is:
1. If both sender and receiver are shutdown, Linux reports 'EPOLLHUP | EPOLLRDHUP | EPOLLRDNORM | EPOLLIN'
2. If only receiver is shutdown, Linux reports 'EPOLLRDHUP | EPOLLRDNORM | EPOLLIN'.
3. For EPOLL error, Linux reports it with other epoll events but not report epoll error only once error detected.
The current code for socket only handles 'CANTRCVMORE' (receiver shutdown) in kevent filter read and only handle 'CANTSENDMORE' in kevent filter write.
For Linux, the epoll behaviors, like pipe, socket, are quite different. And this patch creates a new mechanism to report epoll events according to each component, and this patch only fixes the socket case to align Linux epoll behavior, and other components, like pipe, can be improved based on the new mechanism.
Introduce 'pevents' in kevent to record the poll events, and handle them in 'linux_event.c' to report correct epoll events to match Linux behavior.
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=256952