]> granicus.if.org Git - php/commitdiff
Add thread-safety notice here. The solution is using gethostbyname_r,
authorStig Bakken <ssb@php.net>
Tue, 7 Sep 1999 18:46:25 +0000 (18:46 +0000)
committerStig Bakken <ssb@php.net>
Tue, 7 Sep 1999 18:46:25 +0000 (18:46 +0000)
but it seems that it takes different parameters on Solaris and
Linux. ;-P We should probably make a wrapper function, and make a
configure test that checks if there is a reentrant version available,
and if not protect gethostbyname and similar calls with a mutex until
the results have been copied.  Ugly.

ext/standard/fsock.c

index 3a653af83f7a1810db7e13af5eb24660d84d7b30..dd353a3ce2c42a6ed70eb6b1dd74364232e8093b 100644 (file)
@@ -131,6 +131,7 @@ int lookup_hostname(const char *addr, struct in_addr *in)
        struct hostent *host_info;
 
        if (!inet_aton(addr, in)) {
+               /* XXX NOT THREAD SAFE */
                host_info = gethostbyname(addr);
                if (host_info == 0) {
                        /* Error: unknown host */