aboutsummaryrefslogtreecommitdiffstats
path: root/generic/hostname.c
blob: 69a41468752345bbc8bf33d577834a4090be66cc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/*
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