Commit c8990b0f authored by topjohnwu's avatar topjohnwu

Rewrite UID tracking

parent 7dced4b9
...@@ -288,6 +288,14 @@ int xfstat(int fd, struct stat *buf) { ...@@ -288,6 +288,14 @@ int xfstat(int fd, struct stat *buf) {
return ret; return ret;
} }
int xfstatat(int dirfd, const char *pathname, struct stat *buf, int flags) {
int ret = fstatat(dirfd, pathname, buf, flags);
if (ret < 0) {
PLOGE("fstatat %s", pathname);
}
return ret;
}
int xdup(int fd) { int xdup(int fd) {
int ret = dup(fd); int ret = dup(fd);
if (ret < 0) { if (ret < 0) {
......
...@@ -26,9 +26,9 @@ int xbind(int sockfd, const struct sockaddr *addr, socklen_t addrlen); ...@@ -26,9 +26,9 @@ int xbind(int sockfd, const struct sockaddr *addr, socklen_t addrlen);
int xconnect(int sockfd, const struct sockaddr *addr, socklen_t addrlen); int xconnect(int sockfd, const struct sockaddr *addr, socklen_t addrlen);
int xlisten(int sockfd, int backlog); int xlisten(int sockfd, int backlog);
int xaccept4(int sockfd, struct sockaddr *addr, socklen_t *addrlen, int flags); int xaccept4(int sockfd, struct sockaddr *addr, socklen_t *addrlen, int flags);
extern "C" void *xmalloc(size_t size); void *xmalloc(size_t size);
extern "C" void *xcalloc(size_t nmemb, size_t size); void *xcalloc(size_t nmemb, size_t size);
extern "C" void *xrealloc(void *ptr, size_t size); void *xrealloc(void *ptr, size_t size);
ssize_t xsendmsg(int sockfd, const struct msghdr *msg, int flags); ssize_t xsendmsg(int sockfd, const struct msghdr *msg, int flags);
ssize_t xrecvmsg(int sockfd, struct msghdr *msg, int flags); ssize_t xrecvmsg(int sockfd, struct msghdr *msg, int flags);
int xpthread_create(pthread_t *thread, const pthread_attr_t *attr, int xpthread_create(pthread_t *thread, const pthread_attr_t *attr,
...@@ -37,6 +37,7 @@ int xaccess(const char *path, int mode); ...@@ -37,6 +37,7 @@ int xaccess(const char *path, int mode);
int xstat(const char *pathname, struct stat *buf); int xstat(const char *pathname, struct stat *buf);
int xlstat(const char *pathname, struct stat *buf); int xlstat(const char *pathname, struct stat *buf);
int xfstat(int fd, struct stat *buf); int xfstat(int fd, struct stat *buf);
int xfstatat(int dirfd, const char *pathname, struct stat *buf, int flags);
int xdup(int fd); int xdup(int fd);
int xdup2(int oldfd, int newfd); int xdup2(int oldfd, int newfd);
int xdup3(int oldfd, int newfd, int flags); int xdup3(int oldfd, int newfd, int flags);
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment