mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-11-01 23:18:21 +00:00
jinx: update mlibc to have new system calls and add TERM=linux to /etc/profile
This commit is contained in:
@@ -6,3 +6,4 @@ WHITE="\e[1;37m"
|
|||||||
PS1="$GREEN\u$NORMAL@$BLUE\h$NORMAL:$WHITE\w$NORMAL>"
|
PS1="$GREEN\u$NORMAL@$BLUE\h$NORMAL:$WHITE\w$NORMAL>"
|
||||||
|
|
||||||
alias ls="ls --color=auto"
|
alias ls="ls --color=auto"
|
||||||
|
export TERM=linux
|
||||||
|
|||||||
@@ -59,8 +59,8 @@ 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-23 22:30:14.836379613 -0300
|
+++ mlibc/sysdeps/astral/generic/generic.cpp 2022-09-24 16:12:30.553142623 -0300
|
||||||
@@ -0,0 +1,248 @@
|
@@ -0,0 +1,259 @@
|
||||||
+#include <bits/ensure.h>
|
+#include <bits/ensure.h>
|
||||||
+#include <mlibc/debug.hpp>
|
+#include <mlibc/debug.hpp>
|
||||||
+#include <mlibc/all-sysdeps.hpp>
|
+#include <mlibc/all-sysdeps.hpp>
|
||||||
@@ -172,6 +172,17 @@ diff -ruN --no-dereference mlibc-3.0.0-rc1/sysdeps/astral/generic/generic.cpp ml
|
|||||||
+
|
+
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
|
+ int sys_read_entries(int handle, void *buffer, size_t max_size, size_t *bytes_read){
|
||||||
|
+
|
||||||
|
+ return syscall(SYSCALL_GETDIRENT, (long*)bytes_read, handle, (uint64_t)buffer, max_size);
|
||||||
|
+
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+
|
||||||
|
+ int sys_open_dir(const char *path, int *handle){
|
||||||
|
+ return sys_open(path, O_RDONLY | O_DIRECTORY, 0, handle);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
+ pid_t sys_getpid(){
|
+ pid_t sys_getpid(){
|
||||||
+ long ret;
|
+ long ret;
|
||||||
+ syscall(SYSCALL_GETPID, &ret);
|
+ syscall(SYSCALL_GETPID, &ret);
|
||||||
@@ -326,8 +337,8 @@ 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-23 00:03:59.546493191 -0300
|
+++ mlibc/sysdeps/astral/include/astral/syscall.h 2022-09-24 16:11:14.433143236 -0300
|
||||||
@@ -0,0 +1,45 @@
|
@@ -0,0 +1,46 @@
|
||||||
+#ifndef _SYSCALL_H_INCLUDE
|
+#ifndef _SYSCALL_H_INCLUDE
|
||||||
+#define _SYSCALL_H_INCLUDE
|
+#define _SYSCALL_H_INCLUDE
|
||||||
+
|
+
|
||||||
@@ -351,6 +362,7 @@ diff -ruN --no-dereference mlibc-3.0.0-rc1/sysdeps/astral/include/astral/syscall
|
|||||||
+#define SYSCALL_DUP2 17
|
+#define SYSCALL_DUP2 17
|
||||||
+#define SYSCALL_FCNTL 18
|
+#define SYSCALL_FCNTL 18
|
||||||
+#define SYSCALL_GETPID 19
|
+#define SYSCALL_GETPID 19
|
||||||
|
+#define SYSCALL_GETDIRENT 20
|
||||||
+
|
+
|
||||||
+#include <stddef.h>
|
+#include <stddef.h>
|
||||||
+#include <stdint.h>
|
+#include <stdint.h>
|
||||||
|
|||||||
Reference in New Issue
Block a user