Print this page
Finished obsoleting interfaces for XPG7.

@@ -227,11 +227,10 @@
         char    **s_aliases;    /* alias list */
         int     s_port;         /* port # */
         char    *s_proto;       /* protocol to use */
 };
 
-#ifdef  __STDC__
 #if !defined(_XPG4_2) || defined(__EXTENSIONS__)
 struct hostent  *gethostbyname_r
         (const char *, struct hostent *, char *, int, int *h_errnop);
 struct hostent  *gethostbyaddr_r
         (const char *, int, int, struct hostent *, char *, int, int *h_errnop);

@@ -260,11 +259,13 @@
 int getnetgrent_r(char **, char **, char **, char *, int);
 int innetgr(const char *, const char *, const char *, const char *);
 #endif /* !defined(_XPG4_2) || defined(__EXTENSIONS__) */
 
 /* Old interfaces that return a pointer to a static area;  MT-unsafe */
+#ifndef _STRICT_XPG7
 struct hostent  *gethostbyname(const char *);
+#endif
 struct hostent  *gethostent(void);
 struct netent   *getnetbyaddr(in_addr_t, int);
 struct netent   *getnetbyname(const char *);
 struct netent   *getnetent(void);
 struct protoent *getprotobyname(const char *);

@@ -272,16 +273,21 @@
 struct protoent *getprotoent(void);
 struct servent  *getservbyname(const char *, const char *);
 struct servent  *getservbyport(int, const char *);
 struct servent  *getservent(void);
 
-/* gethostbyaddr() second argument is a size_t only in unix95/unix98 */
+/*
+ * gethostbyaddr() second argument is a size_t only in unix95/unix98,
+ * removed in XPG issue 7
+ */
+#if !defined(_STRICT_XPG7)
 #if !defined(_XPG4_2) || defined(_XPG6) || defined(__EXTENSIONS__)
 struct hostent  *gethostbyaddr(const void *, socklen_t, int);
 #else
 struct hostent  *gethostbyaddr(const void *, size_t, int);
 #endif /* !defined(_XPG4_2) || defined(_XPG6) || defined(__EXTENSIONS__) */
+#endif  /* !defined(_STRICT_XPG7) */
 
 #if !defined(_XPG4_2) || defined(__EXTENSIONS__)
 int endhostent(void);
 int endnetent(void);
 int endprotoent(void);

@@ -351,99 +357,22 @@
 char *getipsecprotobynum(int doi_domain);
 void freeipsecalgent(struct ipsecalgent *ptr);
 /* END IPsec algorithm prototype definitions */
 
 #endif /* !defined(_XPG4_2) || defined(__EXTENSIONS__) */
-#else   /* __STDC__ */
-struct hostent  *gethostbyname_r();
-struct hostent  *gethostbyaddr_r();
-struct hostent  *getipnodebyname();
-struct hostent  *getipnodebyaddr();
-void             freehostent();
-struct hostent  *gethostent_r();
-struct servent  *getservbyname_r();
-struct servent  *getservbyport_r();
-struct servent  *getservent_r();
-struct netent   *getnetbyname_r();
-struct netent   *getnetbyaddr_r();
-struct netent   *getnetent_r();
-struct protoent *getprotobyname_r();
-struct protoent *getprotobynumber_r();
-struct protoent *getprotoent_r();
-int              getnetgrent_r();
-int              innetgr();
 
-/* Old interfaces that return a pointer to a static area;  MT-unsafe */
-struct hostent  *gethostbyname();
-struct hostent  *gethostbyaddr();
-struct hostent  *gethostent();
-struct netent   *getnetbyname();
-struct netent   *getnetbyaddr();
-struct netent   *getnetent();
-struct servent  *getservbyname();
-struct servent  *getservbyport();
-struct servent  *getservent();
-struct protoent *getprotobyname();
-struct protoent *getprotobynumber();
-struct protoent *getprotoent();
-int              getnetgrent();
-
-int sethostent();
-int endhostent();
-int setnetent();
-int endnetent();
-int setservent();
-int endservent();
-int setprotoent();
-int endprotoent();
-int setnetgrent();
-int endnetgrent();
-int rcmd();
-int rcmd_af();
-int rexec();
-int rexec_af();
-int rresvport();
-int rresvport_af();
-int rresvport_addr();
-int ruserok();
-/* BIND */
-struct hostent  *gethostbyname2();
-void            herror();
-char            *hstrerror();
-/* IPv6 prototype definitons */
-int             getaddrinfo();
-void            freeaddrinfo();
-const char      *gai_strerror();
-int             getnameinfo();
-/* END IPv6 prototype definitions */
-/* End BIND */
-
-#if !defined(_XPG4_2) || defined(__EXTENSIONS__)
-/* IPsec algorithm prototype definitions */
-struct ipsecalgent *getalgbyname();
-struct ipsecalgent *getalgbydoi();
-int getdoidomainbyname();
-const char *getdoidomainbynum();
-void freealgent();
-/* END IPsec algorithm prototype definitions */
-#endif /* !defined(_XPG4_2) || defined(__EXTENSIONS__) */
-
-#endif  /* __STDC__ */
-
 /*
  * Error return codes from gethostbyname() and gethostbyaddr()
  * (when using the resolver)
  */
 
+/* h_errno was removed in Issue 7 */
+#if !defined(_STRICT_XPG7)
 extern  int h_errno;
 
 #ifdef  _REENTRANT
-#ifdef  __STDC__
 extern int      *__h_errno(void);
-#else
-extern int      *__h_errno();
-#endif  /* __STDC__ */
 
 /* Only #define h_errno if there is no conflict with other use */
 #ifdef  H_ERRNO_IS_FUNCTION
 #define h_errno (*__h_errno())
 #endif  /* NO_H_ERRNO_DEFINE */

@@ -464,10 +393,12 @@
 /* BIND */
 #define NETDB_INTERNAL  -1      /* see errno */
 #define NETDB_SUCCESS   0       /* no problem */
 /* End BIND */
 
+#endif  /* !defined(_STRICT_XPG7) */
+
 #define MAXHOSTNAMELEN  256
 
 #define MAXALIASES      35
 #define MAXADDRS        35
 #endif /* !defined(_XPG4_2) || defined(__EXTENSIONS__) */