Print this page
Finished obsoleting interfaces for XPG7.

Split Close
Expand all
Collapse all
          --- old/usr/src/head/netdb.h
          +++ new/usr/src/head/netdb.h
↓ open down ↓ 221 lines elided ↑ open up ↑
 222  222          int     p_proto;        /* protocol # */
 223  223  };
 224  224  
 225  225  struct  servent {
 226  226          char    *s_name;        /* official service name */
 227  227          char    **s_aliases;    /* alias list */
 228  228          int     s_port;         /* port # */
 229  229          char    *s_proto;       /* protocol to use */
 230  230  };
 231  231  
 232      -#ifdef  __STDC__
 233  232  #if !defined(_XPG4_2) || defined(__EXTENSIONS__)
 234  233  struct hostent  *gethostbyname_r
 235  234          (const char *, struct hostent *, char *, int, int *h_errnop);
 236  235  struct hostent  *gethostbyaddr_r
 237  236          (const char *, int, int, struct hostent *, char *, int, int *h_errnop);
 238  237  struct hostent  *getipnodebyname(const char *, int, int, int *);
 239  238  struct hostent  *getipnodebyaddr(const void *, size_t, int, int *);
 240  239  void            freehostent(struct hostent *);
 241  240  struct hostent  *gethostent_r(struct hostent *, char *, int, int *h_errnop);
 242  241  
↓ open down ↓ 12 lines elided ↑ open up ↑
 255  254          (const char *, struct protoent *, char *, int);
 256  255  struct protoent *getprotobynumber_r
 257  256          (int, struct protoent *, char *, int);
 258  257  struct protoent *getprotoent_r(struct protoent *, char *, int);
 259  258  
 260  259  int getnetgrent_r(char **, char **, char **, char *, int);
 261  260  int innetgr(const char *, const char *, const char *, const char *);
 262  261  #endif /* !defined(_XPG4_2) || defined(__EXTENSIONS__) */
 263  262  
 264  263  /* Old interfaces that return a pointer to a static area;  MT-unsafe */
      264 +#ifndef _STRICT_XPG7
 265  265  struct hostent  *gethostbyname(const char *);
      266 +#endif
 266  267  struct hostent  *gethostent(void);
 267  268  struct netent   *getnetbyaddr(in_addr_t, int);
 268  269  struct netent   *getnetbyname(const char *);
 269  270  struct netent   *getnetent(void);
 270  271  struct protoent *getprotobyname(const char *);
 271  272  struct protoent *getprotobynumber(int);
 272  273  struct protoent *getprotoent(void);
 273  274  struct servent  *getservbyname(const char *, const char *);
 274  275  struct servent  *getservbyport(int, const char *);
 275  276  struct servent  *getservent(void);
 276  277  
 277      -/* gethostbyaddr() second argument is a size_t only in unix95/unix98 */
      278 +/*
      279 + * gethostbyaddr() second argument is a size_t only in unix95/unix98,
      280 + * removed in XPG issue 7
      281 + */
      282 +#if !defined(_STRICT_XPG7)
 278  283  #if !defined(_XPG4_2) || defined(_XPG6) || defined(__EXTENSIONS__)
 279  284  struct hostent  *gethostbyaddr(const void *, socklen_t, int);
 280  285  #else
 281  286  struct hostent  *gethostbyaddr(const void *, size_t, int);
 282  287  #endif /* !defined(_XPG4_2) || defined(_XPG6) || defined(__EXTENSIONS__) */
      288 +#endif  /* !defined(_STRICT_XPG7) */
 283  289  
 284  290  #if !defined(_XPG4_2) || defined(__EXTENSIONS__)
 285  291  int endhostent(void);
 286  292  int endnetent(void);
 287  293  int endprotoent(void);
 288  294  int endservent(void);
 289  295  int sethostent(int);
 290  296  int setnetent(int);
 291  297  int setprotoent(int);
 292  298  int setservent(int);
