4 #define MAX_HOSTENT_RESULTS 16
5 static struct hostent SOC_hostent;
7 static char *SOC_hostent_alias = NULL;
15 u32 saved_threadstorage[2];
16 static u8 outbuf[0x1A88];
18 cmdbuf[0] = 0x000D0082;
19 cmdbuf[1] = strlen(name)+1;
20 cmdbuf[2] =
sizeof(outbuf);
21 cmdbuf[3] = ((strlen(name)+1) << 14) | 0xC02;
22 cmdbuf[4] = (
u32)name;
24 saved_threadstorage[0] = cmdbuf[0x100>>2];
25 saved_threadstorage[1] = cmdbuf[0x104>>2];
27 cmdbuf[0x100>>2] = (
sizeof(outbuf) << 14) | 2;
28 cmdbuf[0x104>>2] = (
u32)outbuf;
32 cmdbuf[0x100>>2] = saved_threadstorage[0];
33 cmdbuf[0x104>>2] = saved_threadstorage[1];
43 memcpy(&num_results, (
char*)outbuf+4,
sizeof(num_results));
47 SOC_hostent.
h_name = (
char*)outbuf + 8;
48 SOC_hostent.
h_aliases = &SOC_hostent_alias;
53 SOC_hostent_alias = NULL;
55 for(i = 0; i < num_results; ++i)
56 SOC_hostent_results[i] = (
char*)outbuf + 0x1908 + i*0x10;
57 SOC_hostent_results[num_results] = NULL;
u32 * getThreadCommandBuffer(void)
struct hostent * gethostbyname(const char *name)
s32 _net_convert_error(s32 sock_retval)
s32 svcSendSyncRequest(Handle session)
#define MAX_HOSTENT_RESULTS