We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0fb8a91 commit 5cfbcdfCopy full SHA for 5cfbcdf
include/posix/unistd.h
@@ -12,6 +12,10 @@ extern "C" {
12
13
#include "posix_types.h"
14
#include "sys/stat.h"
15
+#ifdef CONFIG_NETWORKING
16
+/* For zsock_gethostname() */
17
+#include "net/socket.h"
18
+#endif
19
20
#ifdef CONFIG_POSIX_API
21
#include <fs.h>
@@ -33,6 +37,13 @@ extern int mkdir(const char *path, mode_t mode);
33
37
unsigned sleep(unsigned int seconds);
34
38
int usleep(useconds_t useconds);
35
39
40
41
+static inline int gethostname(char *buf, size_t len)
42
+{
43
+ return zsock_gethostname(buf, len);
44
+}
45
46
+
36
47
#ifdef __cplusplus
48
}
49
#endif
0 commit comments