mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 11:28:12 +00:00
LibCore: Change Errno to Error in FreeBSD and NetBSD-specific functions
This commit is contained in:
parent
719ab586c4
commit
abf7941bb9
1 changed files with 2 additions and 2 deletions
|
@ -1747,12 +1747,12 @@ ErrorOr<String> current_executable_path()
|
|||
int mib[4] = { CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1 };
|
||||
size_t len = sizeof(path);
|
||||
if (sysctl(mib, 4, path, &len, nullptr, 0) < 0)
|
||||
return Errno::from_syscall("sysctl"sv, -errno);
|
||||
return Error::from_syscall("sysctl"sv, -errno);
|
||||
#elif defined(AK_OS_NETBSD)
|
||||
int mib[4] = { CTL_KERN, KERN_PROC_ARGS, -1, KERN_PROC_PATHNAME };
|
||||
size_t len = sizeof(path);
|
||||
if (sysctl(mib, 4, path, &len, nullptr, 0) < 0)
|
||||
return Errno::from_syscall("sysctl"sv, -errno);
|
||||
return Error::from_syscall("sysctl"sv, -errno);
|
||||
#elif defined(AK_OS_MACOS)
|
||||
u32 size = sizeof(path);
|
||||
auto ret = _NSGetExecutablePath(path, &size);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue