--On Monday, September 08, 2003 12:50:18 -0400 Bruce Momjian
<pgman@candle.pha.pa.us> wrote:
> Jeroen Ruigrok/asmodai wrote:
>> -On [20030908 06:32], Bruce Momjian (pgman@candle.pha.pa.us) wrote:
>> >> Your gethostbyname() is _not_ thread-safe
>> >> Your getpwuid() is _not_ thread-safe
>> >> Your functions are _not_ all thread-safe
>> >
>> > Interesting. Do you have all the *_r files listed in thread.c? I sure
>> > hope so. I assume you used the template thread compile flags for this
>> > test.
>>
>> Both gethostbyname() and getpwuid() have no _r equivalents on
>> FreeBSD-STABLE, ergo no thread-safe functions of these.
>
> So you don't have all the *_r functions, and your non-*_r functions
> aren't thread-safe. Should we disable theading on FreeBSD? Seems so.
Same is true on 5.1-CURRENT:
$ uname -a
FreeBSD lerlaptop-red.iadfw.net 5.1-CURRENT FreeBSD 5.1-CURRENT #51: Mon
Sep 8 05:52:15 CDT 2003
ler@lerlaptop.lerctr.org:/usr/obj/usr/src/sys/LERLAPTOP i386
$ ls -l test_t*
-rwxr-xr-x 1 ler ler 6689 Sep 3 16:40 test_thread
-rw------- 1 ler ler 3611 Sep 3 16:22 test_thread.c
-rw------- 1 ler ler 3638 Sep 3 19:01 test_thread2.c
$ cc -O -o test_thread2 test_thread2.c -lc_r
$ ./test_thread2
Your gethostbyname() is _not_ thread-safe
Your getpwuid() is _not_ thread-safe
Your functions are _not_ all thread-safe
$ man -k gethostbyname_r
gethostbyname_r: nothing appropriate
$ man -k getpwuid
getpwent(3), getpwent_r(3), getpwnam(3), getpwnam_r(3), getpwuid(3),
getpwuid_r(
3), setpassent(3), setpwent(3), endpwent(3) - password database operations
$
--
Larry Rosenman http://www.lerctr.org/~ler
Phone: +1 972-414-9812 E-Mail: ler@lerctr.org
US Mail: 1905 Steamboat Springs Drive, Garland, TX 75044-6749