Fix incorrect use of cmpldi in 32-bit PPC code.
[glibc.git] / resolv / netdb.h
blobdc1f7cec612011720ef71b80573d986a4ec45fee
1 /* Copyright (C) 1996-2002, 2003, 2004, 2009 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
4 The GNU C Library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Lesser General Public
6 License as published by the Free Software Foundation; either
7 version 2.1 of the License, or (at your option) any later version.
9 The GNU C Library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Lesser General Public License for more details.
14 You should have received a copy of the GNU Lesser General Public
15 License along with the GNU C Library; if not, write to the Free
16 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
17 02111-1307 USA. */
19 /* All data returned by the network data base library are supplied in
20 host order and returned in network order (suitable for use in
21 system calls). */
23 #ifndef _NETDB_H
24 #define _NETDB_H 1
26 #include <features.h>
28 #include <netinet/in.h>
29 #include <stdint.h>
30 #ifdef __USE_MISC
31 /* This is necessary to make this include file properly replace the
32 Sun version. */
33 # include <rpc/netdb.h>
34 #endif
36 #ifdef __USE_GNU
37 # define __need_sigevent_t
38 # include <bits/siginfo.h>
39 # define __need_timespec
40 # include <time.h>
41 #endif
43 #include <bits/netdb.h>
45 /* Absolute file name for network data base files. */
46 #define _PATH_HEQUIV "/etc/hosts.equiv"
47 #define _PATH_HOSTS "/etc/hosts"
48 #define _PATH_NETWORKS "/etc/networks"
49 #define _PATH_NSSWITCH_CONF "/etc/nsswitch.conf"
50 #define _PATH_PROTOCOLS "/etc/protocols"
51 #define _PATH_SERVICES "/etc/services"
54 __BEGIN_DECLS
56 /* Error status for non-reentrant lookup functions.
57 We use a macro to access always the thread-specific `h_errno' variable. */
58 #define h_errno (*__h_errno_location ())
60 /* Function to get address of global `h_errno' variable. */
61 extern int *__h_errno_location (void) __THROW __attribute__ ((__const__));
64 /* Possible values left in `h_errno'. */
65 #define HOST_NOT_FOUND 1 /* Authoritative Answer Host not found. */
66 #define TRY_AGAIN 2 /* Non-Authoritative Host not found,
67 or SERVERFAIL. */
68 #define NO_RECOVERY 3 /* Non recoverable errors, FORMERR, REFUSED,
69 NOTIMP. */
70 #define NO_DATA 4 /* Valid name, no data record of requested
71 type. */
72 #if defined __USE_MISC || defined __USE_GNU
73 # define NETDB_INTERNAL -1 /* See errno. */
74 # define NETDB_SUCCESS 0 /* No problem. */
75 # define NO_ADDRESS NO_DATA /* No address, look for MX record. */
76 #endif
78 #ifdef __USE_XOPEN2K
79 /* Highest reserved Internet port number. */
80 # define IPPORT_RESERVED 1024
81 #endif
83 #ifdef __USE_GNU
84 /* Scope delimiter for getaddrinfo(), getnameinfo(). */
85 # define SCOPE_DELIMITER '%'
86 #endif
88 #if defined __USE_MISC || defined __USE_GNU
89 /* Print error indicated by `h_errno' variable on standard error. STR
90 if non-null is printed before the error string. */
91 extern void herror (__const char *__str) __THROW;
93 /* Return string associated with error ERR_NUM. */
94 extern __const char *hstrerror (int __err_num) __THROW;
95 #endif
98 /* Description of data base entry for a single host. */
99 struct hostent
101 char *h_name; /* Official name of host. */
102 char **h_aliases; /* Alias list. */
103 int h_addrtype; /* Host address type. */
104 int h_length; /* Length of address. */
105 char **h_addr_list; /* List of addresses from name server. */
106 #if defined __USE_MISC || defined __USE_GNU
107 # define h_addr h_addr_list[0] /* Address, for backward compatibility.*/
108 #endif
111 /* Open host data base files and mark them as staying open even after
112 a later search if STAY_OPEN is non-zero.
114 This function is a possible cancellation point and therefore not
115 marked with __THROW. */
116 extern void sethostent (int __stay_open);
118 /* Close host data base files and clear `stay open' flag.
120 This function is a possible cancellation point and therefore not
121 marked with __THROW. */
122 extern void endhostent (void);
124 /* Get next entry from host data base file. Open data base if
125 necessary.
127 This function is a possible cancellation point and therefore not
128 marked with __THROW. */
129 extern struct hostent *gethostent (void);
131 /* Return entry from host data base which address match ADDR with
132 length LEN and type TYPE.
134 This function is a possible cancellation point and therefore not
135 marked with __THROW. */
136 extern struct hostent *gethostbyaddr (__const void *__addr, __socklen_t __len,
137 int __type);
139 /* Return entry from host data base for host with NAME.
141 This function is a possible cancellation point and therefore not
142 marked with __THROW. */
143 extern struct hostent *gethostbyname (__const char *__name);
145 #ifdef __USE_MISC
146 /* Return entry from host data base for host with NAME. AF must be
147 set to the address type which is `AF_INET' for IPv4 or `AF_INET6'
148 for IPv6.
150 This function is not part of POSIX and therefore no official
151 cancellation point. But due to similarity with an POSIX interface
152 or due to the implementation it is a cancellation point and
153 therefore not marked with __THROW. */
154 extern struct hostent *gethostbyname2 (__const char *__name, int __af);
156 /* Reentrant versions of the functions above. The additional
157 arguments specify a buffer of BUFLEN starting at BUF. The last
158 argument is a pointer to a variable which gets the value which
159 would be stored in the global variable `herrno' by the
160 non-reentrant functions.
162 These functions are not part of POSIX and therefore no official
163 cancellation point. But due to similarity with an POSIX interface
164 or due to the implementation they are cancellation points and
165 therefore not marked with __THROW. */
166 extern int gethostent_r (struct hostent *__restrict __result_buf,
167 char *__restrict __buf, size_t __buflen,
168 struct hostent **__restrict __result,
169 int *__restrict __h_errnop);
171 extern int gethostbyaddr_r (__const void *__restrict __addr, __socklen_t __len,
172 int __type,
173 struct hostent *__restrict __result_buf,
174 char *__restrict __buf, size_t __buflen,
175 struct hostent **__restrict __result,
176 int *__restrict __h_errnop);
178 extern int gethostbyname_r (__const char *__restrict __name,
179 struct hostent *__restrict __result_buf,
180 char *__restrict __buf, size_t __buflen,
181 struct hostent **__restrict __result,
182 int *__restrict __h_errnop);
184 extern int gethostbyname2_r (__const char *__restrict __name, int __af,
185 struct hostent *__restrict __result_buf,
186 char *__restrict __buf, size_t __buflen,
187 struct hostent **__restrict __result,
188 int *__restrict __h_errnop);
189 #endif /* misc */
192 /* Open network data base files and mark them as staying open even
193 after a later search if STAY_OPEN is non-zero.
195 This function is a possible cancellation point and therefore not
196 marked with __THROW. */
197 extern void setnetent (int __stay_open);
199 /* Close network data base files and clear `stay open' flag.
201 This function is a possible cancellation point and therefore not
202 marked with __THROW. */
203 extern void endnetent (void);
205 /* Get next entry from network data base file. Open data base if
206 necessary.
208 This function is a possible cancellation point and therefore not
209 marked with __THROW. */
210 extern struct netent *getnetent (void);
212 /* Return entry from network data base which address match NET and
213 type TYPE.
215 This function is a possible cancellation point and therefore not
216 marked with __THROW. */
217 extern struct netent *getnetbyaddr (uint32_t __net, int __type);
219 /* Return entry from network data base for network with NAME.
221 This function is a possible cancellation point and therefore not
222 marked with __THROW. */
223 extern struct netent *getnetbyname (__const char *__name);
225 #ifdef __USE_MISC
226 /* Reentrant versions of the functions above. The additional
227 arguments specify a buffer of BUFLEN starting at BUF. The last
228 argument is a pointer to a variable which gets the value which
229 would be stored in the global variable `herrno' by the
230 non-reentrant functions.
232 These functions are not part of POSIX and therefore no official
233 cancellation point. But due to similarity with an POSIX interface
234 or due to the implementation they are cancellation points and
235 therefore not marked with __THROW. */
236 extern int getnetent_r (struct netent *__restrict __result_buf,
237 char *__restrict __buf, size_t __buflen,
238 struct netent **__restrict __result,
239 int *__restrict __h_errnop);
241 extern int getnetbyaddr_r (uint32_t __net, int __type,
242 struct netent *__restrict __result_buf,
243 char *__restrict __buf, size_t __buflen,
244 struct netent **__restrict __result,
245 int *__restrict __h_errnop);
247 extern int getnetbyname_r (__const char *__restrict __name,
248 struct netent *__restrict __result_buf,
249 char *__restrict __buf, size_t __buflen,
250 struct netent **__restrict __result,
251 int *__restrict __h_errnop);
252 #endif /* misc */
255 /* Description of data base entry for a single service. */
256 struct servent
258 char *s_name; /* Official service name. */
259 char **s_aliases; /* Alias list. */
260 int s_port; /* Port number. */
261 char *s_proto; /* Protocol to use. */
264 /* Open service data base files and mark them as staying open even
265 after a later search if STAY_OPEN is non-zero.
267 This function is a possible cancellation point and therefore not
268 marked with __THROW. */
269 extern void setservent (int __stay_open);
271 /* Close service data base files and clear `stay open' flag.
273 This function is a possible cancellation point and therefore not
274 marked with __THROW. */
275 extern void endservent (void);
277 /* Get next entry from service data base file. Open data base if
278 necessary.
280 This function is a possible cancellation point and therefore not
281 marked with __THROW. */
282 extern struct servent *getservent (void);
284 /* Return entry from network data base for network with NAME and
285 protocol PROTO.
287 This function is a possible cancellation point and therefore not
288 marked with __THROW. */
289 extern struct servent *getservbyname (__const char *__name,
290 __const char *__proto);
292 /* Return entry from service data base which matches port PORT and
293 protocol PROTO.
295 This function is a possible cancellation point and therefore not
296 marked with __THROW. */
297 extern struct servent *getservbyport (int __port, __const char *__proto);
300 #ifdef __USE_MISC
301 /* Reentrant versions of the functions above. The additional
302 arguments specify a buffer of BUFLEN starting at BUF.
304 These functions are not part of POSIX and therefore no official
305 cancellation point. But due to similarity with an POSIX interface
306 or due to the implementation they are cancellation points and
307 therefore not marked with __THROW. */
308 extern int getservent_r (struct servent *__restrict __result_buf,
309 char *__restrict __buf, size_t __buflen,
310 struct servent **__restrict __result);
312 extern int getservbyname_r (__const char *__restrict __name,
313 __const char *__restrict __proto,
314 struct servent *__restrict __result_buf,
315 char *__restrict __buf, size_t __buflen,
316 struct servent **__restrict __result);
318 extern int getservbyport_r (int __port, __const char *__restrict __proto,
319 struct servent *__restrict __result_buf,
320 char *__restrict __buf, size_t __buflen,
321 struct servent **__restrict __result);
322 #endif /* misc */
325 /* Description of data base entry for a single service. */
326 struct protoent
328 char *p_name; /* Official protocol name. */
329 char **p_aliases; /* Alias list. */
330 int p_proto; /* Protocol number. */
333 /* Open protocol data base files and mark them as staying open even
334 after a later search if STAY_OPEN is non-zero.
336 This function is a possible cancellation point and therefore not
337 marked with __THROW. */
338 extern void setprotoent (int __stay_open);
340 /* Close protocol data base files and clear `stay open' flag.
342 This function is a possible cancellation point and therefore not
343 marked with __THROW. */
344 extern void endprotoent (void);
346 /* Get next entry from protocol data base file. Open data base if
347 necessary.
349 This function is a possible cancellation point and therefore not
350 marked with __THROW. */
351 extern struct protoent *getprotoent (void);
353 /* Return entry from protocol data base for network with NAME.
355 This function is a possible cancellation point and therefore not
356 marked with __THROW. */
357 extern struct protoent *getprotobyname (__const char *__name);
359 /* Return entry from protocol data base which number is PROTO.
361 This function is a possible cancellation point and therefore not
362 marked with __THROW. */
363 extern struct protoent *getprotobynumber (int __proto);
366 #ifdef __USE_MISC
367 /* Reentrant versions of the functions above. The additional
368 arguments specify a buffer of BUFLEN starting at BUF.
370 These functions are not part of POSIX and therefore no official
371 cancellation point. But due to similarity with an POSIX interface
372 or due to the implementation they are cancellation points and
373 therefore not marked with __THROW. */
374 extern int getprotoent_r (struct protoent *__restrict __result_buf,
375 char *__restrict __buf, size_t __buflen,
376 struct protoent **__restrict __result);
378 extern int getprotobyname_r (__const char *__restrict __name,
379 struct protoent *__restrict __result_buf,
380 char *__restrict __buf, size_t __buflen,
381 struct protoent **__restrict __result);
383 extern int getprotobynumber_r (int __proto,
384 struct protoent *__restrict __result_buf,
385 char *__restrict __buf, size_t __buflen,
386 struct protoent **__restrict __result);
389 /* Establish network group NETGROUP for enumeration.
391 This function is not part of POSIX and therefore no official
392 cancellation point. But due to similarity with an POSIX interface
393 or due to the implementation it is a cancellation point and
394 therefore not marked with __THROW. */
395 extern int setnetgrent (__const char *__netgroup);
397 /* Free all space allocated by previous `setnetgrent' call.
399 This function is not part of POSIX and therefore no official
400 cancellation point. But due to similarity with an POSIX interface
401 or due to the implementation it is a cancellation point and
402 therefore not marked with __THROW. */
403 extern void endnetgrent (void);
405 /* Get next member of netgroup established by last `setnetgrent' call
406 and return pointers to elements in HOSTP, USERP, and DOMAINP.
408 This function is not part of POSIX and therefore no official
409 cancellation point. But due to similarity with an POSIX interface
410 or due to the implementation it is a cancellation point and
411 therefore not marked with __THROW. */
412 extern int getnetgrent (char **__restrict __hostp,
413 char **__restrict __userp,
414 char **__restrict __domainp);
417 /* Test whether NETGROUP contains the triple (HOST,USER,DOMAIN).
419 This function is not part of POSIX and therefore no official
420 cancellation point. But due to similarity with an POSIX interface
421 or due to the implementation it is a cancellation point and
422 therefore not marked with __THROW. */
423 extern int innetgr (__const char *__netgroup, __const char *__host,
424 __const char *__user, __const char *__domain);
426 /* Reentrant version of `getnetgrent' where result is placed in BUFFER.
428 This function is not part of POSIX and therefore no official
429 cancellation point. But due to similarity with an POSIX interface
430 or due to the implementation it is a cancellation point and
431 therefore not marked with __THROW. */
432 extern int getnetgrent_r (char **__restrict __hostp,
433 char **__restrict __userp,
434 char **__restrict __domainp,
435 char *__restrict __buffer, size_t __buflen);
436 #endif /* misc */
439 #ifdef __USE_BSD
440 /* Call `rshd' at port RPORT on remote machine *AHOST to execute CMD.
441 The local user is LOCUSER, on the remote machine the command is
442 executed as REMUSER. In *FD2P the descriptor to the socket for the
443 connection is returned. The caller must have the right to use a
444 reserved port. When the function returns *AHOST contains the
445 official host name.
447 This function is not part of POSIX and therefore no official
448 cancellation point. But due to similarity with an POSIX interface
449 or due to the implementation it is a cancellation point and
450 therefore not marked with __THROW. */
451 extern int rcmd (char **__restrict __ahost, unsigned short int __rport,
452 __const char *__restrict __locuser,
453 __const char *__restrict __remuser,
454 __const char *__restrict __cmd, int *__restrict __fd2p);
456 /* This is the equivalent function where the protocol can be selected
457 and which therefore can be used for IPv6.
459 This function is not part of POSIX and therefore no official
460 cancellation point. But due to similarity with an POSIX interface
461 or due to the implementation it is a cancellation point and
462 therefore not marked with __THROW. */
463 extern int rcmd_af (char **__restrict __ahost, unsigned short int __rport,
464 __const char *__restrict __locuser,
465 __const char *__restrict __remuser,
466 __const char *__restrict __cmd, int *__restrict __fd2p,
467 sa_family_t __af);
469 /* Call `rexecd' at port RPORT on remote machine *AHOST to execute
470 CMD. The process runs at the remote machine using the ID of user
471 NAME whose cleartext password is PASSWD. In *FD2P the descriptor
472 to the socket for the connection is returned. When the function
473 returns *AHOST contains the official host name.
475 This function is not part of POSIX and therefore no official
476 cancellation point. But due to similarity with an POSIX interface
477 or due to the implementation it is a cancellation point and
478 therefore not marked with __THROW. */
479 extern int rexec (char **__restrict __ahost, int __rport,
480 __const char *__restrict __name,
481 __const char *__restrict __pass,
482 __const char *__restrict __cmd, int *__restrict __fd2p);
484 /* This is the equivalent function where the protocol can be selected
485 and which therefore can be used for IPv6.
487 This function is not part of POSIX and therefore no official
488 cancellation point. But due to similarity with an POSIX interface
489 or due to the implementation it is a cancellation point and
490 therefore not marked with __THROW. */
491 extern int rexec_af (char **__restrict __ahost, int __rport,
492 __const char *__restrict __name,
493 __const char *__restrict __pass,
494 __const char *__restrict __cmd, int *__restrict __fd2p,
495 sa_family_t __af);
497 /* Check whether user REMUSER on system RHOST is allowed to login as LOCUSER.
498 If SUSER is not zero the user tries to become superuser. Return 0 if
499 it is possible.
501 This function is not part of POSIX and therefore no official
502 cancellation point. But due to similarity with an POSIX interface
503 or due to the implementation it is a cancellation point and
504 therefore not marked with __THROW. */
505 extern int ruserok (__const char *__rhost, int __suser,
506 __const char *__remuser, __const char *__locuser);
508 /* This is the equivalent function where the protocol can be selected
509 and which therefore can be used for IPv6.
511 This function is not part of POSIX and therefore no official
512 cancellation point. But due to similarity with an POSIX interface
513 or due to the implementation it is a cancellation point and
514 therefore not marked with __THROW. */
515 extern int ruserok_af (__const char *__rhost, int __suser,
516 __const char *__remuser, __const char *__locuser,
517 sa_family_t __af);
519 /* Try to allocate reserved port, returning a descriptor for a socket opened
520 at this port or -1 if unsuccessful. The search for an available port
521 will start at ALPORT and continues with lower numbers.
523 This function is not part of POSIX and therefore no official
524 cancellation point. But due to similarity with an POSIX interface
525 or due to the implementation it is a cancellation point and
526 therefore not marked with __THROW. */
527 extern int rresvport (int *__alport);
529 /* This is the equivalent function where the protocol can be selected
530 and which therefore can be used for IPv6.
532 This function is not part of POSIX and therefore no official
533 cancellation point. But due to similarity with an POSIX interface
534 or due to the implementation it is a cancellation point and
535 therefore not marked with __THROW. */
536 extern int rresvport_af (int *__alport, sa_family_t __af);
537 #endif
540 /* Extension from POSIX.1g. */
541 #ifdef __USE_POSIX
542 /* Structure to contain information about address of a service provider. */
543 struct addrinfo
545 int ai_flags; /* Input flags. */
546 int ai_family; /* Protocol family for socket. */
547 int ai_socktype; /* Socket type. */
548 int ai_protocol; /* Protocol for socket. */
549 socklen_t ai_addrlen; /* Length of socket address. */
550 struct sockaddr *ai_addr; /* Socket address for socket. */
551 char *ai_canonname; /* Canonical name for service location. */
552 struct addrinfo *ai_next; /* Pointer to next in list. */
555 # ifdef __USE_GNU
556 /* Structure used as control block for asynchronous lookup. */
557 struct gaicb
559 const char *ar_name; /* Name to look up. */
560 const char *ar_service; /* Service name. */
561 const struct addrinfo *ar_request; /* Additional request specification. */
562 struct addrinfo *ar_result; /* Pointer to result. */
563 /* The following are internal elements. */
564 int __return;
565 int __unused[5];
568 /* Lookup mode. */
569 # define GAI_WAIT 0
570 # define GAI_NOWAIT 1
571 # endif
573 /* Possible values for `ai_flags' field in `addrinfo' structure. */
574 # define AI_PASSIVE 0x0001 /* Socket address is intended for `bind'. */
575 # define AI_CANONNAME 0x0002 /* Request for canonical name. */
576 # define AI_NUMERICHOST 0x0004 /* Don't use name resolution. */
577 # define AI_V4MAPPED 0x0008 /* IPv4 mapped addresses are acceptable. */
578 # define AI_ALL 0x0010 /* Return IPv4 mapped and IPv6 addresses. */
579 # define AI_ADDRCONFIG 0x0020 /* Use configuration of this host to choose
580 returned address type.. */
581 # ifdef __USE_GNU
582 # define AI_IDN 0x0040 /* IDN encode input (assuming it is encoded
583 in the current locale's character set)
584 before looking it up. */
585 # define AI_CANONIDN 0x0080 /* Translate canonical name from IDN format. */
586 # define AI_IDN_ALLOW_UNASSIGNED 0x0100 /* Don't reject unassigned Unicode
587 code points. */
588 # define AI_IDN_USE_STD3_ASCII_RULES 0x0200 /* Validate strings according to
589 STD3 rules. */
590 # endif
591 # define AI_NUMERICSERV 0x0400 /* Don't use name resolution. */
593 /* Error values for `getaddrinfo' function. */
594 # define EAI_BADFLAGS -1 /* Invalid value for `ai_flags' field. */
595 # define EAI_NONAME -2 /* NAME or SERVICE is unknown. */
596 # define EAI_AGAIN -3 /* Temporary failure in name resolution. */
597 # define EAI_FAIL -4 /* Non-recoverable failure in name res. */
598 # define EAI_FAMILY -6 /* `ai_family' not supported. */
599 # define EAI_SOCKTYPE -7 /* `ai_socktype' not supported. */
600 # define EAI_SERVICE -8 /* SERVICE not supported for `ai_socktype'. */
601 # define EAI_MEMORY -10 /* Memory allocation failure. */
602 # define EAI_SYSTEM -11 /* System error returned in `errno'. */
603 # define EAI_OVERFLOW -12 /* Argument buffer overflow. */
604 # ifdef __USE_GNU
605 # define EAI_NODATA -5 /* No address associated with NAME. */
606 # define EAI_ADDRFAMILY -9 /* Address family for NAME not supported. */
607 # define EAI_INPROGRESS -100 /* Processing request in progress. */
608 # define EAI_CANCELED -101 /* Request canceled. */
609 # define EAI_NOTCANCELED -102 /* Request not canceled. */
610 # define EAI_ALLDONE -103 /* All requests done. */
611 # define EAI_INTR -104 /* Interrupted by a signal. */
612 # define EAI_IDN_ENCODE -105 /* IDN encoding failed. */
613 # endif
615 # ifdef __USE_MISC
616 # define NI_MAXHOST 1025
617 # define NI_MAXSERV 32
618 # endif
620 # define NI_NUMERICHOST 1 /* Don't try to look up hostname. */
621 # define NI_NUMERICSERV 2 /* Don't convert port number to name. */
622 # define NI_NOFQDN 4 /* Only return nodename portion. */
623 # define NI_NAMEREQD 8 /* Don't return numeric addresses. */
624 # define NI_DGRAM 16 /* Look up UDP service rather than TCP. */
625 # ifdef __USE_GNU
626 # define NI_IDN 32 /* Convert name from IDN format. */
627 # define NI_IDN_ALLOW_UNASSIGNED 64 /* Don't reject unassigned Unicode
628 code points. */
629 # define NI_IDN_USE_STD3_ASCII_RULES 128 /* Validate strings according to
630 STD3 rules. */
631 # endif
633 /* Translate name of a service location and/or a service name to set of
634 socket addresses.
636 This function is a possible cancellation point and therefore not
637 marked with __THROW. */
638 extern int getaddrinfo (__const char *__restrict __name,
639 __const char *__restrict __service,
640 __const struct addrinfo *__restrict __req,
641 struct addrinfo **__restrict __pai);
643 /* Free `addrinfo' structure AI including associated storage. */
644 extern void freeaddrinfo (struct addrinfo *__ai) __THROW;
646 /* Convert error return from getaddrinfo() to a string. */
647 extern __const char *gai_strerror (int __ecode) __THROW;
649 /* Translate a socket address to a location and service name.
651 This function is a possible cancellation point and therefore not
652 marked with __THROW. */
653 extern int getnameinfo (__const struct sockaddr *__restrict __sa,
654 socklen_t __salen, char *__restrict __host,
655 socklen_t __hostlen, char *__restrict __serv,
656 socklen_t __servlen, unsigned int __flags);
657 #endif /* POSIX */
659 #ifdef __USE_GNU
660 /* Enqueue ENT requests from the LIST. If MODE is GAI_WAIT wait until all
661 requests are handled. If WAIT is GAI_NOWAIT return immediately after
662 queueing the requests and signal completion according to SIG.
664 This function is not part of POSIX and therefore no official
665 cancellation point. But due to similarity with an POSIX interface
666 or due to the implementation it is a cancellation point and
667 therefore not marked with __THROW. */
668 extern int getaddrinfo_a (int __mode, struct gaicb *__list[__restrict_arr],
669 int __ent, struct sigevent *__restrict __sig);
671 /* Suspend execution of the thread until at least one of the ENT requests
672 in LIST is handled. If TIMEOUT is not a null pointer it specifies the
673 longest time the function keeps waiting before returning with an error.
675 This function is not part of POSIX and therefore no official
676 cancellation point. But due to similarity with an POSIX interface
677 or due to the implementation it is a cancellation point and
678 therefore not marked with __THROW. */
679 extern int gai_suspend (__const struct gaicb *__const __list[], int __ent,
680 __const struct timespec *__timeout);
682 /* Get the error status of the request REQ. */
683 extern int gai_error (struct gaicb *__req) __THROW;
685 /* Cancel the requests associated with GAICBP. */
686 extern int gai_cancel (struct gaicb *__gaicbp) __THROW;
687 #endif /* GNU */
689 __END_DECLS
691 #endif /* netdb.h */