Kernel, libc: Add ENOSYS
This error is returned by the kernel/C Library when an attempt is made to use a system call that doesn't exist.
This commit is contained in:
parent
ac72d64490
commit
ce6ec3585c
@ -2,4 +2,5 @@
|
||||
|
||||
#define EPERM 1
|
||||
#define ENOMEM 12
|
||||
#define EINVAL 22
|
||||
#define EINVAL 22
|
||||
#define ENOSYS 38
|
@ -1,4 +1,5 @@
|
||||
#include "sys/Syscall.h"
|
||||
#include "errno.h"
|
||||
#include "io/Serial.h"
|
||||
#include "thread/Scheduler.h"
|
||||
|
||||
@ -25,6 +26,6 @@ void Syscall::entry(Context* context)
|
||||
case SYS_gettid: sys_gettid(context); break;
|
||||
case SYS_mmap: sys_mmap(context, (void*)context->rdi, context->rsi, (int)context->rdx); break;
|
||||
case SYS_munmap: sys_munmap(context, (void*)context->rdi, context->rsi); break;
|
||||
default: context->rax = -1; break;
|
||||
default: context->rax = -ENOSYS; break;
|
||||
}
|
||||
}
|
@ -6,5 +6,6 @@ extern int errno;
|
||||
#define EPERM 1
|
||||
#define ENOMEM 12
|
||||
#define EINVAL 22
|
||||
#define ENOSYS 38
|
||||
|
||||
#endif
|
@ -120,6 +120,7 @@ extern "C"
|
||||
case EPERM: return "Operation not permitted";
|
||||
case EINVAL: return "Invalid argument";
|
||||
case ENOMEM: return "Out of memory";
|
||||
case ENOSYS: return "Function not implemented";
|
||||
default: return 0;
|
||||
}
|
||||
}
|
||||
|
@ -60,7 +60,7 @@ extern "C"
|
||||
result = __luna_syscall5(number, arg0, arg1, arg2, arg3, arg4);
|
||||
break;
|
||||
}
|
||||
default: result = -1; break;
|
||||
default: result = -ENOSYS; break;
|
||||
}
|
||||
va_end(ap);
|
||||
if (number == SYS_mmap) { _RETURN_WITH_MEMORY_ERRNO(result, long int); }
|
||||
|
Loading…
Reference in New Issue
Block a user