diff --git a/Base/usr/share/man/man2/module_load.md b/Base/usr/share/man/man2/module_load.md index 8876e7ae9d458873d5702f5639ac2ea1f24971b7..1bf4f144280a9b04a8fe307403ff2d4e93796321 100644 --- a/Base/usr/share/man/man2/module_load.md +++ b/Base/usr/share/man/man2/module_load.md @@ -25,8 +25,7 @@ returns -1 and sets `errno` to describe the error. * `EPERM`: The calling process does not have superuser permissions. * `EFAULT`: `path` pointed to memory that was not accessible for the caller. * `ENOEXEC`: The specified file could not be parsed as an ELF object. -* `ENOENT`: One or more symbols referred to by the module could not be resolved. -* `EINVAL`: The module had no `.text` section, or didn't export a `module_init` function. +* `EINVAL`: One or more symbols referred to by the module could not be resolved, or the module had no `.text` section, or didn't export a `module_init` function. * `EEXIST`: A module with the same name was already loaded. ## See also diff --git a/Kernel/Process.cpp b/Kernel/Process.cpp index 9f9e7e5199b42f7b98203a32826b3306e724eb1b..8ae036b3945b88e27839d7ea53616cfa4ad46598 100644 --- a/Kernel/Process.cpp +++ b/Kernel/Process.cpp @@ -4286,7 +4286,7 @@ int Process::sys$module_load(const char* user_path, size_t path_length) }); if (missing_symbols) - return -ENOENT; + return -EINVAL; auto* text_base = section_storage_by_name.get(".text").value_or(nullptr); if (!text_base) {