![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
PostgreSQL provides a way to load C extension modules with its internal FMGR. Unfortunately there is no portable way for an extension module to initialize (directly after the pg_dlopen() of the DSO) and to finish (directly before the pg_dlclose() of the DSO). [...] |
|
+ + /* optionally give the DSO a chance to finish by calling + a PostgreSQL-specific (and this way portable) "_PG_fini" + function similar to what dlopen(3) implicitly does with + "_fini" on some Unix platforms. */ + if ((PG_fini = (PG_init_t *)pg_dlsym(file_scanner->handle, "_PG_fini")) != NULL) ^^^^^^^^^ + (*PG_fini)(); + pg_dlclose(file_scanner->handle); free((char *) file_scanner); /* prv does not change */ |

#3
| |||
| |||
|
|
On Wed, Aug 02, 2006 at 09:04:11PM +0200, Ralf S. Engelschall wrote: PostgreSQL provides a way to load C extension modules with its internal FMGR. Unfortunately there is no portable way for an extension module to initialize (directly after the pg_dlopen() of the DSO) and to finish (directly before the pg_dlclose() of the DSO). [...] Cool, but... [...] + + /* optionally give the DSO a chance to finish by calling + a PostgreSQL-specific (and this way portable) "_PG_fini" + function similar to what dlopen(3) implicitly does with + "_fini" on some Unix platforms. */ + if ((PG_fini = (PG_init_t *)pg_dlsym(file_scanner->handle, "_PG_fini")) != NULL) ^^^^^^^^^ + (*PG_fini)(); + pg_dlclose(file_scanner->handle); free((char *) file_scanner); /* prv does not change */ shouldn't that be PG_fini_t? |
![]() |
| Thread Tools | |
| Display Modes | |
| |