summary refs log tree commit diff
path: root/resolv/netdb.h
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2001-03-03 18:21:04 +0000
committerUlrich Drepper <drepper@redhat.com>2001-03-03 18:21:04 +0000
commit2ace57217028da99fc98f79ae0a625a1ec842724 (patch)
treee7d7c34d61fae3e134dcb1029dfd901cae2c2ddc /resolv/netdb.h
parent28b20578c97c8d53cc339446fdab31818cf701f6 (diff)
downloadglibc-2ace57217028da99fc98f79ae0a625a1ec842724.tar.gz
glibc-2ace57217028da99fc98f79ae0a625a1ec842724.tar.xz
glibc-2ace57217028da99fc98f79ae0a625a1ec842724.zip
Update.
	* Versions.def: Add libanl definition.
	* shlig-versions: Add entry for libanl.
	* resolv/Makefile (distribute): Add gai_misc.h and ga_test.c.
	(routines): Add gai_sigqueue.
	(extra-libs): Add libanl.
	(libanl-routines): New variable.
	Add rules to build libanl and ga_test.
	* resolv/Versions [libc] (GLIBC_2.2.3): Add __gai_sigqueue.
	[libanl]: New library.
	* resolv/netdb.h: Add definitions for libanl.
	* resolv/getaddrinfo_a.c: New file.
	* resolv/gai_cancel.c: New file.
	* resolv/gai_error.c: New file.
	* resolv/gai_misc.c: New file.
	* resolv/gai_misc.h: New file.
	* resolv/gai_notify.c: New file.
	* resolv/gai_suspend.c: New file.
	* resolv/ga_test.c: New file.
	* sysdeps/generic/gai_sigqueue.c: New file.
	* sysdeps/unix/sysv/linux/gai_sigqueue.c: New file.
	* sysdeps/generic/bits/siginfo.h: Allow __need_sigevent_t being defined
	and provide only that definition.
	* sysdeps/unix/sysv/linux/alpha/bits/siginfo.h: Likewise.
	* sysdeps/unix/sysv/linux/bits/siginfo.h: Likewise.
	* sysdeps/unix/sysv/linux/ia64/bits/siginfo.h: Likewise.
	* sysdeps/unix/sysv/linux/mips/bits/siginfo.h: Likewise.
	* sysdeps/unix/sysv/linux/sparc/bits/siginfo.h: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc64/bits/siginfo.h: Likewise.

	* rt/aio_misc.c: Fix typos in comments.
	* rt/lio_listio.c: Pretty printing.  Little optimization in request
	list handling.

	* elf/rtld.c: Remove commented out code.
Diffstat (limited to 'resolv/netdb.h')
-rw-r--r--resolv/netdb.h72
1 files changed, 61 insertions, 11 deletions
diff --git a/resolv/netdb.h b/resolv/netdb.h
index ae3f95aca1..79c147e6bb 100644
--- a/resolv/netdb.h
+++ b/resolv/netdb.h
@@ -33,6 +33,11 @@
 # include <rpc/netdb.h>
 #endif
 
+#ifdef __USE_GNU
+# define __need_sigevent_t
+# include <bits/siginfo.h>
+#endif
+
 #include <bits/netdb.h>
 
 /* Absolute file name for network data base files.  */
@@ -412,23 +417,48 @@ struct addrinfo
   struct addrinfo *ai_next;	/* Pointer to next in list.  */
 };
 
+# ifdef __USE_GNU
+/* Structure used as control block for asynchronous lookup.  */
+struct gaicb
+{
+  const char *ar_name;		/* Name to look up.  */
+  const char *ar_service;	/* Service name.  */
+  const struct addrinfo *ar_request; /* Additional request specification.  */
+  struct addrinfo *ar_result;	/* Pointer to result.  */
+  /* The following are internal elements.  */
+  int __return;
+  int __unused[5];
+};
+
+/* Lookup mode.  */
+#  define GAI_WAIT	0
+#  define GAI_NOWAIT	1
+# endif
+
 /* Possible values for `ai_flags' field in `addrinfo' structure.  */
 # define AI_PASSIVE	0x0001	/* Socket address is intended for `bind'.  */
 # define AI_CANONNAME	0x0002	/* Request for canonical name.  */
 # define AI_NUMERICHOST	0x0004	/* Don't use name resolution.  */
 
 /* Error values for `getaddrinfo' function.  */
-# define EAI_BADFLAGS	-1	/* Invalid value for `ai_flags' field.  */
-# 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_BADFLAGS	  -1	/* Invalid value for `ai_flags' field.  */
+# 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'.  */
+# ifdef __USE_GNU
+#  define EAI_INPROGRESS  -100	/* Processing request in progress.  */
+#  define EAI_CANCELED	  -101	/* Request canceled.  */
+#  define EAI_NOTCANCELED -102	/* Request not canceled.  */
+#  define EAI_ALLDONE	  -103	/* All requests done.  */
+#  define EAI_INTR	  -104	/* Interrupted by a signal.  */
+# endif
 
 # define NI_MAXHOST      1025
 # define NI_MAXSERV      32
@@ -458,6 +488,26 @@ extern int getnameinfo (__const struct sockaddr *__restrict __sa,
 			socklen_t __hostlen, char *__restrict __serv,
 			socklen_t __servlen, unsigned int __flags) __THROW;
 
+# ifdef __USE_GNU
+/* Enqueue ENT requests from the LIST.  If MODE is GAI_WAIT wait until all
+   requests are handled.  If WAIT is GAI_NOWAIT return immediately after
+   queueing the requests and signal completion according to SIG.  */
+extern int getaddrinfo_a (int __mode, struct gaicb *__list[__restrict_arr],
+			  int __ent, struct sigevent *__restrict __sig)
+     __THROW;
+
+/* Suspend execution of the thread until at least one of the ENT requests
+   in LIST is handled.  If TIMEOUT is not a null pointer it specifies the
+   longest time the function keeps waiting before returning with an error.  */
+extern int gai_suspend (__const struct gaicb *__const __list[], int __ent,
+			const struct timespec *__timeout) __THROW;
+
+/* Get the error status of the request REQ.  */
+extern int gai_error (struct gaicb *__req) __THROW;
+
+/* Cancel the requests associated with GAICBP.  */
+extern int gai_cancel (struct gaicb *__gaicbp) __THROW;
+# endif	/* GNU */
 #endif	/* POSIX */
 
 __END_DECLS