cheesestraws
Well-known member
While I've been away from home I've been playing with writing a hybrid A/UX application or two.
I'm hitting a very strange thing, and I'm posting in case anyone has any ideas. I'm using ordinary UNIX sockets for TCP, using the normal send/recv affair.
Every so often, after somewhere between a minute and an hour of runtime, send() returns an error with errno=58, which according to sys/errno.h is ENOTSOCK.
Which is odd, because it's very definitely a socket. And recv() can carry on receiving on that socket, and netstat -a shows the connection as ESTABLISHED.
Digging into the kernel with Ghidra suggests that the thing that returns ENOTSOCK is getsock(), which maps from a file descriptor to an internal file struct (following the cognate code in the OpenBSD kernel for types).
I can't find anything else raising that error.
So, how come send() is deciding my socket isn't a socket? How come recv, despite also calling getsock, isn't seeing this? Has anyone else seen this before? How long is a piece of string? Whither must I wander? What is the airspeed velocity of an unladen swallow?
Urgh
I'm hitting a very strange thing, and I'm posting in case anyone has any ideas. I'm using ordinary UNIX sockets for TCP, using the normal send/recv affair.
Every so often, after somewhere between a minute and an hour of runtime, send() returns an error with errno=58, which according to sys/errno.h is ENOTSOCK.
Which is odd, because it's very definitely a socket. And recv() can carry on receiving on that socket, and netstat -a shows the connection as ESTABLISHED.
Digging into the kernel with Ghidra suggests that the thing that returns ENOTSOCK is getsock(), which maps from a file descriptor to an internal file struct (following the cognate code in the OpenBSD kernel for types).
I can't find anything else raising that error.
So, how come send() is deciding my socket isn't a socket? How come recv, despite also calling getsock, isn't seeing this? Has anyone else seen this before? How long is a piece of string? Whither must I wander? What is the airspeed velocity of an unladen swallow?
Urgh