[Bug 51232] New: calling WsaGetLastError() after calling getsockopt() with a file descriptor that is not a socket differs from Windows

"WineHQ Bugzilla" <[email protected]>
Newsgroups gmane.comp.emulators.wine.bugs
Message-ID <[email protected]/>
https://bugs.winehq.org/show_bug.cgi?id=51232

            Bug ID: 51232
           Summary: calling WsaGetLastError() after calling getsockopt()
                    with a file descriptor that is not a socket differs
                    from Windows
           Product: Wine
           Version: 5.0.3
          Hardware: x86-64
                OS: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: -unknown
          Assignee: [email protected]
          Reporter: [email protected]
      Distribution: ---

Program: ZOC Terminal 8.02.4 (x64)



        int err, rc, type= 0, fd;
        socklen_t type_len= sizeof(type);
        fd= open("C:\somefile.txt", O_RDONLY);
        if (fd==-1)
             return;
        // fd is now a file descriptor for a file, not a socket.   
        rc= getsockopt(fd, SOL_SOCKET, SO_TYPE, (char *)&type, &type_len);
        err= WSAGetLastError();
        notasocket= (rc==-1 &&(err==WSAENOTSOCK);
        // notasocket is now FALSE, because Windows returns WSAENOTSOCK, but
Wine returns WSAEBADF
        // Linux returns ENOTSOCK, so the Windows WSAENOTSOCK is the best
representation of that

-- 
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.