[off-topic] gethostbyname_r prototype
Hi,
Sorry for the off-topic question but since I am using Debian, I figured
why not.
I am trying to find the man page for the netdb reentrant functions, e.g.
gethostbyname_r. Unfortunately, they don't seem to be available in the
man directories. I thought that I had all of the man pages I needed
installed. Are there any that I may be missing, i.e. contain the man
pages for the netdb reentrant functions?
If they aren't available, I was hoping some could answer my question.
According to /usr/include/netdb.h, the prototype for gethostbyname_r is:
extern int gethostbyname_r __P ((__const char *__name,
struct hostent *__result_buf, char *__buf,
size_t __buflen, struct hostent **__result,
int *__h_errnop));
where on Solaris, and most other platforms, it is:
struct hostent *gethostbyname_r(const char *name,
struct hostent *result, char *buffer, int buflen,
int *h_errnop);
Glibc2 adds an additional argument and returns int instead of struct
hostent *. The additional argument is struct hostent **__result. Does
this mean that I must dereference struct hostent **__result to get struct
hostent *__result, which would then be analogous to the return value of
the Solaris version "struct hostent *?"
TIA,
-Ossama
______________________________________________________________________
Ossama Othman <othman@astrosun.tn.cornell.edu>
Reply to: