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 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-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 @@ @@ -0,0 +1,7 @@
+ +
+.section .text +.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 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-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 @@ @@ -0,0 +1,6 @@
+#include <astral/syscall.h> +#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 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-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 @@ @@ -0,0 +1,34 @@
+ +
+#include <stdint.h> +#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 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-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 @@ @@ -0,0 +1,184 @@
+#include <bits/ensure.h> +#include <bits/ensure.h>
+#include <mlibc/debug.hpp> +#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: + case fsfd_target::path:
+ return syscall(SYSCALL_STAT, &ret, (uint64_t)path, (uint64_t)statbuf); + return syscall(SYSCALL_STAT, &ret, (uint64_t)path, (uint64_t)statbuf);
+ case fsfd_target::fd: + 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: + default:
+ sys_libc_log("libc: sys_stat: Unknown fsfd target"); + sys_libc_log("libc: sys_stat: Unknown fsfd target");
+ return ENOSYS; + 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 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-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 @@ @@ -0,0 +1,11 @@
+#ifndef _ASTRAL_SYSCALL_ARCHCTL_INCLUDE +#ifndef _ASTRAL_SYSCALL_ARCHCTL_INCLUDE
+#define _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 +#endif
diff -ruN --no-dereference mlibc-3.0.0-rc1/sysdeps/astral/include/astral/syscall.h mlibc/sysdeps/astral/include/astral/syscall.h 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-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 @@ @@ -0,0 +1,41 @@
+#ifndef _SYSCALL_H_INCLUDE +#ifndef _SYSCALL_H_INCLUDE
+#define _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 +#endif
diff -ruN --no-dereference mlibc-3.0.0-rc1/sysdeps/astral/meson.build mlibc/sysdeps/astral/meson.build 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-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 @@ @@ -0,0 +1,63 @@
+ +
+rtdl_sources += files( +rtdl_sources += files(