1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-04 20:11:56 +03:00

Various changes to improve/support Mklinux

Submitted by: Tatsuo Ishii
This commit is contained in:
Marc G. Fournier
1997-02-06 08:40:16 +00:00
parent 9b9141245c
commit 2c9dbc57e5
5 changed files with 29 additions and 8 deletions

View File

@@ -10,12 +10,14 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/port/linux/Attic/dynloader.c,v 1.1.1.1 1996/07/09 06:21:44 scrappy Exp $
* $Header: /cvsroot/pgsql/src/backend/port/linux/Attic/dynloader.c,v 1.2 1997/02/06 08:39:40 scrappy Exp $
*
*-------------------------------------------------------------------------
*/
#include <stdio.h>
#ifdef HAVE_DLD_H
#include <dld.h>
#endif
#include "postgres.h"
#include "port-protos.h"
#include "utils/elog.h"
@@ -26,6 +28,10 @@ extern char pg_pathname[];
void *
pg_dlopen(char *filename)
{
#ifndef HAVE_DLD_H
elog(WARN, "dynamic load not supported");
return(NULL);
#else
static int dl_initialized= 0;
/*
@@ -84,10 +90,15 @@ pg_dlopen(char *filename)
}
return (void *) strdup(filename);
#endif
}
char *
pg_dlerror()
{
#ifndef HAVE_DLD_H
return("dynaloader unspported");
#else
return dld_strerror(dld_errno);
#endif
}

View File

@@ -6,7 +6,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: port-protos.h,v 1.1.1.1 1996/07/09 06:21:44 scrappy Exp $
* $Id: port-protos.h,v 1.2 1997/02/06 08:39:53 scrappy Exp $
*
*-------------------------------------------------------------------------
*/
@@ -22,8 +22,13 @@
/* dynloader.c */
#ifndef LINUX_ELF
# ifndef HAVE_DLD_H
#define pg_dlsym(handle, funcname) (NULL)
# define pg_dlclose(handle) ({})
# else
#define pg_dlsym(handle, funcname) ((func_ptr) dld_get_func((funcname)))
#define pg_dlclose(handle) ({ dld_unlink_by_file(handle, 1); free(handle); })
# define pg_dlclose(handle) ({ dld_unlink_by_file(handle, 1); free(handle); })
# endif
#else
/* #define pg_dlopen(f) dlopen(f, 1) */
#define pg_dlopen(f) dlopen(f, 2)