diff --git a/libs/libc/include/luna/syscall.h b/libs/libc/include/luna/syscall.h index d2310be0..3f46dd27 100644 --- a/libs/libc/include/luna/syscall.h +++ b/libs/libc/include/luna/syscall.h @@ -1,43 +1,21 @@ #ifndef _LUNA_SYSCALL_H #define _LUNA_SYSCALL_H -#define SYS_exit 0 -#define SYS_yield 1 -#define SYS_sleep 2 -#define SYS_write 3 -#define SYS_paint 4 -#define SYS_getprocid 5 -#define SYS_mmap 6 -#define SYS_munmap 7 -#define SYS_open 8 -#define SYS_read 9 -#define SYS_close 10 -#define SYS_seek 11 -#define SYS_exec 12 -#define SYS_fcntl 13 -#define SYS_mprotect 14 -#define SYS_clock 15 -#define SYS_mkdir 16 -#define SYS_fork 17 -#define SYS_waitpid 18 - -#ifndef __want_syscalls #ifdef __cplusplus extern "C" { #endif - long int __luna_syscall0(long int sys_num); - long int __luna_syscall1(long int sys_num, unsigned long int arg0); - long int __luna_syscall2(long int sys_num, unsigned long int arg0, unsigned long int arg1); - long int __luna_syscall3(long int sys_num, unsigned long int arg0, unsigned long int arg1, unsigned long int arg2); - long int __luna_syscall4(long int sys_num, unsigned long int arg0, unsigned long int arg1, unsigned long int arg2, - unsigned long int arg3); - long int __luna_syscall5(long int sys_num, unsigned long int arg0, unsigned long int arg1, unsigned long int arg2, - unsigned long int arg3, unsigned long int arg4); + long __luna_syscall0(long sys_num); + long __luna_syscall1(long sys_num, unsigned long arg0); + long __luna_syscall2(long sys_num, unsigned long arg0, unsigned long arg1); + long __luna_syscall3(long sys_num, unsigned long arg0, unsigned long arg1, unsigned long arg2); + long __luna_syscall4(long sys_num, unsigned long arg0, unsigned long arg1, unsigned long arg2, unsigned long arg3); + long __luna_syscall5(long sys_num, unsigned long arg0, unsigned long arg1, unsigned long arg2, unsigned long arg3, + unsigned long arg4); #ifdef __cplusplus } #endif -#endif + #endif \ No newline at end of file diff --git a/libs/libc/include/sys/syscall.h b/libs/libc/include/sys/syscall.h index 41de7d74..ac3b6775 100644 --- a/libs/libc/include/sys/syscall.h +++ b/libs/libc/include/sys/syscall.h @@ -1,9 +1,24 @@ #ifndef _SYS_SYSCALL_H #define _SYS_SYSCALL_H -#define __want_syscalls -#include -#undef __want_syscalls -#undef _LUNA_SYSCALL_H +#define SYS_exit 0 +#define SYS_yield 1 +#define SYS_sleep 2 +#define SYS_write 3 +#define SYS_paint 4 +#define SYS_getprocid 5 +#define SYS_mmap 6 +#define SYS_munmap 7 +#define SYS_open 8 +#define SYS_read 9 +#define SYS_close 10 +#define SYS_seek 11 +#define SYS_exec 12 +#define SYS_fcntl 13 +#define SYS_mprotect 14 +#define SYS_clock 15 +#define SYS_mkdir 16 +#define SYS_fork 17 +#define SYS_waitpid 18 #endif \ No newline at end of file diff --git a/libs/libc/src/unistd.cpp b/libs/libc/src/unistd.cpp index 63d0f1aa..34319319 100644 --- a/libs/libc/src/unistd.cpp +++ b/libs/libc/src/unistd.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #include extern "C" @@ -11,6 +12,7 @@ extern "C" { return (int)syscall(SYS_exec, program); } + int execve(const char*, char* const[], char* const[]) { NOT_IMPLEMENTED("execve");