The ioctl() calls using FIONREAD, FIONWRITE, FIONSPACE, and SIOCATMARK access the socket send or receive buffer. This is not possible for listening sockets since r319722. Since send()/recv() calls fail on listening sockets, fail also ioctl() indicating EINVAL.
This fixes Bug 250366.