Changeset 068c3ee1 in rtems for cpukit/libnetworking/netdb.h


Ignore:
Timestamp:
Nov 2, 2006, 9:48:41 PM (15 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
918b7a9
Parents:
e1d578d8
Message:

2006-11-02 Steven Johnson <sjohnson@…>

  • 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.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/libnetworking/netdb.h

    re1d578d8 r068c3ee1  
    161161void            setservent(int);
    162162
     163#ifdef _THREAD_SAFE
     164struct hostent* gethostent_r(char* buf, int len);
     165int gethostbyname_r(const char*      name,
     166                    struct hostent*  result,
     167                    char            *buf,
     168                    int              buflen,
     169                    struct hostent **RESULT,
     170                    int             *h_errnop) ;
     171#endif             
     172
    163173/*
    164174 * PRIVATE functions specific to the FreeBSD implementation
Note: See TracChangeset for help on using the changeset viewer.