Re: functions + shared libraries

Поиск
Список
Период
Сортировка
От Shridhar Daithankar
Тема Re: functions + shared libraries
Дата
Msg-id 3DF4EE44.9589.54ECA9@localhost
обсуждение исходный текст
Ответ на Re: functions + shared libraries  (Doug McNaught <doug@mcnaught.org>)
Список pgsql-general
On 9 Dec 2002 at 8:42, Doug McNaught wrote:

> Eric B.Ridge <ebr@tcdi.com> writes:
>
> > Is it possible, via a shared library that contains functions used by
> > postgres, to detect when the library is first loaded and when it is
> > unloaded?
>
> You could have a 'static' variable in the library, that all its
> functions check first thing, and set to 1 after checking.  That would
> be a little clumsy, but would work.

I do not know the postgresql code, but I believe, postgresql must be doing a
dlopen internally. So if you define _init and _fini, they would called while
loading and unloading the library.

At least it is that way on linux. Check with man page of dlopen on the platform
you are running..

HTH

Bye
 Shridhar

--
Great American Axiom:    Some is good, more is better, too much is just right.


В списке pgsql-general по дате отправления:

Предыдущее
От: Doug McNaught
Дата:
Сообщение: Re: functions + shared libraries
Следующее
От: "Ian Harding"
Дата:
Сообщение: Re: UPDATE syntax problem