wut/libraries/wutsocket/sockatmark.c
GaryOderNichts 2c98cc91aa
Some checks failed
C/C++ CI / ubuntu-latest (push) Has been cancelled
Run clang-format
`find . -regex '.*\.\(cpp\|hpp\|cu\|cuh\|c\|h\)' -exec clang-format -style=file -i {} \;`
2025-06-05 11:06:04 +01:00

20 lines
342 B
C

#include "wut_socket.h"
int
sockatmark(int sockfd)
{
char buf[1];
int rc;
sockfd = __wut_get_nsysnet_fd(sockfd);
rc = RPLWRAP(recv)(sockfd, buf, sizeof(buf), MSG_OOB | MSG_PEEK | MSG_DONTWAIT);
if (rc > 0) {
return 1;
}
rc = __wut_get_nsysnet_result(NULL, rc);
return (errno == EWOULDBLOCK) ? 0 : rc;
}