diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2006-11-02 21:48:41 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2006-11-02 21:48:41 +0000 |
commit | 068c3ee1df9be23ee252428b87cfcf2c43cda3cf (patch) | |
tree | a874ea91a3d48ab47e2957c97c1e7ea1dbe6f3fe /cpukit/libnetworking/netdb.h | |
parent | 2006-11-01 Joel Sherrill <joel@OARcorp.com> (diff) | |
download | rtems-068c3ee1df9be23ee252428b87cfcf2c43cda3cf.tar.bz2 |
2006-11-02 Steven Johnson <sjohnson@sakuraindustries.com>
* libnetworking/netdb.h, libnetworking/libc/gethostbyht.c,
libnetworking/libc/gethostnamadr.c: This patch adds a functional
gethostbyname_r to RTEMS. We were having problems with multiple
threads calling gethostbyname, so we decided the best way to deal
with it was to do it properly, rather than kludge up our code to make
gethostbyname safe. We have found several slightly different
parameter lists for this function, it does not seem to be standard.
The one we used has the linux interface. In RTEMS there was an
existing gethostbyname_r inside a #ifdef _THREAD_SAFE which was NOT
Threadsafe, as this just called gethostbyname. So we have placed all
of the additional code inside the #ifdef _THREAD_SAFE.
Diffstat (limited to 'cpukit/libnetworking/netdb.h')
-rw-r--r-- | cpukit/libnetworking/netdb.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/cpukit/libnetworking/netdb.h b/cpukit/libnetworking/netdb.h index 29350e063b..3a12fda74d 100644 --- a/cpukit/libnetworking/netdb.h +++ b/cpukit/libnetworking/netdb.h @@ -160,6 +160,16 @@ void setnetent(int); void setprotoent(int); void setservent(int); +#ifdef _THREAD_SAFE +struct hostent* gethostent_r(char* buf, int len); +int gethostbyname_r(const char* name, + struct hostent* result, + char *buf, + int buflen, + struct hostent **RESULT, + int *h_errnop) ; +#endif + /* * PRIVATE functions specific to the FreeBSD implementation */ |