mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-10 13:00:29 +03:00
20 lines
378 B
C++
20 lines
378 B
C++
#include <unistd.h>
|
|
#include <stdio.h>
|
|
#include <errno.h>
|
|
#include <string.h>
|
|
|
|
int main(int argc, char** argv)
|
|
{
|
|
(void) argc;
|
|
(void) argv;
|
|
char buffer[HOST_NAME_MAX];
|
|
int rc = gethostname(buffer, sizeof(buffer));
|
|
if (rc < 0) {
|
|
printf("gethostname() error: %s\n", strerror(errno));
|
|
return 1;
|
|
}
|
|
printf("%s\n", buffer);
|
|
return 0;
|
|
}
|
|
|