[freetds] gethostbyname_r fails if statically linked
John Wythe
jwythe at silksystems.com
Thu Mar 9 21:24:22 EST 2006
Has anyone one ever tried to statically link a program that accesses both MySQL and unixODBC. The reason I ask is that the gethostbyname_r function acts strange of seg faults
when my program is linked statically, dynamically it works find, as do the isql and iusql programs. The call to gethostbyname_r in question is deep inside freetds in the threadsafe.c source. If my program is statically linked it always returns NULL, and h_errno is never changed. All programs and code are compiled on the system in question freetds, unixODBC, and my program. My thinking is that somehow the dlopened tds library is somehow accessing a copy of gethostbyname_r that is statically linked into my program, instead of one that is dynamically available. Maybe somehow there are too different libraries with the same function, and my program gets a different one (maybe because of MySQL) when linked statically.
John
John Wythe, Systems Programmer
Phone: (800) 663-0718
Fax: (604) 468-1667
jwythe at silksystems.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/jpeg
Size: 1961 bytes
Desc: not available
Url : http://lists.ibiblio.org/pipermail/freetds/attachments/20060309/7bd52efd/attachment.jpe
More information about the FreeTDS
mailing list