summaryrefslogtreecommitdiffstats
path: root/generic/hostname.c
blob: e3275828c673ff7e0d482a7b5f74e1adb6681ce9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/*
htop - generic/hostname.c
(C) 2021 htop dev team
Released under the GNU GPLv2+, see the COPYING file
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);
   buffer[size - 1] = '\0';
}

© 2014-2024 Faster IT GmbH | imprint | privacy policy