mirror of
https://github.com/libretro/cpp-cheat.git
synced 2025-04-12 00:06:45 +00:00
20 lines
362 B
C
20 lines
362 B
C
/*
|
|
# gethostname
|
|
|
|
Copies name of current host on given string:
|
|
|
|
int gethostname(char* hostname, int namelength);
|
|
|
|
Name is truncated to namelength if too large
|
|
*/
|
|
|
|
#include "common.h"
|
|
|
|
int main() {
|
|
const int namelength = 256;
|
|
char hostname[namelength];
|
|
gethostname(hostname, namelength);
|
|
puts(hostname);
|
|
return EXIT_SUCCESS;
|
|
}
|