summaryrefslogtreecommitdiff
path: root/devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-include-netdb.h
blob: 3ec02968b505f7139dcb51651809031d4273d75b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
--- ./newlib/libc/sys/psp/include/netdb.h.orig	2012-01-25 19:33:12.000000000 +0000
+++ ./newlib/libc/sys/psp/include/netdb.h	2012-01-25 19:33:12.000000000 +0000
@@ -0,0 +1,36 @@
+/* Simple gethostbyname and gethostbyaddr replacements, note not thread safe */
+#ifndef __NETDB_H__
+#define __NETDB_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define	NETDB_INTERNAL	-1	/* see errno */
+#define	NETDB_SUCCESS	0	/* no problem */
+#define	HOST_NOT_FOUND	1 /* Authoritative Answer Host not found */
+#define	TRY_AGAIN	2 /* Non-Authoritative Host not found, or SERVERFAIL */
+#define	NO_RECOVERY	3 /* Non recoverable errors, FORMERR, REFUSED, NOTIMP */
+#define	NO_DATA		4 /* Valid name, no data record of requested type */
+#define	NO_ADDRESS	NO_DATA		/* no address, look for MX record */
+
+extern int h_errno;
+
+struct hostent
+{
+	char *h_name;
+	char **h_aliases;
+	int  h_addrtype;
+	int  h_length;
+	char **h_addr_list;
+	char *h_addr;
+};
+
+struct hostent *gethostbyaddr(const void *addr, int len, int type);
+struct hostent *gethostbyname(const char *name);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif