mirror of
https://github.com/postgres/postgres.git
synced 2025-11-10 17:42:29 +03:00
Here is the first batch of files and diffs for the BeOS port. I've run into
problems with some bits of it, but when all the patches are in it'll build
and we can fix it from there :) I've got a version that builds and runs and
that is the basis for these patches.
The first file has the new additional files that are required,
template/beos
backend/port/dynloader/beos.c
backend/port/dynloader/beos.h
include/port/beos.h
makefiles/Makefile.beos
The second is a tarball of diffs against a few files. I've added sys/ipc.h
to configure and config.h via configure.in and config.h.in and then started
adding the check as this file isn't needed on BeOS and having loads of
#ifdef BEOS isn't as obvious as #ifdef HAVE_SYS_IPC_H and isn't as
autconf'ish :)
Files touched are
include/c.h
configure.in
include/config.h.in
include/storage/ipc.h
include/utils/int8.h
Let me know how these go. I'll await a response before submitting any more.
Any problems just get in touch.
David Reid
This commit is contained in:
60
src/backend/port/dynloader/beos.c
Normal file
60
src/backend/port/dynloader/beos.c
Normal file
@@ -0,0 +1,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);
|
||||
}
|
||||
33
src/backend/port/dynloader/beos.h
Normal file
33
src/backend/port/dynloader/beos.h
Normal file
@@ -0,0 +1,33 @@
|
||||
/*-------------------------------------------------------------------------
|
||||
*
|
||||
* port_protos.h
|
||||
* port-specific prototypes for BeOS
|
||||
*
|
||||
*
|
||||
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $Id: beos.h,v 1.1 2000/10/02 17:15:53 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
#ifndef PORT_PROTOS_H
|
||||
#define PORT_PROTOS_H
|
||||
|
||||
#include "postgres.h"
|
||||
|
||||
#include "fmgr.h"
|
||||
#include "utils/dynamic_loader.h"
|
||||
|
||||
char *beos_dlerror(void);
|
||||
void *beos_dlopen(const char *filename);
|
||||
void *beos_dlsym(void *handle, const char *name);
|
||||
void beos_dlclose(void *handle);
|
||||
|
||||
#define pg_dlopen(f) beos_dlopen(f)
|
||||
#define pg_dlsym beos_dlsym
|
||||
#define pg_dlclose beos_dlclose
|
||||
#define pg_dlerror beos_dlerror
|
||||
|
||||
|
||||
#endif /* PORT_PROTOS_H */
|
||||
Reference in New Issue
Block a user