change errno to error to avoid confusion
This commit is contained in:
+2
-1
@@ -8,6 +8,7 @@
|
||||
#include <bits/sched.h>
|
||||
|
||||
// Declare all syscalls.
|
||||
#define SYSCALL_DECLARE(number, name, num_args) extern void sys_##name(...);
|
||||
#include <zinnia/syscall_list.inc>
|
||||
#undef SYSCALL_DECLARE
|
||||
|
||||
@@ -43,5 +44,5 @@ void syscall_dispatch(struct arch_context* ctx) {
|
||||
}
|
||||
|
||||
ctx->ARCH_CTX_RET0 = ret.value;
|
||||
ctx->ARCH_CTX_RET1 = ret.errno;
|
||||
ctx->ARCH_CTX_RET1 = ret.error;
|
||||
}
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
struct syscall_ret sys_exit(int err) {
|
||||
struct syscall_ret ret = {};
|
||||
|
||||
ret.errno = ENOSYS;
|
||||
ret.error = ENOSYS;
|
||||
|
||||
panic("sys::exit() not implemented!\n");
|
||||
|
||||
|
||||
+4
-4
@@ -20,7 +20,7 @@ struct syscall_ret sys_setuname(const __user struct __utsname* ptr) {
|
||||
struct syscall_ret ret = {};
|
||||
|
||||
if (!ptr) {
|
||||
ret.errno = EINVAL;
|
||||
ret.error = EINVAL;
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ struct syscall_ret sys_setuname(const __user struct __utsname* ptr) {
|
||||
|
||||
struct __utsname read_buf;
|
||||
if (!usercopy_read(&read_buf, ptr, sizeof(read_buf))) {
|
||||
ret.errno = EFAULT;
|
||||
ret.error = EFAULT;
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ struct syscall_ret sys_getuname(__user struct __utsname* ptr) {
|
||||
struct syscall_ret ret = {};
|
||||
|
||||
if (!ptr) {
|
||||
ret.errno = EINVAL;
|
||||
ret.error = EINVAL;
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ struct syscall_ret sys_getuname(__user struct __utsname* ptr) {
|
||||
spin_unlock(&uname_lock);
|
||||
|
||||
if (!usercopy_write(ptr, &write_buf, sizeof(write_buf)))
|
||||
ret.errno = EFAULT;
|
||||
ret.error = EFAULT;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user