about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--src/wrapped/generated/functions_list.txt5
-rw-r--r--src/wrapped/generated/wrappedlibctypes.h5
-rwxr-xr-xsrc/wrapped/wrappedlibc.c9
-rwxr-xr-xsrc/wrapped/wrappedlibc_private.h3
4 files changed, 22 insertions, 0 deletions
diff --git a/src/wrapped/generated/functions_list.txt b/src/wrapped/generated/functions_list.txt
index f10a0886..2b0b9570 100644
--- a/src/wrapped/generated/functions_list.txt
+++ b/src/wrapped/generated/functions_list.txt
@@ -2681,6 +2681,8 @@ wrappedlibc:
 - vFpV:
   - warn
   - warnx
+- iFip:
+  - fstat
 - iFpi:
   - __sigsetjmp
   - backtrace
@@ -2691,6 +2693,7 @@ wrappedlibc:
   - dl_iterate_phdr
   - execv
   - execvp
+  - lstat
   - sigaltstack
   - stat
   - swapcontext
@@ -2796,6 +2799,8 @@ wrappedlibc:
   - semctl
 - iFipii:
   - epoll_wait
+- iFippi:
+  - fstatat
 - iFippL:
   - readlinkat
 - iFpipp:
diff --git a/src/wrapped/generated/wrappedlibctypes.h b/src/wrapped/generated/wrappedlibctypes.h
index f0a1e0c3..8aabf49e 100644
--- a/src/wrapped/generated/wrappedlibctypes.h
+++ b/src/wrapped/generated/wrappedlibctypes.h
@@ -24,6 +24,7 @@ typedef void (*vFpi_t)(void*, int64_t);
 typedef void (*vFpu_t)(void*, uint64_t);
 typedef void (*vFpp_t)(void*, void*);
 typedef void (*vFpV_t)(void*, ...);
+typedef int64_t (*iFip_t)(int64_t, void*);
 typedef int64_t (*iFpi_t)(void*, int64_t);
 typedef int64_t (*iFpL_t)(void*, uintptr_t);
 typedef int64_t (*iFpp_t)(void*, void*);
@@ -56,6 +57,7 @@ typedef void (*vFpLLp_t)(void*, uintptr_t, uintptr_t, void*);
 typedef int64_t (*iFiiip_t)(int64_t, int64_t, int64_t, void*);
 typedef int64_t (*iFiiiN_t)(int64_t, int64_t, int64_t, ...);
 typedef int64_t (*iFipii_t)(int64_t, void*, int64_t, int64_t);
+typedef int64_t (*iFippi_t)(int64_t, void*, void*, int64_t);
 typedef int64_t (*iFippL_t)(int64_t, void*, void*, uintptr_t);
 typedef int64_t (*iFpipp_t)(void*, int64_t, void*, void*);
 typedef int64_t (*iFpipV_t)(void*, int64_t, void*, ...);
@@ -109,6 +111,7 @@ typedef int64_t (*iFppipppp_t)(void*, void*, int64_t, void*, void*, void*, void*
 	GO(tdestroy, vFpp_t) \
 	GO(warn, vFpV_t) \
 	GO(warnx, vFpV_t) \
+	GO(fstat, iFip_t) \
 	GO(__sigsetjmp, iFpi_t) \
 	GO(backtrace, iFpi_t) \
 	GO(munmap, iFpL_t) \
@@ -116,6 +119,7 @@ typedef int64_t (*iFppipppp_t)(void*, void*, int64_t, void*, void*, void*, void*
 	GO(dl_iterate_phdr, iFpp_t) \
 	GO(execv, iFpp_t) \
 	GO(execvp, iFpp_t) \
+	GO(lstat, iFpp_t) \
 	GO(sigaltstack, iFpp_t) \
 	GO(stat, iFpp_t) \
 	GO(swapcontext, iFpp_t) \
@@ -192,6 +196,7 @@ typedef int64_t (*iFppipppp_t)(void*, void*, int64_t, void*, void*, void*, void*
 	GO(epoll_ctl, iFiiip_t) \
 	GO(semctl, iFiiiN_t) \
 	GO(epoll_wait, iFipii_t) \
+	GO(fstatat, iFippi_t) \
 	GO(readlinkat, iFippL_t) \
 	GO(__vasprintf_chk, iFpipp_t) \
 	GO(glob, iFpipp_t) \
diff --git a/src/wrapped/wrappedlibc.c b/src/wrapped/wrappedlibc.c
index b33d67bd..6105f347 100755
--- a/src/wrapped/wrappedlibc.c
+++ b/src/wrapped/wrappedlibc.c
@@ -1100,6 +1100,15 @@ EXPORT int my_fstat(x64emu_t *emu, int fd, void* buf)
     return r;
 }
 
+EXPORT int my_fstatat(x64emu_t *emu, int fd, const char* path, void* buf, int flags)
+{
+    (void)emu;
+    struct stat64 st;
+    int r = fstatat(fd, path, (struct stat*)&st, flags);
+    UnalignStat64(&st, buf);
+    return r;
+}
+
 EXPORT int my__IO_file_stat(x64emu_t* emu, void* f, void* buf)
 {
     struct stat64 st;
diff --git a/src/wrapped/wrappedlibc_private.h b/src/wrapped/wrappedlibc_private.h
index c9617678..5757207e 100755
--- a/src/wrapped/wrappedlibc_private.h
+++ b/src/wrapped/wrappedlibc_private.h
@@ -426,6 +426,8 @@ GO(__fsetlocking, iFpi)
 GO(fsetpos, iFpp)
 GO(fsetpos64, iFpp)
 GO(fsetxattr, iFippLi)
+GOM(fstat, iFip)            //%noE
+GOM(fstatat, iFippi)        //%noE
 GOW(fstatfs, iFip)
 GOW(fstatfs64, iFip)
 GOW(fstatvfs, iFip)
@@ -1101,6 +1103,7 @@ GO(__lseek, IFiIi)
 GOW(lseek, lFili)
 GOW(lseek64, lFili)
 GO(lsetxattr, iFpppLi)
+GOM(lstat, iFpp)            //%noE
 GO(lutimes, iFpp)
 GOM(__lxstat, iFEipp)
 GOM(__lxstat64, iFEipp)