mirror of
https://github.com/wiiu-env/wut.git
synced 2025-01-09 20:09:23 +01:00
22 lines
341 B
C
22 lines
341 B
C
#include "wut_socket.h"
|
|
|
|
#include <nn/ac.h>
|
|
|
|
long
|
|
gethostid(void)
|
|
{
|
|
long ip = -1;
|
|
ACGetAssignedAddress((uint32_t*) &ip);
|
|
return ip;
|
|
}
|
|
|
|
int
|
|
gethostname(char *name,
|
|
size_t len)
|
|
{
|
|
struct in_addr in;
|
|
in.s_addr = gethostid();
|
|
const char *hostname = inet_ntop(AF_INET, &in, name, len);
|
|
return hostname ? 0 : -1;
|
|
}
|