Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7a7e024

Browse files
committed
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 buildand we can fix it from there :) I've got a version that builds and runs andthat 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.beosThe second is a tarball of diffs against a few files. I've added sys/ipc.hto configure and config.h via configure.in and config.h.in and then startedadding 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 asautconf'ish :)Files touched are include/c.h configure.in include/config.h.in include/storage/ipc.h include/utils/int8.hLet me know how these go. I'll await a response before submitting any more.Any problems just get in touch.David Reid
1 parent89f6443 commit7a7e024

File tree

9 files changed

+141
-4
lines changed

9 files changed

+141
-4
lines changed

‎configure.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,7 @@ fi
660660
## Header files
661661
##
662662
dnl sys/socket.h and sys/types.h are required by AC_FUNC_ACCEPT_ARGTYPES
663-
AC_CHECK_HEADERS([crypt.h dld.h endian.h fp_class.h getopt.h ieeefp.h netinet/tcp.h pwd.h sys/pstat.h sys/select.h sys/socket.h sys/types.h sys/un.h termios.h])
663+
AC_CHECK_HEADERS([crypt.h dld.h endian.h fp_class.h getopt.h ieeefp.h netinet/tcp.h pwd.h sys/ipc.h sys/pstat.h sys/select.h sys/socket.h sys/types.h sys/un.h termios.h])
664664

665665
AC_CHECK_HEADERS([readline/readline.h readline.h], [break])
666666
AC_CHECK_HEADERS([readline/history.h history.h], [break])

‎src/backend/port/dynloader/beos.c

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

‎src/backend/port/dynloader/beos.h

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/*-------------------------------------------------------------------------
2+
*
3+
* port_protos.h
4+
* port-specific prototypes for BeOS
5+
*
6+
*
7+
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
8+
* Portions Copyright (c) 1994, Regents of the University of California
9+
*
10+
* $Id: beos.h,v 1.1 2000/10/02 17:15:53 momjian Exp $
11+
*
12+
*-------------------------------------------------------------------------
13+
*/
14+
#ifndefPORT_PROTOS_H
15+
#definePORT_PROTOS_H
16+
17+
#include"postgres.h"
18+
19+
#include"fmgr.h"
20+
#include"utils/dynamic_loader.h"
21+
22+
char*beos_dlerror(void);
23+
void*beos_dlopen(constchar*filename);
24+
void*beos_dlsym(void*handle,constchar*name);
25+
voidbeos_dlclose(void*handle);
26+
27+
#definepg_dlopen(f) beos_dlopen(f)
28+
#definepg_dlsym beos_dlsym
29+
#definepg_dlclose beos_dlclose
30+
#definepg_dlerror beos_dlerror
31+
32+
33+
#endif/* PORT_PROTOS_H */

‎src/include/c.h

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
99
* Portions Copyright (c) 1994, Regents of the University of California
1010
*
11-
* $Id: c.h,v 1.82 2000/09/29 13:53:32 petere Exp $
11+
* $Id: c.h,v 1.83 2000/10/02 17:15:55 momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -56,6 +56,9 @@
5656
#include<errno.h>
5757
#include<sys/fcntl.h>/* ensure O_BINARY is available */
5858
#endif
59+
#ifdef__BEOS__
60+
#include<SupportDefs.h>
61+
#endif
5962

6063
/* ----------------------------------------------------------------
6164
*Section 1:bool, true, false, TRUE, FALSE, NULL
@@ -66,6 +69,7 @@
6669
*Boolean value, either true or false.
6770
*
6871
*/
72+
#ifndef__BEOS__
6973
#ifndef__cplusplus
7074
#ifndefbool
7175
typedefcharbool;
@@ -78,6 +82,7 @@ typedef char bool;
7882
#ifndeffalse
7983
#definefalse((bool) 0)
8084
#endif
85+
#endif/* __BEOS__ */
8186
typedefbool*BoolPtr;
8287

