summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorPeter S. Mazinger <ps.m@gmx.net>2011-03-15 20:12:15 +0100
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2012-06-15 14:00:24 +0200
commit30118e361f4ff11bad89b6ff765dd75e44107fb5 (patch)
tree5598a2317296c6651f95dd4344dadc3ac1efeba1 /include
parent02c9f0d6e8fc2dfef2a1caa39fac83b566884247 (diff)
netdb.h: partial update, adding some __USE_MISC/__USE_GNU guards
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Diffstat (limited to 'include')
-rw-r--r--include/netdb.h34
1 files changed, 22 insertions, 12 deletions
diff --git a/include/netdb.h b/include/netdb.h
index 07e1b0d0e..10669b9a5 100644
--- a/include/netdb.h
+++ b/include/netdb.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2002, 2003, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2002, 2003, 2004, 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -88,8 +88,6 @@ extern int h_errno;
#endif /* _LIBC */
/* Possible values left in `h_errno'. */
-#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. */
@@ -97,7 +95,11 @@ extern int h_errno;
NOTIMP. */
#define NO_DATA 4 /* Valid name, no data record of requested
type. */
-#define NO_ADDRESS NO_DATA /* No address, look for MX record. */
+#if defined __USE_MISC || defined __USE_GNU
+# define NETDB_INTERNAL -1 /* See errno. */
+# define NETDB_SUCCESS 0 /* No problem. */
+# define NO_ADDRESS NO_DATA /* No address, look for MX record. */
+#endif
#ifdef __USE_XOPEN2K
/* Highest reserved Internet port number. */
@@ -109,6 +111,7 @@ extern int h_errno;
# define SCOPE_DELIMITER '%'
#endif
+#if defined __USE_MISC || defined __USE_GNU
/* Print error indicated by `h_errno' variable on standard error. STR
if non-null is printed before the error string. */
extern void herror (__const char *__str) __THROW;
@@ -116,6 +119,7 @@ libc_hidden_proto(herror)
/* Return string associated with error ERR_NUM. */
extern __const char *hstrerror (int __err_num) __THROW;
+#endif
/* Description of data base entry for a single host. */
@@ -126,7 +130,9 @@ struct hostent
int h_addrtype; /* Host address type. */
int h_length; /* Length of address. */
char **h_addr_list; /* List of addresses from name server. */
-#define h_addr h_addr_list[0] /* Address, for backward compatibility. */
+#if defined __USE_MISC || defined __USE_GNU
+# define h_addr h_addr_list[0] /* Address, for backward compatibility.*/
+#endif
};
/* Open host data base files and mark them as staying open even after
@@ -268,12 +274,14 @@ extern int getnetent_r (struct netent *__restrict __result_buf,
struct netent **__restrict __result,
int *__restrict __h_errnop);
libc_hidden_proto(getnetent_r)
+
extern int getnetbyaddr_r (uint32_t __net, int __type,
struct netent *__restrict __result_buf,
char *__restrict __buf, size_t __buflen,
struct netent **__restrict __result,
int *__restrict __h_errnop);
libc_hidden_proto(getnetbyaddr_r)
+
extern int getnetbyname_r (__const char *__restrict __name,
struct netent *__restrict __result_buf,
char *__restrict __buf, size_t __buflen,
@@ -464,7 +472,7 @@ extern int getnetgrent (char **__restrict __hostp,
or due to the implementation it is a cancellation point and
therefore not marked with __THROW. */
extern int innetgr (__const char *__netgroup, __const char *__host,
- __const char *__user, __const char *domain);
+ __const char *__user, __const char *__domain);
/* Reentrant version of `getnetgrent' where result is placed in BUFFER.
@@ -479,12 +487,12 @@ extern int getnetgrent_r (char **__restrict __hostp,
#endif /* UCLIBC_HAS_NETGROUP */
#endif /* misc */
-
+#ifdef __UCLIBC__
/* ruserpass - remote password check.
This function also exists in glibc but is undocumented */
extern int ruserpass(const char *host, const char **aname, const char **apass);
libc_hidden_proto(ruserpass)
-
+#endif
#ifdef __USE_BSD
/* Call `rshd' at port RPORT on remote machine *AHOST to execute CMD.
@@ -638,15 +646,15 @@ struct addrinfo
# define EAI_NONAME -2 /* NAME or SERVICE is unknown. */
# define EAI_AGAIN -3 /* Temporary failure in name resolution. */
# define EAI_FAIL -4 /* Non-recoverable failure in name res. */
-# define EAI_NODATA -5 /* No address associated with NAME. */
# define EAI_FAMILY -6 /* `ai_family' not supported. */
# define EAI_SOCKTYPE -7 /* `ai_socktype' not supported. */
# define EAI_SERVICE -8 /* SERVICE not supported for `ai_socktype'. */
-# define EAI_ADDRFAMILY -9 /* Address family for NAME not supported. */
# define EAI_MEMORY -10 /* Memory allocation failure. */
# define EAI_SYSTEM -11 /* System error returned in `errno'. */
# define EAI_OVERFLOW -12 /* Argument buffer overflow. */
# ifdef __USE_GNU
+# define EAI_NODATA -5 /* No address associated with NAME. */
+# define EAI_ADDRFAMILY -9 /* Address family for NAME not supported. */
# define EAI_INPROGRESS -100 /* Processing request in progress. */
# define EAI_CANCELED -101 /* Request canceled. */
# define EAI_NOTCANCELED -102 /* Request not canceled. */
@@ -655,8 +663,10 @@ struct addrinfo
# define EAI_IDN_ENCODE -105 /* IDN encoding failed. */
# endif
-# define NI_MAXHOST 1025
-# define NI_MAXSERV 32
+# ifdef __USE_MISC
+# define NI_MAXHOST 1025
+# define NI_MAXSERV 32
+# endif
# define NI_NUMERICHOST 1 /* Don't try to look up hostname. */
# define NI_NUMERICSERV 2 /* Don't convert port number to name. */