diff --git a/libc/sysdeps/linux/common/openat64.c b/libc/sysdeps/linux/common/openat64.c
index eda3e7db1..cd1b23fa5 100644
--- a/libc/sysdeps/linux/common/openat64.c
+++ b/libc/sysdeps/linux/common/openat64.c
@@ -9,10 +9,18 @@
 #include <_lfs_64.h>
 #include <sys/syscall.h>
 #include <fcntl.h>
+#include <stdarg.h>
 
 #ifdef __NR_openat
-static int __openat64(int fd, const char *file, int oflag, mode_t mode)
+static int __openat64(int fd, const char *file, int oflag, ...)
 {
+	va_list ap;
+	mode_t mode;
+
+	va_start(ap, oflag);
+	mode = va_arg(ap, int);
+	va_end(ap);
+
 	return openat(fd, file, oflag | O_LARGEFILE, mode);
 }
 strong_alias_untyped(__openat64,openat64)
diff --git a/libc/sysdeps/linux/common/stat.c b/libc/sysdeps/linux/common/stat.c
index a860c0c7f..99ce8d2dd 100644
--- a/libc/sysdeps/linux/common/stat.c
+++ b/libc/sysdeps/linux/common/stat.c
@@ -25,7 +25,7 @@ int stat(const char *file_name, struct stat *buf)
 
 int stat(const char *file_name, struct stat *buf)
 {
-	return fstatat64(AT_FDCWD, file_name, buf, 0);
+	return fstatat64(AT_FDCWD, file_name, (struct stat64 *)buf, 0);
 }
 #elif __NR_statx && defined __UCLIBC_HAVE_STATX__
 # include <fcntl.h>