↓ open down ↓ 53 lines elided ↑ open up ↑
 346  352  
 347  353  /* IPsec algorithm prototype definitions */
 348  354  struct ipsecalgent *getipsecalgbyname(const char *, int, int *);
 349  355  struct ipsecalgent *getipsecalgbynum(int, int, int *);
 350  356  int getipsecprotobyname(const char *doi_name);
 351  357  char *getipsecprotobynum(int doi_domain);
 352  358  void freeipsecalgent(struct ipsecalgent *ptr);
 353  359  /* END IPsec algorithm prototype definitions */
 354  360  
 355  361  #endif /* !defined(_XPG4_2) || defined(__EXTENSIONS__) */
 356      -#else   /* __STDC__ */
 357      -struct hostent  *gethostbyname_r();
 358      -struct hostent  *gethostbyaddr_r();
 359      -struct hostent  *getipnodebyname();
 360      -struct hostent  *getipnodebyaddr();
 361      -void             freehostent();
 362      -struct hostent  *gethostent_r();
 363      -struct servent  *getservbyname_r();
 364      -struct servent  *getservbyport_r();
 365      -struct servent  *getservent_r();
 366      -struct netent   *getnetbyname_r();
 367      -struct netent   *getnetbyaddr_r();
 368      -struct netent   *getnetent_r();
 369      -struct protoent *getprotobyname_r();
 370      -struct protoent *getprotobynumber_r();
 371      -struct protoent *getprotoent_r();
 372      -int              getnetgrent_r();
 373      -int              innetgr();
 374  362  
 375      -/* Old interfaces that return a pointer to a static area;  MT-unsafe */
 376      -struct hostent  *gethostbyname();
 377      -struct hostent  *gethostbyaddr();
 378      -struct hostent  *gethostent();
 379      -struct netent   *getnetbyname();
 380      -struct netent   *getnetbyaddr();
 381      -struct netent   *getnetent();
 382      -struct servent  *getservbyname();
 383      -struct servent  *getservbyport();
 384      -struct servent  *getservent();
 385      -struct protoent *getprotobyname();
 386      -struct protoent *getprotobynumber();
 387      -struct protoent *getprotoent();
 388      -int              getnetgrent();
 389      -
 390      -int sethostent();
 391      -int endhostent();
 392      -int setnetent();
 393      -int endnetent();
 394      -int setservent();
 395      -int endservent();
 396      -int setprotoent();
 397      -int endprotoent();
 398      -int setnetgrent();
 399      -int endnetgrent();
 400      -int rcmd();
 401      -int rcmd_af();
 402      -int rexec();
 403      -int rexec_af();
 404      -int rresvport();
 405      -int rresvport_af();
 406      -int rresvport_addr();
 407      -int ruserok();
 408      -/* BIND */
 409      -struct hostent  *gethostbyname2();
 410      -void            herror();
 411      -char            *hstrerror();
 412      -/* IPv6 prototype definitons */
 413      -int             getaddrinfo();
 414      -void            freeaddrinfo();
 415      -const char      *gai_strerror();
 416      -int             getnameinfo();
 417      -/* END IPv6 prototype definitions */
 418      -/* End BIND */
 419      -
 420      -#if !defined(_XPG4_2) || defined(__EXTENSIONS__)
 421      -/* IPsec algorithm prototype definitions */
 422      -struct ipsecalgent *getalgbyname();
 423      -struct ipsecalgent *getalgbydoi();
 424      -int getdoidomainbyname();
 425      -const char *getdoidomainbynum();
 426      -void freealgent();
 427      -/* END IPsec algorithm prototype definitions */
 428      -#endif /* !defined(_XPG4_2) || defined(__EXTENSIONS__) */
 429      -
 430      -#endif  /* __STDC__ */
 431      -
 432  363  /*
 433  364   * Error return codes from gethostbyname() and gethostbyaddr()
 434  365   * (when using the resolver)
 435  366   */
 436  367  
      368 +/* h_errno was removed in Issue 7 */
      369 +#if !defined(_STRICT_XPG7)
 437  370  extern  int h_errno;
 438  371  
 439  372  #ifdef  _REENTRANT
 440      -#ifdef  __STDC__
 441  373  extern int      *__h_errno(void);
 442      -#else
 443      -extern int      *__h_errno();
 444      -#endif  /* __STDC__ */
 445  374  
 446  375  /* Only #define h_errno if there is no conflict with other use */
 447  376  #ifdef  H_ERRNO_IS_FUNCTION
 448  377  #define h_errno (*__h_errno())
 449  378  #endif  /* NO_H_ERRNO_DEFINE */
 450  379  #endif  /* _REENTRANT */
 451  380  
 452  381  /*
 453  382   * Error return codes from gethostbyname() and gethostbyaddr()
 454  383   * (left in extern int h_errno).
↓ open down ↓ 4 lines elided ↑ open up ↑
 459  388  #define NO_DATA         4 /* Valid name, no data record of requested type */
 460  389  
 461  390  #if !defined(_XPG4_2) || defined(__EXTENSIONS__)
 462  391  #define NO_ADDRESS      NO_DATA         /* no address, look for MX record */
 463  392  
 464  393  /* BIND */
 465  394  #define NETDB_INTERNAL  -1      /* see errno */
 466  395  #define NETDB_SUCCESS   0       /* no problem */
 467  396  /* End BIND */
 468  397  
      398 +#endif  /* !defined(_STRICT_XPG7) */
      399 +
 469  400  #define MAXHOSTNAMELEN  256
 470  401  
 471  402  #define MAXALIASES      35
 472  403  #define MAXADDRS        35
 473  404  #endif /* !defined(_XPG4_2) || defined(__EXTENSIONS__) */
 474  405  
 475  406  #ifdef  __cplusplus
 476  407  }
 477  408  #endif
 478  409  
 479  410  #endif  /* _NETDB_H */
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX