mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-07 00:56:14 +00:00
LibCore: Add wrapper for sethostname
This commit is contained in:
committed by
Idan Horowitz
parent
8153282923
commit
b3b40ae1fa
@@ -352,6 +352,14 @@ ErrorOr<String> gethostname()
|
||||
return String(&hostname[0]);
|
||||
}
|
||||
|
||||
ErrorOr<void> sethostname(StringView hostname)
|
||||
{
|
||||
int rc = ::sethostname(hostname.characters_without_null_termination(), hostname.length());
|
||||
if (rc < 0)
|
||||
return Error::from_syscall("sethostname"sv, -errno);
|
||||
return {};
|
||||
}
|
||||
|
||||
ErrorOr<String> getcwd()
|
||||
{
|
||||
auto* cwd = ::getcwd(nullptr, 0);
|
||||
|
||||
Reference in New Issue
Block a user