mirror of
https://github.com/postgres/postgres.git
synced 2025-06-27 23:21:58 +03:00
Fix Linux dynloader code for pre-HAVE_DLOPEN systems, which evidently
are still in use out there. Per report from Brendan LeFebvre.
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
/*-------------------------------------------------------------------------
|
||||
*
|
||||
* dynloader.c
|
||||
* linux.c
|
||||
* Dynamic Loader for Postgres for Linux, generated from those for
|
||||
* Ultrix.
|
||||
*
|
||||
@ -11,18 +11,22 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/port/dynloader/linux.c,v 1.22 2002/06/20 20:29:33 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/port/dynloader/linux.c,v 1.23 2002/10/15 16:04:17 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#include "postgres.h"
|
||||
|
||||
#ifdef HAVE_DLD_H
|
||||
#include "dld.h"
|
||||
#include <dld.h>
|
||||
#endif
|
||||
|
||||
#ifdef NOT_USED
|
||||
extern char pg_pathname[];
|
||||
#include "dynloader.h"
|
||||
#include "miscadmin.h"
|
||||
|
||||
|
||||
#ifndef HAVE_DLOPEN
|
||||
|
||||
void *
|
||||
pg_dlopen(char *filename)
|
||||
@ -98,8 +102,28 @@ pg_dlopen(char *filename)
|
||||
#endif
|
||||
}
|
||||
|
||||
PGFunction
|
||||
pg_dlsym(void *handle, char *funcname)
|
||||
{
|
||||
#ifndef HAVE_DLD_H
|
||||
return NULL;
|
||||
#else
|
||||
return (PGFunction) dld_get_func((funcname));
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
pg_dlclose(void *handle)
|
||||
{
|
||||
#ifndef HAVE_DLD_H
|
||||
#else
|
||||
dld_unlink_by_file(handle, 1);
|
||||
free(handle);
|
||||
#endif
|
||||
}
|
||||
|
||||
char *
|
||||
pg_dlerror()
|
||||
pg_dlerror(void)
|
||||
{
|
||||
#ifndef HAVE_DLD_H
|
||||
return "dynaloader unspported";
|
||||
@ -108,4 +132,4 @@ pg_dlerror()
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif /* !HAVE_DLOPEN */
|
||||
|
Reference in New Issue
Block a user