home *** CD-ROM | disk | FTP | other *** search
/ RISCWORLD 7 / RISCWORLD_VOL7.iso / Software / Issue4 / SDL / gcc346 / !gcc / include / unixlib / h / netdb < prev    next >
Encoding:
Text File  |  2006-09-17  |  20.2 KB  |  559 lines

  1. /****************************************************************************
  2.  *
  3.  * $Source: /usr/local/cvsroot/gccsdk/unixlib/source/clib/netdb.h,v $
  4.  * $Date: 2005/04/29 18:26:12 $
  5.  * $Revision: 1.11 $
  6.  * $State: Exp $
  7.  * $Author: peter $
  8.  *
  9.  ***************************************************************************/
  10.  
  11. /*
  12.  * File taken from glibc 2.2.5.
  13.  * Following changes were made:
  14.  *  - Disabled the #include <bits/siginfo.h> for the sigevent_t definition
  15.  *    (which we don't have at the moment) and disabled the getaddrinfo_a
  16.  *    declaration too.
  17.  *  - Disabled the #define h_errno redefintion.
  18.  *  - Make sure there is a __set_h_errno() definition.
  19.  *  - Changed "/etc/hosts.equiv" into "InetDBase:hosts.equiv", "/etc/hosts"
  20.  *    into "InetDBase:hosts", "/etc/networks" into "InetDBase:networks",
  21.  *    "/etc/nsswitch.conf" into "InetDBase:nsswitch.conf", "/etc/protocols"
  22.  *    into "InetDBase:protocols", "/etc/services" into "InetDBase:services".
  23.  *  - Commented out gai_strerror(), getnameinfo() declarations.
  24.  */
  25.  
  26. /* Copyright (C) 1996,1997,1998,1999,2000,2001 Free Software Foundation, Inc.
  27.    This file is part of the GNU C Library.
  28.  
  29.    The GNU C Library is free software; you can redistribute it and/or
  30.    modify it under the terms of the GNU Lesser General Public
  31.    License as published by the Free Software Foundation; either
  32.    version 2.1 of the License, or (at your option) any later version.
  33.  
  34.    The GNU C Library is distributed in the hope that it will be useful,
  35.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  36.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  37.    Lesser General Public License for more details.
  38.  
  39.    You should have received a copy of the GNU Lesser General Public
  40.    License along with the GNU C Library; if not, write to the Free
  41.    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  42.    02111-1307 USA.  */
  43.  
  44. /* All data returned by the network data base library are supplied in
  45.    host order and returned in network order (suitable for use in
  46.    system calls).  */
  47.  
  48. #ifndef    __NETDB_H
  49. #define    __NETDB_H    1
  50.  
  51. #include <features.h>
  52.  
  53. #include <netinet/in.h>
  54. #include <stdint.h>
  55. #ifdef __USE_MISC
  56. /* This is necessary to make this include file properly replace the
  57.    Sun version.  */
  58. # include <rpc/netdb.h>
  59. #endif
  60.  
  61. #ifdef __USE_GNU
  62. /* # define __need_sigevent_t
  63. # include <bits/siginfo.h>
  64.  */
  65. # define __need_timespec
  66. # include <time.h>
  67. #endif
  68.  
  69. #include <bits/netdb.h>
  70.  
  71. /* Absolute file name for network data base files.  */
  72. #define    _PATH_HEQUIV        "InetDBase:hosts.equiv"
  73. #define    _PATH_HOSTS        "InetDBase:hosts"
  74. #define    _PATH_NETWORKS        "InetDBase:networks"
  75. #define    _PATH_NSSWITCH_CONF    "InetDBase:nsswitch.conf"
  76. #define    _PATH_PROTOCOLS        "InetDBase:protocols"
  77. #define    _PATH_SERVICES        "InetDBase:services"
  78.  
  79.  
  80. __BEGIN_DECLS
  81.  
  82. /* Error status for non-reentrant lookup functions.  */
  83. extern int h_errno;
  84.  
  85. /* Function to get address of global `h_errno' variable.  */
  86. extern int *__h_errno_location (void) __THROW __attribute__ ((__const__));
  87.  
  88. #if 1
  89. #define __set_h_errno(x) (h_errno = (x))
  90. #else
  91. #ifdef _LIBC
  92. # ifdef _LIBC_REENTRANT
  93. static inline int
  94. __set_h_errno (int __err)
  95. {
  96.   return *__h_errno_location () = __err;
  97. }
  98. # else
  99. #  define __set_h_errno(x) (h_errno = (x))
  100. # endif    /* _LIBC_REENTRANT */
  101. #endif /* _LIBC */
  102. #endif
  103.  
  104.  
  105. #if 0
  106. #if !defined _LIBC || defined _LIBC_REENTRANT
  107. /* Use a macro to access always the thread specific `h_errno' variable.  */
  108. # define h_errno (*__h_errno_location ())
  109. #endif
  110. #endif
  111.  
  112.  
  113. /* Possible values left in `h_errno'.  */
  114. #define    NETDB_INTERNAL    -1    /* See errno.  */
  115. #define    NETDB_SUCCESS    0    /* No problem.  */
  116. #define    HOST_NOT_FOUND    1    /* Authoritative Answer Host not found.  */
  117. #define    TRY_AGAIN    2    /* Non-Authoritative Host not found,
  118.                    or SERVERFAIL.  */
  119. #define    NO_RECOVERY    3    /* Non recoverable errors, FORMERR, REFUSED,
  120.                    NOTIMP.  */
  121. #define    NO_DATA        4    /* Valid name, no data record of requested
  122.                    type.  */
  123. #define    NO_ADDRESS    NO_DATA    /* No address, look for MX record.  */
  124.  
  125. #ifdef __USE_XOPEN2K
  126. /* Highest reserved Internet port number.  */
  127. # define IPPORT_RESERVED    1024
  128. #endif
  129.  
  130. #ifdef __USE_GNU
  131. /* Scope delimiter for getaddrinfo(), getnameinfo().  */
  132. # define SCOPE_DELIMITER    '%'
  133. #endif
  134.  
  135. /* Print error indicated by `h_errno' variable on standard error.  STR
  136.    if non-null is printed before the error string.  */
  137. extern void herror (__const char *__str) __THROW;
  138.  
  139. /* Return string associated with error ERR_NUM.  */
  140. extern __const char *hstrerror (int __err_num) __THROW;
  141.  
  142.  
  143.  
  144. /* Description of data base entry for a single host.  */
  145. struct hostent
  146. {
  147.   char *h_name;            /* Official name of host.  */
  148.   char **h_aliases;        /* Alias list.  */
  149.   int h_addrtype;        /* Host address type.  */
  150.   int h_length;            /* Length of address.  */
  151.   char **h_addr_list;        /* List of addresses from name server.  */
  152. #define    h_addr    h_addr_list[0]    /* Address, for backward compatibility.  */
  153. };
  154.  
  155. /* Open host data base files and mark them as staying open even after
  156.    a later search if STAY_OPEN is non-zero.  */
  157. extern void sethostent (int __stay_open);
  158.  
  159. /* Close host data base files and clear `stay open' flag.  */
  160. extern void endhostent (void);
  161.  
  162. /* Get next entry from host data base file.  Open data base if
  163.    necessary.  */
  164. extern struct hostent *gethostent (void);
  165.  
  166. /* Return entry from host data base which address match ADDR with
  167.    length LEN and type TYPE.  */
  168. extern struct hostent *gethostbyaddr (__const void *__addr, __socklen_t __len,
  169.                       int __type);
  170.  
  171. /* Return entry from host data base for host with NAME.  */
  172. extern struct hostent *gethostbyname (__const char *__name);
  173.  
  174. #ifdef __USE_MISC
  175. /* Return entry from host data base for host with NAME.  AF must be
  176.    set to the address type which is `AF_INET' for IPv4 or `AF_INET6'
  177.    for IPv6.  */
  178. extern struct hostent *gethostbyname2 (__const char *__name, int __af);
  179.  
  180. /* Reentrant versions of the functions above.  The additional
  181.    arguments specify a buffer of BUFLEN starting at BUF.  The last
  182.    argument is a pointer to a variable which gets the value which
  183.    would be stored in the global variable `herrno' by the
  184.    non-reentrant functions.  */
  185. extern int gethostent_r (struct hostent *__restrict __result_buf,
  186.              char *__restrict __buf, size_t __buflen,
  187.              struct hostent **__restrict __result,
  188.              int *__restrict __h_errnop);
  189.  
  190. extern int gethostbyaddr_r (__const void *__restrict __addr, __socklen_t __len,
  191.                 int __type,
  192.                 struct hostent *__restrict __result_buf,
  193.                 char *__restrict __buf, size_t __buflen,
  194.                 struct hostent **__restrict __result,
  195.                 int *__restrict __h_errnop);
  196.  
  197. extern int gethostbyname_r (__const char *__restrict __name,
  198.                 struct hostent *__restrict __result_buf,
  199.                 char *__restrict __buf, size_t __buflen,
  200.                 struct hostent **__restrict __result,
  201.                 int *__restrict __h_errnop);
  202.  
  203. extern int gethostbyname2_r (__const char *__restrict __name, int __af,
  204.                  struct hostent *__restrict __result_buf,
  205.                  char *__restrict __buf, size_t __buflen,
  206.                  struct hostent **__restrict __result,
  207.                  int *__restrict __h_errnop);
  208. #endif    /* misc */
  209.  
  210.  
  211. /* Open network data base files and mark them as staying open even
  212.    after a later search if STAY_OPEN is non-zero.  */
  213. extern void setnetent (int __stay_open);
  214.  
  215. /* Close network data base files and clear `stay open' flag.  */
  216. extern void endnetent (void);
  217.  
  218. /* Get next entry from network data base file.  Open data base if
  219.    necessary.  */
  220. extern struct netent *getnetent (void);
  221.  
  222. /* Return entry from network data base which address match NET and
  223.    type TYPE.  */
  224. extern struct netent *getnetbyaddr (uint32_t __net, int __type);
  225.  
  226. /* Return entry from network data base for network with NAME.  */
  227. extern struct netent *getnetbyname (__const char *__name);
  228.  
  229. #ifdef    __USE_MISC
  230. /* Reentrant versions of the functions above.  The additional
  231.    arguments specify a buffer of BUFLEN starting at BUF.  The last
  232.    argument is a pointer to a variable which gets the value which
  233.    would be stored in the global variable `herrno' by the
  234.    non-reentrant functions.  */
  235. extern int getnetent_r (struct netent *__restrict __result_buf,
  236.             char *__restrict __buf, size_t __buflen,
  237.             struct netent **__restrict __result,
  238.             int *__restrict __h_errnop);
  239.  
  240. extern int getnetbyaddr_r (uint32_t __net, int __type,
  241.                struct netent *__restrict __result_buf,
  242.                char *__restrict __buf, size_t __buflen,
  243.                struct netent **__restrict __result,
  244.                int *__restrict __h_errnop);
  245.  
  246. extern int getnetbyname_r (__const char *__restrict __name,
  247.                struct netent *__restrict __result_buf,
  248.                char *__restrict __buf, size_t __buflen,
  249.                struct netent **__restrict __result,
  250.                int *__restrict __h_errnop);
  251. #endif    /* misc */
  252.  
  253.  
  254. /* Description of data base entry for a single service.  */
  255. struct servent
  256. {
  257.   char *s_name;            /* Official service name.  */
  258.   char **s_aliases;        /* Alias list.  */
  259.   int s_port;            /* Port number.  */
  260.   char *s_proto;        /* Protocol to use.  */
  261. };
  262.  
  263. /* Open service data base files and mark them as staying open even
  264.    after a later search if STAY_OPEN is non-zero.  */
  265. extern void setservent (int __stay_open);
  266.  
  267. /* Close service data base files and clear `stay open' flag.  */
  268. extern void endservent (void);
  269.  
  270. /* Get next entry from service data base file.  Open data base if
  271.    necessary.  */
  272. extern struct servent *getservent (void);
  273.  
  274. /* Return entry from network data base for network with NAME and
  275.    protocol PROTO.  */
  276. extern struct servent *getservbyname (__const char *__name,
  277.                       __const char *__proto);
  278.  
  279. /* Return entry from service data base which matches port PORT and
  280.    protocol PROTO.  */
  281. extern struct servent *getservbyport (int __port, __const char *__proto);
  282.  
  283.  
  284. #ifdef    __USE_MISC
  285. /* Reentrant versions of the functions above.  The additional
  286.    arguments specify a buffer of BUFLEN starting at BUF.  */
  287. extern int getservent_r (struct servent *__restrict __result_buf,
  288.              char *__restrict __buf, size_t __buflen,
  289.              struct servent **__restrict __result);
  290.  
  291. extern int getservbyname_r (__const char *__restrict __name,
  292.                 __const char *__restrict __proto,
  293.                 struct servent *__restrict __result_buf,
  294.                 char *__restrict __buf, size_t __buflen,
  295.                 struct servent **__restrict __result);
  296.  
  297. extern int getservbyport_r (int __port, __const char *__restrict __proto,
  298.                 struct servent *__restrict __result_buf,
  299.                 char *__restrict __buf, size_t __buflen,
  300.                 struct servent **__restrict __result);
  301. #endif    /* misc */
  302.  
  303.  
  304. /* Description of data base entry for a single service.  */
  305. struct protoent
  306. {
  307.   char *p_name;            /* Official protocol name.  */
  308.   char **p_aliases;        /* Alias list.  */
  309.   int p_proto;            /* Protocol number.  */
  310. };
  311.  
  312. /* Open protocol data base files and mark them as staying open even
  313.    after a later search if STAY_OPEN is non-zero.  */
  314. extern void setprotoent (int __stay_open);
  315.  
  316. /* Close protocol data base files and clear `stay open' flag.  */
  317. extern void endprotoent (void);
  318.  
  319. /* Get next entry from protocol data base file.  Open data base if
  320.    necessary.  */
  321. extern struct protoent *getprotoent (void);
  322.  
  323. /* Return entry from protocol data base for network with NAME.  */
  324. extern struct protoent *getprotobyname (__const char *__name);
  325.  
  326. /* Return entry from protocol data base which number is PROTO.  */
  327. extern struct protoent *getprotobynumber (int __proto);
  328.  
  329.  
  330. #ifdef    __USE_MISC
  331. #if 0
  332. /* Reentrant versions of the functions above.  The additional
  333.    arguments specify a buffer of BUFLEN starting at BUF.  */
  334. extern int getprotoent_r (struct protoent *__restrict __result_buf,
  335.               char *__restrict __buf, size_t __buflen,
  336.               struct protoent **__restrict __result);
  337.  
  338. extern int getprotobyname_r (__const char *__restrict __name,
  339.                  struct protoent *__restrict __result_buf,
  340.                  char *__restrict __buf, size_t __buflen,
  341.                  struct protoent **__restrict __result);
  342.  
  343. extern int getprotobynumber_r (int __proto,
  344.                    struct protoent *__restrict __result_buf,
  345.                    char *__restrict __buf, size_t __buflen,
  346.                    struct protoent **__restrict __result);
  347. #endif
  348. #endif    /* misc */
  349.  
  350.  
  351. /* Establish network group NETGROUP for enumeration.  */
  352. extern int setnetgrent (__const char *__netgroup);
  353.  
  354. /* Free all space allocated by previous `setnetgrent' call.  */
  355. extern void endnetgrent (void);
  356.  
  357. /* Get next member of netgroup established by last `setnetgrent' call
  358.    and return pointers to elements in HOSTP, USERP, and DOMAINP.  */
  359. extern int getnetgrent (char **__restrict __hostp,
  360.             char **__restrict __userp,
  361.             char **__restrict __domainp);
  362.  
  363. #ifdef    __USE_MISC
  364. /* Test whether NETGROUP contains the triple (HOST,USER,DOMAIN).  */
  365. extern int innetgr (__const char *__netgroup, __const char *__host,
  366.             __const char *__user, __const char *domain);
  367.  
  368. /* Reentrant version of `getnetgrent' where result is placed in BUFFER.  */
  369. extern int getnetgrent_r (char **__restrict __hostp,
  370.               char **__restrict __userp,
  371.               char **__restrict __domainp,
  372.               char *__restrict __buffer, size_t __buflen);
  373. #endif    /* misc */
  374.  
  375.  
  376. #ifdef __USE_BSD
  377. /* Call `rshd' at port RPORT on remote machine *AHOST to execute CMD.
  378.    The local user is LOCUSER, on the remote machine the command is
  379.    executed as REMUSER.  In *FD2P the descriptor to the socket for the
  380.    connection is returned.  The caller must have the right to use a
  381.    reserved port.  When the function returns *AHOST contains the
  382.    official host name.  */
  383. extern int rcmd (char **__restrict __ahost, unsigned short int __rport,
  384.          __const char *__restrict __locuser,
  385.          __const char *__restrict __remuser,
  386.          __const char *__restrict __cmd, int *__restrict __fd2p);
  387.  
  388. /* This is the equivalent function where the protocol can be selected
  389.    and which therefore can be used for IPv6.  */
  390. extern int rcmd_af (char **__restrict __ahost, unsigned short int __rport,
  391.             __const char *__restrict __locuser,
  392.             __const char *__restrict __remuser,
  393.             __const char *__restrict __cmd, int *__restrict __fd2p,
  394.             sa_family_t __af);
  395.  
  396. /* Call `rexecd' at port RPORT on remote machine *AHOST to execute
  397.    CMD.  The process runs at the remote machine using the ID of user
  398.    NAME whose cleartext password is PASSWD.  In *FD2P the descriptor
  399.    to the socket for the connection is returned.  When the function
  400.    returns *AHOST contains the official host name.  */
  401. extern int rexec (char **__restrict __ahost, int __rport,
  402.           __const char *__restrict __name,
  403.           __const char *__restrict __pass,
  404.           __const char *__restrict __cmd, int *__restrict __fd2p);
  405.  
  406. /* This is the equivalent function where the protocol can be selected
  407.    and which therefore can be used for IPv6.  */
  408. extern int rexec_af (char **__restrict __ahost, int __rport,
  409.              __const char *__restrict __name,
  410.              __const char *__restrict __pass,
  411.              __const char *__restrict __cmd, int *__restrict __fd2p,
  412.              sa_family_t __af);
  413.  
  414. /* Check whether user REMUSER on system RHOST is allowed to login as LOCUSER.
  415.    If SUSER is not zero the user tries to become superuser.  Return 0 if
  416.    it is possible.  */
  417. extern int ruserok (__const char *__rhost, int __suser,
  418.             __const char *__remuser, __const char *__locuser);
  419.  
  420. /* This is the equivalent function where the protocol can be selected
  421.    and which therefore can be used for IPv6.  */
  422. extern int ruserok_af (__const char *__rhost, int __suser,
  423.                __const char *__remuser, __const char *__locuser,
  424.                sa_family_t __af);
  425.  
  426. /* Try to allocate reserved port, returning a descriptor for a socket opened
  427.    at this port or -1 if unsuccessful.  The search for an available port
  428.    will start at ALPORT and continues with lower numbers.  */
  429. extern int rresvport (int *__alport);
  430.  
  431. /* This is the equivalent function where the protocol can be selected
  432.    and which therefore can be used for IPv6.  */
  433. extern int rresvport_af (int *__alport, sa_family_t __af);
  434. #endif
  435.  
  436.  
  437. /* Extension from POSIX.1g.  */
  438. #ifdef    __USE_POSIX
  439. /* Structure to contain information about address of a service provider.  */
  440. struct addrinfo
  441. {
  442.   int ai_flags;            /* Input flags.  */
  443.   int ai_family;        /* Protocol family for socket.  */
  444.   int ai_socktype;        /* Socket type.  */
  445.   int ai_protocol;        /* Protocol for socket.  */
  446.   socklen_t ai_addrlen;        /* Length of socket address.  */
  447.   struct sockaddr *ai_addr;    /* Socket address for socket.  */
  448.   char *ai_canonname;        /* Canonical name for service location.  */
  449.   struct addrinfo *ai_next;    /* Pointer to next in list.  */
  450. };
  451.  
  452. # ifdef __USE_GNU
  453. /* Structure used as control block for asynchronous lookup.  */
  454. struct gaicb
  455. {
  456.   const char *ar_name;        /* Name to look up.  */
  457.   const char *ar_service;    /* Service name.  */
  458.   const struct addrinfo *ar_request; /* Additional request specification.  */
  459.   struct addrinfo *ar_result;    /* Pointer to result.  */
  460.   /* The following are internal elements.  */
  461.   int __return;
  462.   int __unused[5];
  463. };
  464.  
  465. /* Lookup mode.  */
  466. #  define GAI_WAIT    0
  467. #  define GAI_NOWAIT    1
  468. # endif
  469.  
  470. /* Possible values for `ai_flags' field in `addrinfo' structure.  */
  471. # define AI_PASSIVE    0x0001    /* Socket address is intended for `bind'.  */
  472. # define AI_ALL        0x0002
  473. # define AI_CANONNAME    0x0004    /* Request for canonical name.  */
  474. # define AI_NUMERICHOST    0x0008    /* Don't use name resolution.  */
  475. # define AI_NUMERICSERV    0x0010
  476. # define AI_V4MAPPED    0x0040
  477. # define AI_DEFAULT    (AI_V4MAPPED | AI_ADDRCONFIG)
  478.  
  479.  
  480. /* Error values for `getaddrinfo' function.  */
  481. # define EAI_BADFLAGS      -1    /* Invalid value for `ai_flags' field.  */
  482. # define EAI_NONAME      -2    /* NAME or SERVICE is unknown.  */
  483. # define EAI_AGAIN      -3    /* Temporary failure in name resolution.  */
  484. # define EAI_FAIL      -4    /* Non-recoverable failure in name res.  */
  485. # define EAI_NODATA      -5    /* No address associated with NAME.  */
  486. # define EAI_FAMILY      -6    /* `ai_family' not supported.  */
  487. # define EAI_SOCKTYPE      -7    /* `ai_socktype' not supported.  */
  488. # define EAI_SERVICE      -8    /* SERVICE not supported for `ai_socktype'.  */
  489. # define EAI_ADDRFAMILY      -9    /* Address family for NAME not supported.  */
  490. # define EAI_MEMORY      -10    /* Memory allocation failure.  */
  491. # define EAI_SYSTEM      -11    /* System error returned in `errno'.  */
  492. # define EAI_BADHINTS      -12
  493. # define EAI_PROTOCOL      -13
  494. # define EAI_OVERFLOW      -14
  495. # define EAI_MAX      -15
  496.  
  497. # ifdef __USE_GNU
  498. #  define EAI_INPROGRESS  -100    /* Processing request in progress.  */
  499. #  define EAI_CANCELED      -101    /* Request canceled.  */
  500. #  define EAI_NOTCANCELED -102    /* Request not canceled.  */
  501. #  define EAI_ALLDONE      -103    /* All requests done.  */
  502. #  define EAI_INTR      -104    /* Interrupted by a signal.  */
  503. # endif
  504.  
  505. # define NI_MAXHOST      1025
  506. # define NI_MAXSERV      32
  507.  
  508. # define NI_NUMERICHOST    1    /* Don't try to look up hostname.  */
  509. # define NI_NUMERICSERV 2    /* Don't convert port number to name.  */
  510. # define NI_NOFQDN    4    /* Only return nodename portion.  */
  511. # define NI_NAMEREQD    8    /* Don't return numeric addresses.  */
  512. # define NI_DGRAM    16    /* Look up UDP service rather than TCP.  */
  513.  
  514. /* Translate name of a service location and/or a service name to set of
  515.    socket addresses.  */
  516. extern int getaddrinfo (__const char *__restrict __name,
  517.             __const char *__restrict __service,
  518.             __const struct addrinfo *__restrict __req,
  519.             struct addrinfo **__restrict __pai);
  520.  
  521. /* Free `addrinfo' structure AI including associated storage.  */
  522. extern void freeaddrinfo (struct addrinfo *__ai);
  523.  
  524. /* Convert error return from getaddrinfo() to a string.  */
  525. extern __const char *gai_strerror (int __ecode);
  526.  
  527. /* Translate a socket address to a location and service name.  */
  528. extern int getnameinfo (__const struct sockaddr *__restrict __sa,
  529.             socklen_t __salen, char *__restrict __host,
  530.             socklen_t __hostlen, char *__restrict __serv,
  531.             socklen_t __servlen, unsigned int __flags);
  532.  
  533. # if 0
  534. # ifdef __USE_GNU
  535. /* Enqueue ENT requests from the LIST.  If MODE is GAI_WAIT wait until all
  536.    requests are handled.  If WAIT is GAI_NOWAIT return immediately after
  537.    queueing the requests and signal completion according to SIG.  */
  538. extern int getaddrinfo_a (int __mode, struct gaicb *__list[__restrict_arr],
  539.               int __ent, struct sigevent *__restrict __sig);
  540.  
  541. /* Suspend execution of the thread until at least one of the ENT requests
  542.    in LIST is handled.  If TIMEOUT is not a null pointer it specifies the
  543.    longest time the function keeps waiting before returning with an error.  */
  544. extern int gai_suspend (__const struct gaicb *__const __list[], int __ent,
  545.             __const struct timespec *__timeout);
  546.  
  547. /* Get the error status of the request REQ.  */
  548. extern int gai_error (struct gaicb *__req);
  549.  
  550. /* Cancel the requests associated with GAICBP.  */
  551. extern int gai_cancel (struct gaicb *__gaicbp);
  552. # endif
  553. # endif    /* GNU */
  554. #endif    /* POSIX */
  555.  
  556. __END_DECLS
  557.  
  558. #endif    /* netdb.h */
  559.