From: Ty S. <ts...@us...> - 2000-10-12 02:52:26
|
Update of /cvsroot/firebird/interbase/jrd In directory slayer.i.sourceforge.net:/tmp/cvs-serv18269/jrd Modified Files: common.h file_params.h flu.c gds.c isc_file.c isc_ipc.c isc_sync.c license.h pag.c pwd.c pwd.h sort.c svc.c utl.c why.c Log Message: NetBSD support. Thanks to Geoffrey C. Speicher for the FreeBSD port, which made this much easier. Index: common.h =================================================================== RCS file: /cvsroot/firebird/interbase/jrd/common.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** common.h 2000/08/23 21:01:31 1.4 --- common.h 2000/10/12 02:52:17 1.5 *************** *** 115,118 **** --- 115,155 ---- #endif /* FREEBSD */ + /* NetBSD */ + #ifdef NETBSD + + #if defined(__i386__) + #define FB_ALIGN(n,b) ((n + b - 1) & ~(b - 1)) + #define ALIGNMENT 4 + #define DOUBLE_ALIGN 4 + + #define IEEE 1 + #define I386 1 + #define VAX 1 + #define IMPLEMENTATION 62 + + #define QUADFORMAT "ll" + #define QUADCONST(n) (n##LL) + #else /* !__i386__ */ + #error Please add support for other ports + #endif + + #define UNIX 1 + #define SETPGRP setpgrp () + #define ATEXIT(c) atexit(c) + + #define KILLER_SIGNALS + #define MMAP_SUPPORTED + #define SIGACTION_SUPPORTED + #define NO_NFS /* no MTAB_OPEN or MTAB_CLOSE in isc_file.c */ + + #define MEMMOVE(from,to,length) memmove ((void *)to, (void *)from, (size_t) length) + #define MOVE_FAST(from,to,length) memcpy (to, from, (int) (length)) + #define MOVE_FASTER(from,to,length) memcpy (to, from, (int) (length)) + #define MOVE_CLEAR(to,length) memset (to, 0, (int) (length)) + + #define VOLATILE volatile + + #endif /* NETBSD */ + /* Apollo platforms */ Index: file_params.h =================================================================== RCS file: /cvsroot/firebird/interbase/jrd/file_params.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** file_params.h 2000/08/16 23:30:38 1.2 --- file_params.h 2000/10/12 02:52:17 1.3 *************** *** 131,135 **** #endif ! #ifdef FREEBSD #include <sys/types.h> #include <sys/ipc.h> --- 131,135 ---- #endif ! #if defined FREEBSD || defined NETBSD #include <sys/types.h> #include <sys/ipc.h> Index: flu.c =================================================================== RCS file: /cvsroot/firebird/interbase/jrd/flu.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** flu.c 2000/10/03 03:47:20 1.6 --- flu.c 2000/10/12 02:52:17 1.7 *************** *** 73,77 **** #endif ! #if defined FREEBSD #include <dlfcn.h> #define DYNAMIC_SHARED_LIBRARIES --- 73,77 ---- #endif ! #if defined FREEBSD || defined NETBSD #include <dlfcn.h> #define DYNAMIC_SHARED_LIBRARIES *************** *** 258,262 **** #endif ! #if defined(SOLARIS) || defined(LINUX) || defined(FREEBSD) || defined (AIX_PPC) dlclose (module->mod_handle); #endif --- 258,262 ---- #endif ! #if defined(SOLARIS) || defined(LINUX) || defined(FREEBSD) || defined(NETBSD) || defined (AIX_PPC) dlclose (module->mod_handle); #endif Index: gds.c =================================================================== RCS file: /cvsroot/firebird/interbase/jrd/gds.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** gds.c 2000/09/23 04:39:22 1.4 --- gds.c 2000/10/12 02:52:17 1.5 *************** *** 201,219 **** #endif ! #ifndef VMS ! #ifndef PC_PLATFORM ! #ifndef OS2_ONLY ! #ifndef WIN_NT ! #ifndef linux ! #ifndef FREEBSD extern int errno; extern SCHAR *sys_errlist[]; extern int sys_nerr; #endif - #endif - #endif - #endif - #endif - #endif #ifdef NETWARE_386 --- 201,209 ---- #endif ! #if !(defined VMS || defined PC_PLATFORM || defined OS2_ONLY || defined WIN_NT || defined linux || defined FREEBSD || defined NETBSD) extern int errno; extern SCHAR *sys_errlist[]; extern int sys_nerr; #endif #ifdef NETWARE_386 *************** *** 3679,3683 **** *p = 0; ! #if !defined FREEBSD MKTEMP (file_name, string); --- 3669,3673 ---- *p = 0; ! #if !(defined FREEBSD || defined NETBSD) MKTEMP (file_name, string); *************** *** 3737,3741 **** #endif ! #else /* defined FREEBSD */ file = (IB_FILE*) mkstemp(file_name); if (file == (IB_FILE*) -1) --- 3727,3731 ---- #endif ! #else /* defined FREEBSD/NETBSD */ file = (IB_FILE*) mkstemp(file_name); if (file == (IB_FILE*) -1) *************** *** 3752,3756 **** unlink (file_name); } ! #endif /* FREEBSD */ return (void*) file; --- 3742,3746 ---- unlink (file_name); } ! #endif /* FREEBSD/NETBSD */ return (void*) file; Index: isc_file.c =================================================================== RCS file: /cvsroot/firebird/interbase/jrd/isc_file.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** isc_file.c 2000/08/16 23:30:38 1.2 --- isc_file.c 2000/10/12 02:52:17 1.3 *************** *** 77,81 **** /* Unix/NFS specific stuff */ ! #if (defined NFS || defined FREEBSD) #include <pwd.h> #define MAXPATHLEN 1024 --- 77,81 ---- /* Unix/NFS specific stuff */ ! #if (defined NFS || defined FREEBSD || defined NETBSD) #include <pwd.h> #define MAXPATHLEN 1024 *************** *** 138,142 **** #endif ! #if (defined SOLARIS || defined UNIXWARE || defined NCR3000 || defined linux || defined M88K || defined FREEBSD) #define GETWD(buf) getcwd (buf, MAXPATHLEN) #endif --- 138,142 ---- #endif ! #if (defined SOLARIS || defined UNIXWARE || defined NCR3000 || defined linux || defined M88K || defined FREEBSD || defined NETBSD) #define GETWD(buf) getcwd (buf, MAXPATHLEN) #endif *************** *** 963,967 **** #endif ! #if (defined NFS || defined FREEBSD) int ISC_expand_filename ( TEXT *from_buff, --- 963,967 ---- #endif ! #if (defined NFS || defined FREEBSD || defined NETBSD) int ISC_expand_filename ( TEXT *from_buff, *************** *** 2061,2065 **** #endif ! #if (defined NFS || defined FREEBSD) static expand_filename2 ( TEXT *from_buff, --- 2061,2065 ---- #endif ! #if (defined NFS || defined FREEBSD || defined NETBSD) static expand_filename2 ( TEXT *from_buff, Index: isc_ipc.c =================================================================== RCS file: /cvsroot/firebird/interbase/jrd/isc_ipc.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -r1.1.1.1 -r1.2 *** isc_ipc.c 2000/08/03 20:50:48 1.1.1.1 --- isc_ipc.c 2000/10/12 02:52:17 1.2 *************** *** 129,133 **** --- 129,137 ---- #include <sys/stat.h> #include <sys/file.h> + #ifdef NETBSD + #include <signal.h> + #else #include <sys/signal.h> + #endif #include <errno.h> #ifndef NeXT Index: isc_sync.c =================================================================== RCS file: /cvsroot/firebird/interbase/jrd/isc_sync.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** isc_sync.c 2000/08/16 23:30:38 1.2 --- isc_sync.c 2000/10/12 02:52:17 1.3 *************** *** 100,104 **** --- 100,108 ---- #include <sys/stat.h> #include <sys/file.h> + #ifdef NETBSD + #include <signal.h> + #else #include <sys/signal.h> + #endif #include <errno.h> #ifndef NeXT *************** *** 227,231 **** #if !(defined M88K || defined hpux || defined DECOSF || defined SOLARIS || \ ! defined DG_X86 || defined linux || defined FREEBSD) extern SLONG ftok(); #endif --- 231,235 ---- #if !(defined M88K || defined hpux || defined DECOSF || defined SOLARIS || \ ! defined DG_X86 || defined linux || defined FREEBSD || defined NETBSD) extern SLONG ftok(); #endif *************** *** 338,342 **** #endif ! #ifdef FREEBSD #define sigset signal #endif --- 342,346 ---- #endif ! #if defined FREEBSD || defined NETBSD #define sigset signal #endif Index: license.h =================================================================== RCS file: /cvsroot/firebird/interbase/jrd/license.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** license.h 2000/09/30 12:03:56 1.3 --- license.h 2000/10/12 02:52:17 1.4 *************** *** 224,227 **** --- 224,231 ---- #endif + #ifdef NETBSD + #define IB_PLATFORM "NB-B" /* NetBSD */ + #endif + #ifndef GDS_VERSION #define GDS_VERSION IB_PLATFORM IB_MAJOR_VER "." IB_MINOR_VER "." IB_REV_NO "." IB_BUILD_NO Index: pag.c =================================================================== RCS file: /cvsroot/firebird/interbase/jrd/pag.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** pag.c 2000/08/16 23:30:38 1.2 --- pag.c 2000/10/12 02:52:17 1.3 *************** *** 97,100 **** --- 97,101 ---- 20 LINUX on sparc systems 21 FreeBSD/i386 + 22 NetBSD/i386 */ *************** *** 230,233 **** --- 231,238 ---- #ifdef FREEBSD #define CLASS 21 + #endif + + #ifdef NETBSD + #define CLASS 22 #endif Index: pwd.c =================================================================== RCS file: /cvsroot/firebird/interbase/jrd/pwd.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** pwd.c 2000/09/08 21:27:59 1.3 --- pwd.c 2000/10/12 02:52:17 1.4 *************** *** 134,138 **** **************************************/ ! #if (defined VMS || defined WINDOWS_ONLY || defined WIN_NT || defined LINUX || defined FREEBSD || defined SUPERSERVER || defined AIX_PPC) gds__prefix (path_buffer, USER_INFO_NAME); #else --- 134,138 ---- **************************************/ ! #if (defined VMS || defined WINDOWS_ONLY || defined WIN_NT || defined LINUX || defined FREEBSD || defined NETBSD || defined SUPERSERVER || defined AIX_PPC) gds__prefix (path_buffer, USER_INFO_NAME); #else Index: pwd.h =================================================================== RCS file: /cvsroot/firebird/interbase/jrd/pwd.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** pwd.h 2000/09/08 21:27:59 1.3 --- pwd.h 2000/10/12 02:52:17 1.4 *************** *** 62,66 **** #endif ! #ifdef FREEBSD #define USER_INFO_NAME "isc4.gdb" #endif --- 62,66 ---- #endif ! #if defined FREEBSD || defined NETBSD #define USER_INFO_NAME "isc4.gdb" #endif Index: sort.c =================================================================== RCS file: /cvsroot/firebird/interbase/jrd/sort.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** sort.c 2000/08/26 05:04:18 1.6 --- sort.c 2000/10/12 02:52:17 1.7 *************** *** 24,28 **** #include <errno.h> #include <string.h> ! #if ( defined FREEBSD || defined LINUX ) #include <unistd.h> #endif --- 24,28 ---- #include <errno.h> #include <string.h> ! #if ( defined FREEBSD || defined NETBSD || defined LINUX ) #include <unistd.h> #endif *************** *** 3195,3199 **** **************************************/ UCHAR file_name [32], data [41], *p; ! #if defined FREEBSD int fd; #endif --- 3195,3199 ---- **************************************/ UCHAR file_name [32], data [41], *p; ! #if defined FREEBSD || defined NETBSD int fd; #endif *************** *** 3206,3210 **** strcpy (file_name, "/interbase/sort_trace_XXXXXX"); #endif ! #if defined FREEBSD fd = mkstemp (file_name); trace_file = fdopen(fd, "w"); --- 3206,3210 ---- strcpy (file_name, "/interbase/sort_trace_XXXXXX"); #endif ! #if defined FREEBSD || defined NETBSD fd = mkstemp (file_name); trace_file = fdopen(fd, "w"); Index: svc.c =================================================================== RCS file: /cvsroot/firebird/interbase/jrd/svc.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** svc.c 2000/08/16 23:30:38 1.2 --- svc.c 2000/10/12 02:52:17 1.3 *************** *** 304,308 **** static CONST struct serv services [] = { ! #ifndef LINUX && !defined FREEBSD #ifndef NETWARE386 #ifdef WIN_NT --- 304,308 ---- static CONST struct serv services [] = { ! #ifndef LINUX && !(defined FREEBSD || defined NETBSD) #ifndef NETWARE386 #ifdef WIN_NT *************** *** 515,519 **** if (!serv->serv_name) ! #if ((defined LINUX || defined FREEBSD) && !defined SUPERSERVER) ERR_post (isc_service_att_err, isc_arg_gds, isc_service_not_supported, 0); #else --- 515,519 ---- if (!serv->serv_name) ! #if ((defined LINUX || defined FREEBSD || defined NETBSD) && !defined SUPERSERVER) ERR_post (isc_service_att_err, isc_arg_gds, isc_service_not_supported, 0); #else Index: utl.c =================================================================== RCS file: /cvsroot/firebird/interbase/jrd/utl.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** utl.c 2000/08/20 02:02:23 1.3 --- utl.c 2000/10/12 02:52:17 1.4 *************** *** 296,301 **** "InterBase/DG_X86", /* 58 */ "InterBase/SCO_SV Intel", /* 59 */ /* 5.5 SCO Port */ ! "InterBase/linux Intel", /* 60 */ ! "InterBase/FreeBSD/i386" /* 61 */ }; --- 296,302 ---- "InterBase/DG_X86", /* 58 */ "InterBase/SCO_SV Intel", /* 59 */ /* 5.5 SCO Port */ ! "InterBase/linux Intel", /* 60 */ ! "InterBase/FreeBSD/i386", /* 61 */ ! "InterBase/NetBSD/i386" /* 62 */ }; *************** *** 2274,2278 **** #endif IB_FILE *file; ! #if defined FREEBSD int fd; #endif --- 2275,2279 ---- #endif IB_FILE *file; ! #if defined FREEBSD || defined NETBSD int fd; #endif *************** *** 2301,2305 **** #endif ! #if defined FREEBSD fd = mkstemp(file_name); if (!(file = fdopen(fd, "w+"))) { --- 2302,2306 ---- #endif ! #if defined FREEBSD || defined NETBSD fd = mkstemp(file_name); if (!(file = fdopen(fd, "w+"))) { Index: why.c =================================================================== RCS file: /cvsroot/firebird/interbase/jrd/why.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** why.c 2000/09/29 17:47:47 1.5 --- why.c 2000/10/12 02:52:17 1.6 *************** *** 486,490 **** #if (defined UNIX) && \ ! !(defined SUPERCLIENT || defined SUPERSERVER || defined DECOSF || defined NCR3000 || defined DG_X86 || defined linux || defined FREEBSD || defined AIX_PPC /* platforms without a V3 bridge */) #ifndef PIPE_SERVER_YVALUE #define PIPE_BRIDGE_TO_V3 --- 486,490 ---- #if (defined UNIX) && \ ! !(defined SUPERCLIENT || defined SUPERSERVER || defined DECOSF || defined NCR3000 || defined DG_X86 || defined linux || defined FREEBSD || defined NETBSD || defined AIX_PPC /* platforms without a V3 bridge */) #ifndef PIPE_SERVER_YVALUE #define PIPE_BRIDGE_TO_V3 |