x86 support!

This commit is contained in:
veclavtlica
2026-10-08 10:50:42 +03:00
parent 3db75378c4
commit dc594e5e82
5 changed files with 126 additions and 3 deletions
+2 -2
View File
@@ -6,7 +6,6 @@
#include "../std.h"
#include <fcntl.h>
#include <stdarg.h>
#include <stdint.h>
#include <sys/socket.h>
#include <sys/un.h>
@@ -20,7 +19,7 @@ inline com_std_fd com_std_open(char *path, uint32_t flags) {
long ret;
__asm__ volatile("syscall"
: "=a"(ret)
: "a"(2), "D"(path), "S"(mode)
: "a"(2), "D"(path), "S"(mode), "d"(0)
: "rcx", "r11", "memory");
if (ret <= 0) /* Mark NULL, removing error code */
ret = 0;
@@ -90,4 +89,5 @@ inline void com_std_exit(uint32_t status) {
inline void com_std_close(com_std_fd fd) {
__asm__ volatile("syscall" : : "a"(3), "D"(fd) : "rcx", "r11", "memory");
/* TODO: At least assert for bad descriptor for debug? */
}