[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]
Re: library fuction calls
I think you will call my-connect function then check the checking conditions
and the call connect in your my_connect function. By this you need not use
shared library also
On Wed, 21 Feb 2001, you wrote:
> hi all,
> I am trying to write a wrapper for one of the library functions
> (more specifically connect() ). Now what I want is whenever some application
> calls connect() my_connect should be called. my_connect does some
> checks on the sockaddr and then calls connect().
> I have noticed that there are aliases for connect like __connect
> and __libc_connect in the glibc source. I have written the code for
> connect() function which I am compiling as a shared library with -shared
> option. Now my questions are:
> 1. How do I make the system use my connect() function instead of the
> glibc's connect().
> 2. I need to call the glibc's connect() in my connect(). How do i do
> this. (I am trying this by calling __connect and __libc_connect instead in
> my connect and compiling a program with this shared lib. Obviously its not
> working, it seems like I am getting into infinite recursion.)
> Please help.
> Thanks in advance.
> #!!! If anything can go wrong, _FIX_ it. (To hell with MURPHY)
> Ajay kumar Dwivedi
> Find out more about this and other Linux India
> mailing lists at http://lists.linux-india.org/