mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-21 12:32:40 +02:00
add support for finding nxlink host
This commit is contained in:
parent
213676c5f8
commit
e8fdd73561
2
nx/external/bsd/include/netinet/in.h
vendored
2
nx/external/bsd/include/netinet/in.h
vendored
@ -678,6 +678,8 @@ struct sockaddr_in6 {
|
|||||||
extern const struct in6_addr in6addr_any;
|
extern const struct in6_addr in6addr_any;
|
||||||
extern const struct in6_addr in6addr_loopback;
|
extern const struct in6_addr in6addr_loopback;
|
||||||
|
|
||||||
|
extern struct in_addr __nxlink_host;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* !_NETINET_IN_H_*/
|
#endif /* !_NETINET_IN_H_*/
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <netinet/in.h>
|
||||||
|
|
||||||
#include "result.h"
|
#include "result.h"
|
||||||
#include "runtime/env.h"
|
#include "runtime/env.h"
|
||||||
#include "kernel/svc.h"
|
#include "kernel/svc.h"
|
||||||
@ -7,6 +10,7 @@
|
|||||||
// System globals we define here
|
// System globals we define here
|
||||||
int __system_argc;
|
int __system_argc;
|
||||||
char** __system_argv;
|
char** __system_argv;
|
||||||
|
struct in_addr __nxlink_host;
|
||||||
|
|
||||||
extern char* fake_heap_start;
|
extern char* fake_heap_start;
|
||||||
extern char* fake_heap_end;
|
extern char* fake_heap_end;
|
||||||
@ -136,6 +140,12 @@ void argvSetup(void)
|
|||||||
__system_argc++;
|
__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;
|
__system_argv[__system_argc] = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user