libthr and libc

Alexander Pyhalov alp at rsu.ru
Tue Sep 7 09:45:25 UTC 2010


Hello.
I found out interesting thing yesterday. I use 8.0-stable and observed 
the same behavior on 8.1-release.
I tried to create ecpg (embedded SQL) program for PostgreSQL. The 
program linked but gave strange error (sqlca structure wasn't passed 
correctly to user program). I found out that the reason was in threads 
behavior - each time we called pthread_once (inside ecpglib) it didn't 
work. Program linked to libc.so and called some stubs from it. When I 
realised it, I linked program with libthr, and it started work correctly.
Can someone explain why this stubs are in libc? Why didn't linker just 
throw a linking error?
-- 
С уважением,
Александр Пыхалов,
системный администратор ЮГИНФО ЮФУ.



More information about the freebsd-ports mailing list