get_hostname()

get_hostname()#

Retrieves the hostname of the current system. On Linux, it reads from /etc/hostname, while on ESP32, it returns a default value.

Prototype

const char *get_hostname(void);

Parameters

Key

Type

Description

-

-

This function does not take any parameters.


Return Value

A pointer to a static string containing the hostname of the system.

Notes

The returned string is statically allocated and should not be modified or freed by the caller.

Prototype

// Not applicable in JS

Prototype

# Not applicable in Python
Examples
// TODO C examples
// TODO JS examples
# TODO Python examples