Fix openat mode argument on x86_64

This commit is contained in:
Lucas Schumacher 2025-04-27 01:52:39 -04:00
parent 39e797f937
commit eda1bbca23

View File

@ -55,7 +55,7 @@ uint32_t fork() {
int32_t openat(int32_t fd, const char* filename, uint32_t flags, uint32_t mode) {
int32_t file;
asm volatile (
"mov %%r10, %5\n"
"mov %5, %%r10\n"
"syscall\n"
: "=a"(file)
: "a"(SYS_OPENAT), "D"(fd), "S"(filename), "d"(flags), "r"((uint64_t)mode) // RDI, RSI, RDX are used in x86-64 for write args