2021-03-02 23:59:28 +00:00
|
|
|
/*
|
|
|
|
htop - generic/hostname.c
|
|
|
|
(C) 2021 htop dev team
|
2021-09-22 09:33:00 +00:00
|
|
|
Released under the GNU GPLv2+, see the COPYING file
|
2021-03-02 23:59:28 +00:00
|
|
|
in the source distribution for its full text.
|
|
|
|
*/
|
|
|
|
#include "config.h" // IWYU pragma: keep
|
|
|
|
|
|
|
|
#include "generic/hostname.h"
|
|
|
|
|
|
|
|
#include <unistd.h>
|
|
|
|
|
|
|
|
|
|
|
|
void Generic_hostname(char* buffer, size_t size) {
|
|
|
|
gethostname(buffer, size - 1);
|
2021-03-04 22:42:24 +00:00
|
|
|
buffer[size - 1] = '\0';
|
2021-03-02 23:59:28 +00:00
|
|
|
}
|