mirror of
https://github.com/devkitPro/wut.git
synced 2026-03-21 17:34:47 -05:00
Some checks failed
C/C++ CI / ubuntu-latest (push) Has been cancelled
`find . -regex '.*\.\(cpp\|hpp\|cu\|cuh\|c\|h\)' -exec clang-format -style=file -i {} \;`
22 lines
358 B
C
22 lines
358 B
C
#include "wut_socket.h"
|
|
|
|
#include <nn/ac.h>
|
|
|
|
long
|
|
gethostid(void)
|
|
{
|
|
uint32_t ip = UINT32_MAX;
|
|
ACGetAssignedAddress(&ip);
|
|
return (long)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;
|
|
}
|