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:
parent
83becbe369
commit
884984ae0a
@ -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,
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user