LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-02-2004, 04:36 AM   #1
tim_l
LQ Newbie
 
Registered: Oct 2003
Posts: 18

Rep: Reputation: 0
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
 
Old 02-02-2004, 08:13 AM   #2
kev82
Senior Member
 
Registered: Apr 2003
Location: Lancaster, England
Distribution: Debian Etch, OS X 10.4
Posts: 1,263

Rep: Reputation: 51
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.
 
Old 02-02-2004, 08:27 AM   #3
tim_l
LQ Newbie
 
Registered: Oct 2003
Posts: 18

Original Poster
Rep: Reputation: 0
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
undefined reference to dlopen, dlclose, dlsym and dlerror patrickdepingui Slackware 5 02-14-2010 08:55 AM
fstab-sync: error: libhal_ctx_init_direct: (null): (null) rpz Linux - Hardware 1 11-01-2005 05:42 AM
Hello. An old member returning with a new name. Pipewrench LinuxQuestions.org Member Intro 2 09-03-2004 08:56 PM
Returning an object Mohsen Programming 12 08-07-2003 02:41 AM
having trouble returning... jhorvath Programming 12 10-26-2002 10:22 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:02 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration