1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-01 04:58:35 +03:00

s3: Add poll_intr_one_fd

This commit is contained in:
Volker Lendecke 2011-02-08 17:33:59 +01:00 committed by Volker Lendecke
parent 83becbe369
commit 884984ae0a
2 changed files with 18 additions and 0 deletions

View File

@ -1334,6 +1334,7 @@ struct tevent_req *getaddrinfo_send(TALLOC_CTX *mem_ctx,
const struct addrinfo *hints);
int getaddrinfo_recv(struct tevent_req *req, struct addrinfo **res);
int poll_one_fd(int fd, int events, int timeout, int *revents);
int poll_intr_one_fd(int fd, int events, int timeout, int *revents);
struct tevent_req *tstream_read_packet_send(TALLOC_CTX *mem_ctx,
struct tevent_context *ev,
struct tstream_context *stream,

View File

@ -1793,3 +1793,20 @@ int poll_one_fd(int fd, int events, int timeout, int *revents)
return ret;
}
int poll_intr_one_fd(int fd, int events, int timeout, int *revents)
{
struct pollfd pfd;
int ret;
pfd.fd = fd;
pfd.events = events;
ret = sys_poll_intr(&pfd, 1, timeout);
if (ret <= 0) {
*revents = 0;
return ret;
}
*revents = pfd.revents;
return 1;
}