jinx: fix stupid bug in stat

This commit is contained in:
Matheus
2022-09-21 19:47:06 -03:00
parent a247137823
commit 76df387199
+8 -8
View File
@@ -1,6 +1,6 @@
diff -ruN --no-dereference mlibc-3.0.0-rc1/sysdeps/astral/crt-x86_64/crt0.S mlibc/sysdeps/astral/crt-x86_64/crt0.S
--- mlibc-3.0.0-rc1/sysdeps/astral/crt-x86_64/crt0.S 1969-12-31 21:00:00.000000000 -0300
+++ mlibc/sysdeps/astral/crt-x86_64/crt0.S 2022-09-21 16:39:16.115549200 -0300
+++ mlibc/sysdeps/astral/crt-x86_64/crt0.S 2022-09-21 18:37:56.035233535 -0300
@@ -0,0 +1,7 @@
+
+.section .text
@@ -11,7 +11,7 @@ diff -ruN --no-dereference mlibc-3.0.0-rc1/sysdeps/astral/crt-x86_64/crt0.S mlib
+
diff -ruN --no-dereference mlibc-3.0.0-rc1/sysdeps/astral/generic/astral.cpp mlibc/sysdeps/astral/generic/astral.cpp
--- mlibc-3.0.0-rc1/sysdeps/astral/generic/astral.cpp 1969-12-31 21:00:00.000000000 -0300
+++ mlibc/sysdeps/astral/generic/astral.cpp 2022-09-21 16:39:16.115549200 -0300
+++ mlibc/sysdeps/astral/generic/astral.cpp 2022-09-21 18:37:56.035233535 -0300
@@ -0,0 +1,6 @@
+#include <astral/syscall.h>
+
@@ -21,7 +21,7 @@ diff -ruN --no-dereference mlibc-3.0.0-rc1/sysdeps/astral/generic/astral.cpp mli
+}
diff -ruN --no-dereference mlibc-3.0.0-rc1/sysdeps/astral/generic/entry.cpp mlibc/sysdeps/astral/generic/entry.cpp
--- mlibc-3.0.0-rc1/sysdeps/astral/generic/entry.cpp 1969-12-31 21:00:00.000000000 -0300
+++ mlibc/sysdeps/astral/generic/entry.cpp 2022-09-21 16:39:16.115549200 -0300
+++ mlibc/sysdeps/astral/generic/entry.cpp 2022-09-21 18:37:56.035233535 -0300
@@ -0,0 +1,34 @@
+
+#include <stdint.h>
@@ -59,7 +59,7 @@ diff -ruN --no-dereference mlibc-3.0.0-rc1/sysdeps/astral/generic/entry.cpp mlib
+
diff -ruN --no-dereference mlibc-3.0.0-rc1/sysdeps/astral/generic/generic.cpp mlibc/sysdeps/astral/generic/generic.cpp
--- mlibc-3.0.0-rc1/sysdeps/astral/generic/generic.cpp 1969-12-31 21:00:00.000000000 -0300
+++ mlibc/sysdeps/astral/generic/generic.cpp 2022-09-21 16:59:53.195494350 -0300
+++ mlibc/sysdeps/astral/generic/generic.cpp 2022-09-21 19:25:33.425106934 -0300
@@ -0,0 +1,184 @@
+#include <bits/ensure.h>
+#include <mlibc/debug.hpp>
@@ -224,7 +224,7 @@ diff -ruN --no-dereference mlibc-3.0.0-rc1/sysdeps/astral/generic/generic.cpp ml
+ case fsfd_target::path:
+ return syscall(SYSCALL_STAT, &ret, (uint64_t)path, (uint64_t)statbuf);
+ case fsfd_target::fd:
+ return syscall(SYSCALL_FSTAT, &ret, (uint64_t)path, (uint64_t)statbuf);
+ return syscall(SYSCALL_FSTAT, &ret, fd, (uint64_t)statbuf);
+ default:
+ sys_libc_log("libc: sys_stat: Unknown fsfd target");
+ return ENOSYS;
@@ -247,7 +247,7 @@ diff -ruN --no-dereference mlibc-3.0.0-rc1/sysdeps/astral/generic/generic.cpp ml
+
diff -ruN --no-dereference mlibc-3.0.0-rc1/sysdeps/astral/include/astral/archctl.h mlibc/sysdeps/astral/include/astral/archctl.h
--- mlibc-3.0.0-rc1/sysdeps/astral/include/astral/archctl.h 1969-12-31 21:00:00.000000000 -0300
+++ mlibc/sysdeps/astral/include/astral/archctl.h 2022-09-21 16:39:16.115549200 -0300
+++ mlibc/sysdeps/astral/include/astral/archctl.h 2022-09-21 18:37:56.035233535 -0300
@@ -0,0 +1,11 @@
+#ifndef _ASTRAL_SYSCALL_ARCHCTL_INCLUDE
+#define _ASTRAL_SYSCALL_ARCHCTL_INCLUDE
@@ -262,7 +262,7 @@ diff -ruN --no-dereference mlibc-3.0.0-rc1/sysdeps/astral/include/astral/archctl
+#endif
diff -ruN --no-dereference mlibc-3.0.0-rc1/sysdeps/astral/include/astral/syscall.h mlibc/sysdeps/astral/include/astral/syscall.h
--- mlibc-3.0.0-rc1/sysdeps/astral/include/astral/syscall.h 1969-12-31 21:00:00.000000000 -0300
+++ mlibc/sysdeps/astral/include/astral/syscall.h 2022-09-21 16:39:16.115549200 -0300
+++ mlibc/sysdeps/astral/include/astral/syscall.h 2022-09-21 18:37:56.035233535 -0300
@@ -0,0 +1,41 @@
+#ifndef _SYSCALL_H_INCLUDE
+#define _SYSCALL_H_INCLUDE
@@ -307,7 +307,7 @@ diff -ruN --no-dereference mlibc-3.0.0-rc1/sysdeps/astral/include/astral/syscall
+#endif
diff -ruN --no-dereference mlibc-3.0.0-rc1/sysdeps/astral/meson.build mlibc/sysdeps/astral/meson.build
--- mlibc-3.0.0-rc1/sysdeps/astral/meson.build 1969-12-31 21:00:00.000000000 -0300
+++ mlibc/sysdeps/astral/meson.build 2022-09-21 16:57:16.082167989 -0300
+++ mlibc/sysdeps/astral/meson.build 2022-09-21 18:37:56.035233535 -0300
@@ -0,0 +1,63 @@
+
+rtdl_sources += files(