x86 support!
This commit is contained in:
@@ -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? */
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user