473,320 Members | 1,982 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Exported functions in shared libraries

I want to call the 'stat' system call dynamically.

In other words, I want to use the dlopen to dynamically load a shared
library and bind to the stat function using dlsym. I want to be able
to do this on Linux (Ubuntu) and Mac OS X.

My questions are:
0) Given a function name, how can I fiund out if it is available in a
shared library (.so) or only in a static library(.a)?
1) Given a function name, how can I find which shared library (.so)
exports that function?
2) Is the stat system call available as an exported function in a
shared library?

Thanks,
gopan

Aug 30 '07 #1
4 3036
gopan wrote:
I want to call the 'stat' system call dynamically.

In other words, I want to use the dlopen to dynamically load a shared
library and bind to the stat function using dlsym. I want to be able
to do this on Linux (Ubuntu) and Mac OS X.
You should try a Linux group, or comp.unix.programmer for a more generic
answer.

--
Ian Collins.
Aug 30 '07 #2
gopan <rx*****@gmail.comwrites:
I want to call the 'stat' system call dynamically.

In other words, I want to use the dlopen to dynamically load a shared
library and bind to the stat function using dlsym. I want to be able
to do this on Linux (Ubuntu) and Mac OS X.
[snip]

Try comp.unix.programmer.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Aug 30 '07 #3
gopan wrote:
I want to call the 'stat' system call dynamically.

In other words, I want to use the dlopen to dynamically load a shared
library and bind to the stat function using dlsym. I want to be able
to do this on Linux (Ubuntu) and Mac OS X.

My questions are:
0) Given a function name, how can I fiund out if it is available in a
shared library (.so) or only in a static library(.a)?
1) Given a function name, how can I find which shared library (.so)
exports that function?
2) Is the stat system call available as an exported function in a
shared library?

Thanks,
gopan
You should FIRST build a database of functions. You scan the
/lib and /usr/lib and /usr/local/lib with the appropiate tools
(objdump comes to mind for instance).

Using this information you build a "database" as a text file
for instance, using two columns:
name of the function path to library.

This allows you to answer any question like (0) and (1) immediately.

To answer (2) you should look for it, (it is probably in the libc)

jacob
Aug 30 '07 #4
gopan wrote:
>
I want to call the 'stat' system call dynamically.

In other words, I want to use the dlopen to dynamically load a shared
library and bind to the stat function using dlsym. I want to be able
to do this on Linux (Ubuntu) and Mac OS X.
There is not 'stat' system, nor dlopen, nor stat function, nor
dlsym in standard C. You should take your question to a Linux or
Ubuntu newsgroup. It is OT in c.l.c.

--
Chuck F (cbfalconer at maineline dot net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home.att.net>

--
Posted via a free Usenet account from http://www.teranews.com

Aug 30 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Phil | last post by:
I realize this is the php group, but I have a question that recurses back to my php install. My objective is a pure 64 bit shared object installation of php 5.0 on UltraSparc Solaris 9 compiled...
3
by: Rickard Lind | last post by:
Is there any way to build the python executable statically and still be able to load modules built as shared libraries? I'm trying to run python scripts on a stripped down FreeBSD (4.9) machine...
4
by: Dmitri Zhukov | last post by:
This topic was widely discussed before but somehow I still have no idea how to fix the problem. I've a C++ class which resides inside DLL and has some STL members inside. The EXE uses STL vector...
0
by: Richard | last post by:
In VB.NET, I am successfully calling C++ functions and subroutines that were exported from a DLL. Is it also possible in VB.NET to directly access a variable that was exported? Specifically, the...
10
by: ampeloso | last post by:
I'm pretty new to c coming from other MS languages. I have a few questions about library functions 1. The headers specify the functions, but where are the actual functions.Apparently they are...
1
by: Mohammad Omer | last post by:
I am writing code for creating DLL using vs2k5. My project is using Crypto++ lib project, which has a function (ComputeHash), and with the same name of function I have written in project with a...
5
by: David T. Ashley | last post by:
I've occasionally had trouble compiling and linking programs that use shared libraries. That never made a lot of sense to me, because I thought the operating system went hunting for the symbols...
4
by: Anonymous | last post by:
Is it possible to have an ATL project that also contains win32 exported classes and functions?. I have a project (module) that needs to export/expose a few ATL objects, however, other modules...
4
by: stuntgoat | last post by:
Hi, I want to start using Python 2.6 and 3000. I have several questions. What, in your experiences, is a functionally elegant solution to installing 2.6 and 3 from source without breaking...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.