mirror of
https://github.com/wiiu-env/wut.git
synced 2025-01-09 06:59:24 +01:00
19 lines
338 B
C
19 lines
338 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;
|
|
}
|