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 {} \;`
41 lines
724 B
C
41 lines
724 B
C
#include "wut_socket.h"
|
|
#include <netdb.h>
|
|
#include <nsysnet/_netdb.h>
|
|
|
|
struct hostent *
|
|
gethostbyaddr(const void *addr,
|
|
socklen_t len,
|
|
int type)
|
|
{
|
|
if (!addr || !len) {
|
|
h_errno = HOST_NOT_FOUND;
|
|
return NULL;
|
|
}
|
|
|
|
if (type != AF_INET) {
|
|
h_errno = HOST_NOT_FOUND;
|
|
return NULL;
|
|
}
|
|
|
|
struct hostent *ent = RPLWRAP(gethostbyaddr)(addr, len, type);
|
|
|
|
h_errno = *RPLWRAP(get_h_errno)();
|
|
|
|
return ent;
|
|
}
|
|
|
|
struct hostent *
|
|
gethostbyname(const char *name)
|
|
{
|
|
if (!name) {
|
|
h_errno = HOST_NOT_FOUND;
|
|
return NULL;
|
|
}
|
|
|
|
struct hostent *ent = RPLWRAP(gethostbyname)(name);
|
|
|
|
h_errno = *RPLWRAP(get_h_errno)();
|
|
|
|
return ent;
|
|
}
|