fdtrack: add wrappers for epoll_create, epoll_create1.
Bug: https://issuetracker.google.com/154450436 Test: bionic-unit-tests Change-Id: I6c881e5d67596c543526536541d5b8086e21d9e9
This commit is contained in:
parent
1fad5283a0
commit
a38331d833
|
@ -308,7 +308,7 @@ ssize_t tee(int, int, size_t, unsigned int) all
|
|||
ssize_t splice(int, off64_t*, int, off64_t*, size_t, unsigned int) all
|
||||
ssize_t vmsplice(int, const struct iovec*, size_t, unsigned int) all
|
||||
|
||||
int epoll_create1(int) all
|
||||
int __epoll_create1:epoll_create1(int) all
|
||||
int epoll_ctl(int, int op, int, struct epoll_event*) all
|
||||
int __epoll_pwait:epoll_pwait(int, struct epoll_event*, int, int, const sigset64_t*, size_t) all
|
||||
|
||||
|
|
|
@ -30,7 +30,9 @@
|
|||
#include <sys/epoll.h>
|
||||
|
||||
#include "private/SigSetConverter.h"
|
||||
#include "private/bionic_fdtrack.h"
|
||||
|
||||
extern "C" int __epoll_create1(int flags);
|
||||
extern "C" int __epoll_pwait(int, epoll_event*, int, int, const sigset64_t*, size_t);
|
||||
|
||||
int epoll_create(int size) {
|
||||
|
@ -38,7 +40,11 @@ int epoll_create(int size) {
|
|||
errno = EINVAL;
|
||||
return -1;
|
||||
}
|
||||
return epoll_create1(0);
|
||||
return FDTRACK_CREATE(__epoll_create1(0));
|
||||
}
|
||||
|
||||
int epoll_create1(int flags) {
|
||||
return FDTRACK_CREATE(__epoll_create1(flags));
|
||||
}
|
||||
|
||||
int epoll_pwait(int fd, epoll_event* events, int max_events, int timeout, const sigset_t* ss) {
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
#include <fcntl.h>
|
||||
#include <netinet/in.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/epoll.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
|
||||
|
@ -201,6 +202,9 @@ FDTRACK_TEST(pipe2, ({
|
|||
fds;
|
||||
}));
|
||||
|
||||
FDTRACK_TEST(epoll_create, epoll_create(1));
|
||||
FDTRACK_TEST(epoll_create1, epoll_create1(0));
|
||||
|
||||
#if 0
|
||||
// Why is this generating an extra socket/close event?
|
||||
FDTRACK_TEST(accept, ({
|
||||
|
|
Loading…
Reference in New Issue