Kernel, libc: Add ENOEXEC (Exec format error)
This commit is contained in:
parent
ea886f58a0
commit
4091799701
@ -123,7 +123,7 @@ int main()
|
||||
|
||||
sleep(2);
|
||||
|
||||
if (execv("/bin/sym", NULL) < 0)
|
||||
if (execv("/sys/config", NULL) < 0)
|
||||
{
|
||||
perror("execv");
|
||||
return 1;
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
#define EPERM 1
|
||||
#define ENOENT 2
|
||||
#define ENOEXEC 8
|
||||
#define EBADF 9
|
||||
#define ENOMEM 12
|
||||
#define EISDIR 21
|
||||
|
@ -34,7 +34,7 @@ void sys_exec(Context* context, const char* pathname)
|
||||
|
||||
if (ELFLoader::check_elf_image(program) < 0)
|
||||
{
|
||||
context->rax = -EINVAL; // FIXME: Should be ENOEXEC.
|
||||
context->rax = -ENOEXEC;
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -6,6 +6,7 @@ extern int errno;
|
||||
|
||||
#define EPERM 1 // Operation not permitted
|
||||
#define ENOENT 2 // No such file or directory
|
||||
#define ENOEXEC 8 // Exec format error
|
||||
#define EBADF 9 // Bad file descriptor
|
||||
#define ENOMEM 12 // Cannot allocate memory
|
||||
#define EISDIR 21 // Is a directory
|
||||
|
@ -127,6 +127,7 @@ extern "C"
|
||||
case EBADF: return "Bad file descriptor";
|
||||
case EMFILE: return "Too many open files";
|
||||
case EISDIR: return "Is a directory";
|
||||
case ENOEXEC: return "Exec format error";
|
||||
case 0: return "Success";
|
||||
default: return (char*)(unsigned long int)err;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user