1
0
mirror of https://github.com/postgres/postgres.git synced 2025-09-03 15:22:11 +03:00

The beos port in the source tree doesn't even compile. and even

after that dynamic loading isn't working and shared memory handling is
broken.

        Attached with this message, there is a Zip file which contain :

        * beos.diff = patch file generated with difforig
        * beos = folder with beos support files which need to be moved in /
src/backend/port
        * expected = foler with three file for message and precision
difference in regression test
        * regression.diff = rule problem (need to kill the backend manualy)
        * dynloader = dynloader files (they are also in the pacth files,
but there is so much modification that I have join full files)

        Everything works except a problem in 'rules' Is there some problems
with rules in the current tree ? It used to works with last week tree.

Cyril VELTER
This commit is contained in:
Bruce Momjian
2000-10-07 14:39:21 +00:00
parent a759460178
commit 7ea8403c8a
21 changed files with 1231 additions and 400 deletions

View File

@@ -8,53 +8,65 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/port/dynloader/Attic/beos.c,v 1.2 2000/10/03 03:11:15 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/port/dynloader/Attic/beos.c,v 1.3 2000/10/07 14:39:11 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#include "postgres.h"
#include <kernel/OS.h>
#include <image.h>
#include <errno.h>
#include "utils/dynamic_loader.h"
#include "utils/elog.h"
#include "dynloader.h"
extern char pg_pathname[];
void *
beos_dlopen(const char *filename)
void *
pg_dlopen(char *filename)
{
image_id id = -1;
image_id* im;
/* Handle memory allocation to store the Id of the shared object*/
im=(image_id*)(malloc(sizeof(image_id)));
/* Add-on loading */
*im=beos_dl_open(filename);
return im;
}
if ((id = load_add_on(filename)) < 0)
return NULL;
return (void *) id;
char *
pg_dlerror()
{
static char errmsg[] = "Load Add-On failed";
return errmsg;
}
PGFunction
pg_dlsym(void *handle, char *funcname)
{
PGFunction fpt;
/* Checking that "Handle" is valid */
if ((handle) && ((*(int*)(handle))>=0))
{
/* Loading symbol */
if(get_image_symbol(*((int*)(handle)),funcname,B_SYMBOL_TYPE_TEXT,(void**)&fpt)==B_OK);
{
return fpt;
}
elog(NOTICE, "loading symbol '%s' failed ",funcname);
}
elog(NOTICE, "add-on not loaded correctly");
return NULL;
}
void
beos_dlclose(void *handle)
pg_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);
}
/* Checking that "Handle" is valid */
if ((handle) && ((*(int*)(handle))>=0))
{
if (beos_dl_close(*(image_id*)handle)!=B_OK)
elog(NOTICE, "error while unloading add-on");
free(handle);
}
}