# libthr and libc



## alp (Sep 6, 2010)

Hello. 
I've just found out interesting thing. 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? It would be more helpful to receive linking error


----------

