[Bug 51232] New: calling WsaGetLastError() after calling getsockopt() with a file descriptor that is not a socket differs from Windows
WineHQ Bugzilla
wine-bugs at winehq.org
Mon Jun 7 03:29:51 CDT 2021
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: wine-bugs at winehq.org
Reporter: michaela at molthagen.de
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.
More information about the wine-bugs
mailing list