diff --git a/nx/external/bsd/include/netinet/in.h b/nx/external/bsd/include/netinet/in.h index 0f624398..63495b76 100644 --- a/nx/external/bsd/include/netinet/in.h +++ b/nx/external/bsd/include/netinet/in.h @@ -678,6 +678,8 @@ struct sockaddr_in6 { extern const struct in6_addr in6addr_any; extern const struct in6_addr in6addr_loopback; +extern struct in_addr __nxlink_host; + #endif #endif /* !_NETINET_IN_H_*/ diff --git a/nx/source/runtime/argv.c b/nx/source/runtime/argv.c index 13c89c68..5b13deaa 100644 --- a/nx/source/runtime/argv.c +++ b/nx/source/runtime/argv.c @@ -1,5 +1,8 @@ #include #include +#include +#include + #include "result.h" #include "runtime/env.h" #include "kernel/svc.h" @@ -7,6 +10,7 @@ // System globals we define here int __system_argc; char** __system_argv; +struct in_addr __nxlink_host; extern char* fake_heap_start; extern char* fake_heap_end; @@ -136,6 +140,12 @@ void argvSetup(void) __system_argc++; } + if (strncmp(__system_argv[__system_argc - 1], "NXLINKED", 8) == 0 ) { + __system_argc--; + + __nxlink_host.s_addr = strtoul(&__system_argv[__system_argc][8], NULL, 16); + } + __system_argv[__system_argc] = NULL; }