master
h 21 lines 644 Bytes
Raw
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 #ifndef NETDATA_HOSTNAME_H
4 #define NETDATA_HOSTNAME_H
5
6 #include "libnetdata/libnetdata.h"
7
8 /**
9 * Get system hostname in UTF-8 encoding
10 *
11 * @param dst Buffer to store the hostname
12 * @param dst_size Size of the destination buffer
13 * @param filesystem_root Optional root directory (for Unix-like systems, when running in a container)
14 * @return true on success, false on failure
15 *
16 * The function guarantees to return a UTF-8 encoded hostname.
17 * On Windows, filesystem_root is ignored.
18 */
19 bool os_hostname(char *dst, size_t dst_size, const char *filesystem_root);
20
21 #endif //NETDATA_HOSTNAME_H