8388
#ifndefTRUE
@@ -165,19 +170,23 @@ typedef char *Pointer;
165170
*used for numerical computations and the
166171
*frontend/backend protocol.
167172
*/
173+
#ifndef__BEOS__
168174
typedefsignedcharint8;/* == 8 bits */
169175
typedefsigned shortint16;/* == 16 bits */
170176
typedefsignedintint32;/* == 32 bits */
177+
#endif/* __BEOS__ */
171178

172179
/*
173180
* uintN
174181
*Unsigned integer, EXACTLY N BITS IN SIZE,
175182
*used for numerical computations and the
176183
*frontend/backend protocol.
177184
*/
185+
#ifndef__BEOS__
178186
typedefunsignedcharuint8;/* == 8 bits */
179187
typedefunsigned shortuint16;/* == 16 bits */
180188
typedefunsignedintuint32;/* == 32 bits */
189+
#endif/* __BEOS__ */
181190

182191
/*
183192
* floatN
@@ -259,6 +268,8 @@ typedef int32 int4;
259268
typedeffloatfloat4;
260269
typedefdoublefloat8;
261270

271+
/* BeOS already has int64 defined, so skip these... */
272+
#ifndefBEOS
262273
#ifdefHAVE_LONG_INT_64
263274
/* Plain "long int" fits, use it */
264275
typedeflongintint64;
@@ -272,6 +283,9 @@ typedef long int int64;
272283
#defineINT64_IS_BUSTED
273284
#endif
274285
#endif
286+
#else/* Add BeOS support */
287+
#include<SupportDefs.h>
288+
#endif/* BEOS */
275289

276290
/* ----------------------------------------------------------------
277291
*Section 4:datum type + support macros

‎src/include/config.h.in

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* or in config.h afterwards. Of course, if you edit config.h, then your
99
* changes will be overwritten the next time you run configure.
1010
*
11-
* $Id: config.h.in,v 1.137 2000/09/29 22:00:45 momjian Exp $
11+
* $Id: config.h.in,v 1.138 2000/10/02 17:15:55 momjian Exp $
1212
*/
1313

1414
#ifndefCONFIG_H
@@ -342,6 +342,9 @@
342342
/* Set to 1 if you have <readline/readline.h> */
343343
#undef HAVE_READLINE_READLINE_H
344344

345+
/* Define if you have <sys/ipc.h> */
346+
#undef HAVE_SYS_IPC_H
347+
345348
/* Set to 1 if you have <sys/select.h> */
346349
#undef HAVE_SYS_SELECT_H
347350

‎src/include/port/beos.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#include<kernel/OS.h>
2+
#defineUSE_POSIX_TIME
3+
#defineHAS_TEST_AND_SET
4+
5+
typedefunsignedcharslock_t;
6+
7+
#defineAF_UNIX 1
8+
#defineIPPROTO_IP 0
9+
10+

‎src/include/storage/ipc.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $Id: ipc.h,v 1.38 2000/01/26 05:58:32 momjian Exp $
10+
* $Id: ipc.h,v 1.39 2000/10/02 17:15:58 momjian Exp $
1111
*
1212
* NOTES
1313
* This file is very architecture-specific.This stuff should actually
@@ -23,7 +23,9 @@
2323
#defineIPC_H
2424

2525
#include<sys/types.h>
26+
#ifdefHAVE_SYS_IPC_H
2627
#include<sys/ipc.h>/* For IPC_PRIVATE */
28+
#endif
2729

2830
#include"config.h"
2931

‎src/makefiles/Makefile.beos

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
MK_NO_LORDER=true
2+
ifdef ELF_SYSTEM
3+
LDFLAGS += -Wl,-E
4+
endif
5+
%.so: %.o
6+
$(LD) -x -Bshareable -o $@ $<

‎src/template/beos

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
AROPT:crs
2+
SHARED_LIB:-fpic -DPIC
3+
CFLAGS:-O2 -DBEOS
4+
SRCH_INC:
5+
SRCH_LIB:
6+
USE_LOCALE:no
7+
DLSUFFIX:.so
8+
YFLAGS:-d
9+
YACC:bison -y

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp