home *** CD-ROM | disk | FTP | other *** search
/ RISCWORLD 7 / RISCWORLD_VOL7.iso / Software / Issue2 / SDL.ARC / !unixlib / source / clib / h / netdb < prev    next >
Encoding:
Text File  |  2004-10-05  |  20.7 KB  |  567 lines

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