dlsym returning NULL
Hi,
Am trying to resolve the address of a function using dlsym, but for reasons beyond me every call to dlsym to resolve either fstat or lstat or stat returns nil. The strange thing is I can call these functions without any difficulty so it isn't a problem with files being included or anything like that. Any ideas? Cheers, Tim |
which file are you expecting to find the symbols stat and lstat in? if your trying to use the glibc ones then a quick look at the output of
objdump -t /lib/libc-2.2.5.so | awk '{print $6}' | grep stat$ (command may vary with different systems) gives fts_stat svcraw_stat svctcp_stat rendezvous_stat svcudp_stat svcunix_stat rendezvous_stat _lxstat _xstat _IO_default_stat _fxstat ustat __lxstat _IO_file_stat __xstat __fxstat shows there is no stat or lstat in glibc, i suggest you read the header file(/usr/include/sys/stat.h) to find out which symbol you want. |
I hadn't realised that the stat family of functions were in fact wrappers. Which is why the call was failing. Should have had a more detailed look through the stat.h header file.
Thanks for the help |
All times are GMT -5. The time now is 07:07 AM. |