1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 13:48:12 +00:00

Kernel: Added the ability to set the hostname via new syscall

Userland/hostname: Now takes parameter to set the hostname
LibC/unistd: Added sethostname function
This commit is contained in:
Luke Payne 2020-04-26 15:59:47 +10:00 committed by Andreas Kling
parent 03f68a51af
commit f191b84b50
7 changed files with 40 additions and 9 deletions

View file

@ -352,6 +352,12 @@ int gethostname(char* buffer, size_t size)
__RETURN_WITH_ERRNO(rc, rc, -1);
}
int sethostname(const char* hostname, ssize_t size)
{
int rc = syscall(SC_sethostname, hostname, size);
__RETURN_WITH_ERRNO(rc, rc, -1);
}
ssize_t readlink(const char* path, char* buffer, size_t size)
{
Syscall::SC_readlink_params params { { path, strlen(path) }, { buffer, size } };