diff --git a/Userland/Libraries/LibCore/System.cpp b/Userland/Libraries/LibCore/System.cpp index bd60d29997..e80d0e1460 100644 --- a/Userland/Libraries/LibCore/System.cpp +++ b/Userland/Libraries/LibCore/System.cpp @@ -576,7 +576,11 @@ ErrorOr gethostname() ErrorOr sethostname(StringView hostname) { +#if defined(AK_OS_SOLARIS) + int rc = ::sethostname(const_cast(hostname.characters_without_null_termination()), hostname.length()); +#else int rc = ::sethostname(hostname.characters_without_null_termination(), hostname.length()); +#endif if (rc < 0) return Error::from_syscall("sethostname"sv, -errno); return {};