#endif
if (status < 0) {
+#ifdef HAVE_LINUX_TIMESTAMPING
+ /* If reading from the error queue failed, the exception should be
+ for a socket error. Clear the error to avoid a busy loop. */
+ if (flags & MSG_ERRQUEUE) {
+ int error = 0;
+ socklen_t len = sizeof (error);
+
+ if (getsockopt(sock_fd, SOL_SOCKET, SO_ERROR, &error, &len))
+ DEBUG_LOG("Could not get SO_ERROR");
+ if (error)
+ errno = error;
+ }
+#endif
+
DEBUG_LOG("Could not receive from fd %d : %s", sock_fd,
strerror(errno));
return;
SCMP_SYS(lseek), SCMP_SYS(rename), SCMP_SYS(stat), SCMP_SYS(stat64),
SCMP_SYS(statfs), SCMP_SYS(statfs64), SCMP_SYS(unlink),
/* Socket */
- SCMP_SYS(bind), SCMP_SYS(connect), SCMP_SYS(getsockname),
+ SCMP_SYS(bind), SCMP_SYS(connect), SCMP_SYS(getsockname), SCMP_SYS(getsockopt),
SCMP_SYS(recvfrom), SCMP_SYS(recvmmsg), SCMP_SYS(recvmsg),
SCMP_SYS(sendmmsg), SCMP_SYS(sendmsg), SCMP_SYS(sendto),
/* TODO: check socketcall arguments */