Berkeley description: A file descriptor argument was out
of range, referred to no open file, or a read (write) request was made
to a file that was only open for writing (reading).
Microsoft C description: Bad file number. The specified
file handle is not a valid file-handle value or does not refer to an
open file; or an attempt was made to write to a file or device opened
for read-only access (or vice versa).
WinSock description: No equivalent in WinSock. However,
because a BSD socket is equivalent to a file handle, some Windows
Sockets platforms provide some file handle and socket equivalency. In
this case, the WSAEBADF error might mean the same as a WSAENOTSOCK