blob: c2a6b78845752e458ef75a2c3ccb99cb2af4a505 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
/*-------------------------------------------------------------------------
*
* dynloader.c
* Dynamic Loader for Postgres for BeOS
*
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/port/dynloader/Attic/beos.c,v 1.1 2000/10/02 17:15:53 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#include "postgres.h"
#include <kernel/OS.h>
#include <image.h>
#include <errno.h>
#include "dynloader.h"
extern char pg_pathname[];
void *
beos_dlopen(const char *filename)
{
image_id id = -1;
if ((id = load_add_on(filename)) < 0)
return NULL;
return (void *) id;
}
void
beos_dlclose(void *handle)
{
image_id id = (image_id) handle;
unload_add_on(id);
return;
}
void *
beos_dlsym(void *handle, const char *name)
{
image_id id = (image_id)handle;
void *addr;
if (get_image_symbol(id, name, B_SYMBOL_TYPE_ANY, &addr) != B_OK)
return NULL;
return addr;
}
char *
beos_dlerror()
{
return (char *)strerror(errno);
}
|