summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwtc <devnull@localhost>1998-05-05 23:28:45 +0000
committerwtc <devnull@localhost>1998-05-05 23:28:45 +0000
commit1ea5a7509ac869ba75cba57a950d98c1908eccff (patch)
tree7c5f6bd2d26b5a668488486aa2412ec46000a908
parenta3d785f532a6f2bb1b2ad837e09f7f312eee62df (diff)
downloadnspr-hg-1ea5a7509ac869ba75cba57a950d98c1908eccff.tar.gz
Checked in (unfinished) Rhapsody port provided by Chris McAfee and
Chris Toshok (mcafee, toshok@netscape.com). It is classic NSPR, local threads only (based on setjmp/longjmp).
-rw-r--r--config/Rhapsody.mk47
-rw-r--r--config/nsinstall.c23
-rw-r--r--config/rules.mk9
-rw-r--r--pr/include/md/Makefile4
-rw-r--r--pr/include/md/_darwin.cfg119
-rw-r--r--pr/include/md/_darwin.h144
-rw-r--r--pr/include/md/_rhapsody.cfg119
-rw-r--r--pr/include/md/_rhapsody.h144
-rw-r--r--pr/include/md/_unixos.h4
-rw-r--r--pr/include/md/prosdep.h3
-rw-r--r--pr/include/private/primpl.h1
-rw-r--r--pr/src/linking/prlink.c45
-rw-r--r--pr/src/md/prosdep.c2
-rw-r--r--pr/src/md/unix/Makefile7
-rw-r--r--pr/src/md/unix/darwin.c100
-rw-r--r--pr/src/md/unix/freebsd.c6
-rw-r--r--pr/src/md/unix/objs.mk7
-rw-r--r--pr/src/md/unix/rhapsody.c100
-rw-r--r--pr/src/md/unix/unix.c2
-rw-r--r--pr/src/md/unix/unix_errors.c14
-rw-r--r--pr/src/md/unix/uxwrap.c4
-rw-r--r--pr/src/memory/prseg.c2
22 files changed, 871 insertions, 35 deletions
diff --git a/config/Rhapsody.mk b/config/Rhapsody.mk
new file mode 100644
index 00000000..b42bd23c
--- /dev/null
+++ b/config/Rhapsody.mk
@@ -0,0 +1,47 @@
+#
+# The contents of this file are subject to the Netscape Public License
+# Version 1.0 (the "NPL"); you may not use this file except in
+# compliance with the NPL. You may obtain a copy of the NPL at
+# http://www.mozilla.org/NPL/
+#
+# Software distributed under the NPL is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
+# for the specific language governing rights and limitations under the
+# NPL.
+#
+# The Initial Developer of this code under the NPL is Netscape
+# Communications Corporation. Portions created by Netscape are
+# Copyright (C) 1998 Netscape Communications Corporation. All Rights
+# Reserved.
+#
+
+#
+# Config stuff for Rhapsody5.0
+#
+
+include $(MOD_DEPTH)/config/UNIX.mk
+
+CC = cc
+CCC = cc++
+RANLIB = ranlib
+
+OS_REL_CFLAGS = -Dppc
+CPU_ARCH = ppc
+
+#OS_REL_CFLAGS = -mno-486 -Di386
+#CPU_ARCH = x86
+
+OS_CFLAGS = $(DSO_CFLAGS) $(OS_REL_CFLAGS) -pipe -DRHAPSODY -DHAVE_STRERROR -DHAVE_BSD_FLOCK
+
+DEFINES += -D_PR_LOCAL_THREADS_ONLY -D_PR_NEED_FAKE_POLL
+
+ARCH = rhapsody
+
+#DSO_CFLAGS = -fPIC
+#DSO_LDOPTS = -Bshareable
+#DSO_LDFLAGS =
+
+MKSHLIB = $(CC) -arch ppc -dynamiclib -compatibility_version 1 -current_version 1
+DLL_SUFFIX = dylib
+
+#G++INCLUDES = -I/usr/include/g++
diff --git a/config/nsinstall.c b/config/nsinstall.c
index 889eb1e1..5090376b 100644
--- a/config/nsinstall.c
+++ b/config/nsinstall.c
@@ -37,10 +37,18 @@
#define HAVE_LCHOWN
-#if defined(AIX) || defined(BSDI) || defined(HPUX) || defined(LINUX) || defined(SUNOS4) || defined(SCO) || defined(UNIXWARE)
+#if defined(AIX) || defined(BSDI) || defined(HPUX) || defined(LINUX) || defined(SUNOS4) || defined(SCO) || defined(UNIXWARE) || defined(RHAPSODY)
#undef HAVE_LCHOWN
#endif
+/*
+ * Does getcwd() take NULL as the first argument and malloc
+ * the result buffer?
+ */
+#if !defined(RHAPSODY)
+#define GETCWD_CAN_MALLOC
+#endif
+
#ifdef LINUX
#include <getopt.h>
#endif
@@ -187,10 +195,21 @@ main(int argc, char **argv)
if (onlydir)
return 0;
- if (!cwd)
+ if (!cwd) {
+#ifdef GETCWD_CAN_MALLOC
cwd = getcwd(0, PATH_MAX);
+#else
+ cwd = malloc(PATH_MAX + 1);
+ cwd = getcwd(cwd, PATH_MAX);
+#endif
+ }
xchdir(todir);
+#ifdef GETCWD_CAN_MALLOC
todir = getcwd(0, PATH_MAX);
+#else
+ todir = malloc(PATH_MAX + 1);
+ todir = getcwd(todir, PATH_MAX);
+#endif
tdlen = strlen(todir);
xchdir(cwd);
tdlen = strlen(todir);
diff --git a/config/rules.mk b/config/rules.mk
index df142982..b3760848 100644
--- a/config/rules.mk
+++ b/config/rules.mk
@@ -131,7 +131,7 @@ ifeq ($(OS_TARGET), WIN16)
ifeq ($(strip $(W16TEMP)),)
W16LIBS =
else
- W16LIBS = library $(subst $(space),$(comma)$(space),$(strip $(W16TEMP)))
+ W16LIBS = library $(subst $(space),$(comma)$(space),$(strip $(W16TEMP)))
endif
W16DEF = $(notdir $(basename $(SHARED_LIBRARY))).DEF
endif
@@ -257,6 +257,12 @@ ifeq ($(OS_ARCH)$(OS_RELEASE), AIX4.1)
| sort -u >> $(OBJDIR)/lib$(LIBRARY_NAME)_syms
$(LD) $(XCFLAGS) -o $@ $(OBJS) -bE:$(OBJDIR)/lib$(LIBRARY_NAME)_syms \
-bM:SRE -bnoentry $(OS_LIBS) $(EXTRA_LIBS)
+else
+ifeq ($(OS_ARCH)$(OS_RELEASE), Rhapsody5.0)
+ @echo Trying to generate Rhapsody dynamic library.
+ # Do we need this?: -install_name
+ $(CC) -arch ppc -dynamiclib -compatibility_version 1 -current_version 1 -all_load $(OBJS) -o $@
+
else
ifeq ($(OS_ARCH), WINNT)
@@ -294,6 +300,7 @@ else
$(MKSHLIB) -o $@ $(OBJS) $(EXTRA_LIBS) $(OS_LIBS)
endif
endif
+endif
$(PURE_LIBRARY):
rm -f $@
diff --git a/pr/include/md/Makefile b/pr/include/md/Makefile
index 198f8554..31e93439 100644
--- a/pr/include/md/Makefile
+++ b/pr/include/md/Makefile
@@ -79,6 +79,10 @@ ifeq ($(OS_ARCH),SINIX)
MDCPUCFG_H = _reliantunix.cfg
endif
+ifeq ($(OS_ARCH),Rhapsody)
+MDCPUCFG_H = _rhapsody.cfg
+endif
+
ifeq ($(OS_ARCH),NEWS-OS)
MDCPUCFG_H = _sony.cfg
endif
diff --git a/pr/include/md/_darwin.cfg b/pr/include/md/_darwin.cfg
new file mode 100644
index 00000000..73fc491c
--- /dev/null
+++ b/pr/include/md/_darwin.cfg
@@ -0,0 +1,119 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/*
+ * The contents of this file are subject to the Netscape Public License
+ * Version 1.0 (the "NPL"); you may not use this file except in
+ * compliance with the NPL. You may obtain a copy of the NPL at
+ * http://www.mozilla.org/NPL/
+ *
+ * Software distributed under the NPL is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
+ * for the specific language governing rights and limitations under the
+ * NPL.
+ *
+ * The Initial Developer of this code under the NPL is Netscape
+ * Communications Corporation. Portions created by Netscape are
+ * Copyright (C) 1998 Netscape Communications Corporation. All Rights
+ * Reserved.
+ */
+
+#ifndef nspr_cpucfg___
+#define nspr_cpucfg___
+
+#ifndef XP_UNIX
+#define XP_UNIX
+#endif
+
+#ifndef RHAPOSDY
+#define RHAPOSDY
+#endif
+
+#undef IS_LITTLE_ENDIAN
+#define IS_BIG_ENDIAN 1
+#define HAVE_LONG_LONG
+#undef HAVE_ALIGNED_DOUBLES
+#define HAVE_ALIGNED_LONGLONGS 1
+
+#define PR_BYTES_PER_BYTE 1
+#define PR_BYTES_PER_SHORT 2
+#define PR_BYTES_PER_INT 4
+#define PR_BYTES_PER_INT64 8
+#define PR_BYTES_PER_LONG 4
+#define PR_BYTES_PER_FLOAT 4
+#define PR_BYTES_PER_DOUBLE 8
+#define PR_BYTES_PER_WORD 4
+#define PR_BYTES_PER_DWORD 8
+#define PR_BYTES_PER_WORD_LOG2 2
+#define PR_BYTES_PER_DWORD_LOG2 3
+
+#define PR_BITS_PER_BYTE 8
+#define PR_BITS_PER_SHORT 16
+#define PR_BITS_PER_INT 32
+#define PR_BITS_PER_INT64 64
+#define PR_BITS_PER_LONG 32
+#define PR_BITS_PER_FLOAT 32
+#define PR_BITS_PER_DOUBLE 64
+#define PR_BITS_PER_WORD 32
+
+#define PR_BITS_PER_BYTE_LOG2 3
+#define PR_BITS_PER_SHORT_LOG2 4
+#define PR_BITS_PER_INT_LOG2 5
+#define PR_BITS_PER_INT64_LOG2 6
+#define PR_BITS_PER_LONG_LOG2 5
+#define PR_BITS_PER_FLOAT_LOG2 5
+#define PR_BITS_PER_DOUBLE_LOG2 6
+#define PR_BITS_PER_WORD_LOG2 5
+
+#define PR_ALIGN_OF_SHORT 2
+#define PR_ALIGN_OF_INT 4
+#define PR_ALIGN_OF_LONG 4
+#define PR_ALIGN_OF_INT64 4
+#define PR_ALIGN_OF_FLOAT 4
+#define PR_ALIGN_OF_DOUBLE 4
+#define PR_ALIGN_OF_POINTER 4
+
+#ifndef NO_NSPR_10_SUPPORT
+
+#define BYTES_PER_BYTE PR_BYTES_PER_BYTE
+#define BYTES_PER_SHORT PR_BYTES_PER_SHORT
+#define BYTES_PER_INT PR_BYTES_PER_INT
+#define BYTES_PER_INT64 PR_BYTES_PER_INT64
+#define BYTES_PER_LONG PR_BYTES_PER_LONG
+#define BYTES_PER_FLOAT PR_BYTES_PER_FLOAT
+#define BYTES_PER_DOUBLE PR_BYTES_PER_DOUBLE
+#define BYTES_PER_WORD PR_BYTES_PER_WORD
+#define BYTES_PER_DWORD PR_BYTES_PER_DWORD
+
+#define BITS_PER_BYTE PR_BITS_PER_BYTE
+#define BITS_PER_SHORT PR_BITS_PER_SHORT
+#define BITS_PER_INT PR_BITS_PER_INT
+#define BITS_PER_INT64 PR_BITS_PER_INT64
+#define BITS_PER_LONG PR_BITS_PER_LONG
+#define BITS_PER_FLOAT PR_BITS_PER_FLOAT
+#define BITS_PER_DOUBLE PR_BITS_PER_DOUBLE
+#define BITS_PER_WORD PR_BITS_PER_WORD
+
+#define BITS_PER_BYTE_LOG2 PR_BITS_PER_BYTE_LOG2
+#define BITS_PER_SHORT_LOG2 PR_BITS_PER_SHORT_LOG2
+#define BITS_PER_INT_LOG2 PR_BITS_PER_INT_LOG2
+#define BITS_PER_INT64_LOG2 PR_BITS_PER_INT64_LOG2
+#define BITS_PER_LONG_LOG2 PR_BITS_PER_LONG_LOG2
+#define BITS_PER_FLOAT_LOG2 PR_BITS_PER_FLOAT_LOG2
+#define BITS_PER_DOUBLE_LOG2 PR_BITS_PER_DOUBLE_LOG2
+#define BITS_PER_WORD_LOG2 PR_BITS_PER_WORD_LOG2
+
+#define ALIGN_OF_SHORT PR_ALIGN_OF_SHORT
+#define ALIGN_OF_INT PR_ALIGN_OF_INT
+#define ALIGN_OF_LONG PR_ALIGN_OF_LONG
+#define ALIGN_OF_INT64 PR_ALIGN_OF_INT64
+#define ALIGN_OF_FLOAT PR_ALIGN_OF_FLOAT
+#define ALIGN_OF_DOUBLE PR_ALIGN_OF_DOUBLE
+#define ALIGN_OF_POINTER PR_ALIGN_OF_POINTER
+#define ALIGN_OF_WORD PR_ALIGN_OF_WORD
+
+#define BYTES_PER_WORD_LOG2 PR_BYTES_PER_WORD_LOG2
+#define BYTES_PER_DWORD_LOG2 PR_BYTES_PER_DWORD_LOG2
+#define WORDS_PER_DWORD_LOG2 PR_WORDS_PER_DWORD_LOG2
+
+#endif /* NO_NSPR_10_SUPPORT */
+
+#endif /* nspr_cpucfg___ */
diff --git a/pr/include/md/_darwin.h b/pr/include/md/_darwin.h
new file mode 100644
index 00000000..44404ba5
--- /dev/null
+++ b/pr/include/md/_darwin.h
@@ -0,0 +1,144 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/*
+ * The contents of this file are subject to the Netscape Public License
+ * Version 1.0 (the "NPL"); you may not use this file except in
+ * compliance with the NPL. You may obtain a copy of the NPL at
+ * http://www.mozilla.org/NPL/
+ *
+ * Software distributed under the NPL is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
+ * for the specific language governing rights and limitations under the
+ * NPL.
+ *
+ * The Initial Developer of this code under the NPL is Netscape
+ * Communications Corporation. Portions created by Netscape are
+ * Copyright (C) 1998 Netscape Communications Corporation. All Rights
+ * Reserved.
+ */
+
+#ifndef nspr_rhapsody_defs_h___
+#define nspr_rhapsody_defs_h___
+
+#include <sys/syscall.h>
+
+#define PR_LINKER_ARCH "rhapsody"
+#define _PR_SI_SYSNAME "RHAPSODY"
+#ifdef i386
+#define _PR_SI_ARCHITECTURE "x86"
+#else
+#define _PR_SI_ARCHITECTURE "ppc"
+#endif
+#define PR_DLL_SUFFIX ".dylib"
+
+#define _PR_VMBASE 0x30000000
+#define _PR_STACK_VMBASE 0x50000000
+#define _MD_DEFAULT_STACK_SIZE 65536L
+#define _MD_MMAP_FLAGS MAP_PRIVATE
+
+#undef HAVE_STACK_GROWING_UP
+#define HAVE_WEAK_MALLOC_SYMBOLS
+/* do this until I figure out the rhapsody dll stuff. */
+#define HAVE_DLL
+#define USE_RLD
+#define _PR_HAVE_SOCKADDR_LEN
+
+#define USE_SETJMP
+
+#include <setjmp.h>
+
+#define PR_CONTEXT_TYPE jmp_buf
+
+#define CONTEXT(_th) ((_th)->md.context)
+
+#define _MD_GET_SP(_th) (_th)->md.context[2]
+#define PR_NUM_GCREGS _JBLEN
+
+/*
+** Initialize a thread context to run "_main()" when started
+*/
+#define _MD_INIT_CONTEXT(_thread, _sp, _main, status) \
+{ \
+ *status = PR_TRUE; \
+ if (setjmp(CONTEXT(_thread))) { \
+ _main(); \
+ } \
+ _MD_GET_SP(_thread) = (unsigned char*) ((_sp) - 128); \
+}
+
+#define _MD_SWITCH_CONTEXT(_thread) \
+ if (!setjmp(CONTEXT(_thread))) { \
+ (_thread)->md.errcode = errno; \
+ _PR_Schedule(); \
+ }
+
+/*
+** Restore a thread context, saved by _MD_SWITCH_CONTEXT
+*/
+#define _MD_RESTORE_CONTEXT(_thread) \
+{ \
+ errno = (_thread)->md.errcode; \
+ _MD_SET_CURRENT_THREAD(_thread); \
+ longjmp(CONTEXT(_thread), 1); \
+}
+
+/* Machine-dependent (MD) data structures */
+
+struct _MDThread {
+ PR_CONTEXT_TYPE context;
+ int id;
+ int errcode;
+};
+
+struct _MDThreadStack {
+ PRInt8 notused;
+};
+
+struct _MDLock {
+ PRInt8 notused;
+};
+
+struct _MDSemaphore {
+ PRInt8 notused;
+};
+
+struct _MDCVar {
+ PRInt8 notused;
+};
+
+struct _MDSegment {
+ PRInt8 notused;
+};
+
+struct _MDCPU {
+ struct _MDCPU_Unix md_unix;
+};
+
+#define _MD_INIT_LOCKS()
+#define _MD_NEW_LOCK(lock) PR_SUCCESS
+#define _MD_FREE_LOCK(lock)
+#define _MD_LOCK(lock)
+#define _MD_UNLOCK(lock)
+#define _MD_INIT_IO()
+#define _MD_IOQ_LOCK()
+#define _MD_IOQ_UNLOCK()
+
+#define _MD_INIT_RUNNING_CPU(cpu) _MD_unix_init_running_cpu(cpu)
+#define _MD_INIT_THREAD _MD_InitializeThread
+#define _MD_EXIT_THREAD(thread)
+#define _MD_SUSPEND_THREAD(thread) _MD_suspend_thread
+#define _MD_RESUME_THREAD(thread) _MD_resume_thread
+#define _MD_CLEAN_THREAD(_thread)
+
+#define _MD_EARLY_INIT _MD_EarlyInit
+#define _MD_FINAL_INIT _PR_UnixInit
+#define _MD_GET_INTERVAL _PR_UNIX_GetInterval
+#define _MD_INTERVAL_PER_SEC _PR_UNIX_TicksPerSecond
+
+/*
+ * We wrapped the select() call. _MD_SELECT refers to the built-in,
+ * unwrapped version.
+ */
+#define _MD_SELECT(nfds,r,w,e,tv) syscall(SYS_select,nfds,r,w,e,tv)
+
+
+#endif /* nspr_rhapsody_defs_h___ */
diff --git a/pr/include/md/_rhapsody.cfg b/pr/include/md/_rhapsody.cfg
new file mode 100644
index 00000000..73fc491c
--- /dev/null
+++ b/pr/include/md/_rhapsody.cfg
@@ -0,0 +1,119 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/*
+ * The contents of this file are subject to the Netscape Public License
+ * Version 1.0 (the "NPL"); you may not use this file except in
+ * compliance with the NPL. You may obtain a copy of the NPL at
+ * http://www.mozilla.org/NPL/
+ *
+ * Software distributed under the NPL is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
+ * for the specific language governing rights and limitations under the
+ * NPL.
+ *
+ * The Initial Developer of this code under the NPL is Netscape
+ * Communications Corporation. Portions created by Netscape are
+ * Copyright (C) 1998 Netscape Communications Corporation. All Rights
+ * Reserved.
+ */
+
+#ifndef nspr_cpucfg___
+#define nspr_cpucfg___
+
+#ifndef XP_UNIX
+#define XP_UNIX
+#endif
+
+#ifndef RHAPOSDY
+#define RHAPOSDY
+#endif
+
+#undef IS_LITTLE_ENDIAN
+#define IS_BIG_ENDIAN 1
+#define HAVE_LONG_LONG
+#undef HAVE_ALIGNED_DOUBLES
+#define HAVE_ALIGNED_LONGLONGS 1
+
+#define PR_BYTES_PER_BYTE 1
+#define PR_BYTES_PER_SHORT 2
+#define PR_BYTES_PER_INT 4
+#define PR_BYTES_PER_INT64 8
+#define PR_BYTES_PER_LONG 4
+#define PR_BYTES_PER_FLOAT 4
+#define PR_BYTES_PER_DOUBLE 8
+#define PR_BYTES_PER_WORD 4
+#define PR_BYTES_PER_DWORD 8
+#define PR_BYTES_PER_WORD_LOG2 2
+#define PR_BYTES_PER_DWORD_LOG2 3
+
+#define PR_BITS_PER_BYTE 8
+#define PR_BITS_PER_SHORT 16
+#define PR_BITS_PER_INT 32
+#define PR_BITS_PER_INT64 64
+#define PR_BITS_PER_LONG 32
+#define PR_BITS_PER_FLOAT 32
+#define PR_BITS_PER_DOUBLE 64
+#define PR_BITS_PER_WORD 32
+
+#define PR_BITS_PER_BYTE_LOG2 3
+#define PR_BITS_PER_SHORT_LOG2 4
+#define PR_BITS_PER_INT_LOG2 5
+#define PR_BITS_PER_INT64_LOG2 6
+#define PR_BITS_PER_LONG_LOG2 5
+#define PR_BITS_PER_FLOAT_LOG2 5
+#define PR_BITS_PER_DOUBLE_LOG2 6
+#define PR_BITS_PER_WORD_LOG2 5
+
+#define PR_ALIGN_OF_SHORT 2
+#define PR_ALIGN_OF_INT 4
+#define PR_ALIGN_OF_LONG 4
+#define PR_ALIGN_OF_INT64 4
+#define PR_ALIGN_OF_FLOAT 4
+#define PR_ALIGN_OF_DOUBLE 4
+#define PR_ALIGN_OF_POINTER 4
+
+#ifndef NO_NSPR_10_SUPPORT
+
+#define BYTES_PER_BYTE PR_BYTES_PER_BYTE
+#define BYTES_PER_SHORT PR_BYTES_PER_SHORT
+#define BYTES_PER_INT PR_BYTES_PER_INT
+#define BYTES_PER_INT64 PR_BYTES_PER_INT64
+#define BYTES_PER_LONG PR_BYTES_PER_LONG
+#define BYTES_PER_FLOAT PR_BYTES_PER_FLOAT
+#define BYTES_PER_DOUBLE PR_BYTES_PER_DOUBLE
+#define BYTES_PER_WORD PR_BYTES_PER_WORD
+#define BYTES_PER_DWORD PR_BYTES_PER_DWORD
+
+#define BITS_PER_BYTE PR_BITS_PER_BYTE
+#define BITS_PER_SHORT PR_BITS_PER_SHORT
+#define BITS_PER_INT PR_BITS_PER_INT
+#define BITS_PER_INT64 PR_BITS_PER_INT64
+#define BITS_PER_LONG PR_BITS_PER_LONG
+#define BITS_PER_FLOAT PR_BITS_PER_FLOAT
+#define BITS_PER_DOUBLE PR_BITS_PER_DOUBLE
+#define BITS_PER_WORD PR_BITS_PER_WORD
+
+#define BITS_PER_BYTE_LOG2 PR_BITS_PER_BYTE_LOG2
+#define BITS_PER_SHORT_LOG2 PR_BITS_PER_SHORT_LOG2
+#define BITS_PER_INT_LOG2 PR_BITS_PER_INT_LOG2
+#define BITS_PER_INT64_LOG2 PR_BITS_PER_INT64_LOG2
+#define BITS_PER_LONG_LOG2 PR_BITS_PER_LONG_LOG2
+#define BITS_PER_FLOAT_LOG2 PR_BITS_PER_FLOAT_LOG2
+#define BITS_PER_DOUBLE_LOG2 PR_BITS_PER_DOUBLE_LOG2
+#define BITS_PER_WORD_LOG2 PR_BITS_PER_WORD_LOG2
+
+#define ALIGN_OF_SHORT PR_ALIGN_OF_SHORT
+#define ALIGN_OF_INT PR_ALIGN_OF_INT
+#define ALIGN_OF_LONG PR_ALIGN_OF_LONG
+#define ALIGN_OF_INT64 PR_ALIGN_OF_INT64
+#define ALIGN_OF_FLOAT PR_ALIGN_OF_FLOAT
+#define ALIGN_OF_DOUBLE PR_ALIGN_OF_DOUBLE
+#define ALIGN_OF_POINTER PR_ALIGN_OF_POINTER
+#define ALIGN_OF_WORD PR_ALIGN_OF_WORD
+
+#define BYTES_PER_WORD_LOG2 PR_BYTES_PER_WORD_LOG2
+#define BYTES_PER_DWORD_LOG2 PR_BYTES_PER_DWORD_LOG2
+#define WORDS_PER_DWORD_LOG2 PR_WORDS_PER_DWORD_LOG2
+
+#endif /* NO_NSPR_10_SUPPORT */
+
+#endif /* nspr_cpucfg___ */
diff --git a/pr/include/md/_rhapsody.h b/pr/include/md/_rhapsody.h
new file mode 100644
index 00000000..44404ba5
--- /dev/null
+++ b/pr/include/md/_rhapsody.h
@@ -0,0 +1,144 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/*
+ * The contents of this file are subject to the Netscape Public License
+ * Version 1.0 (the "NPL"); you may not use this file except in
+ * compliance with the NPL. You may obtain a copy of the NPL at
+ * http://www.mozilla.org/NPL/
+ *
+ * Software distributed under the NPL is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
+ * for the specific language governing rights and limitations under the
+ * NPL.
+ *
+ * The Initial Developer of this code under the NPL is Netscape
+ * Communications Corporation. Portions created by Netscape are
+ * Copyright (C) 1998 Netscape Communications Corporation. All Rights
+ * Reserved.
+ */
+
+#ifndef nspr_rhapsody_defs_h___
+#define nspr_rhapsody_defs_h___
+
+#include <sys/syscall.h>
+
+#define PR_LINKER_ARCH "rhapsody"
+#define _PR_SI_SYSNAME "RHAPSODY"
+#ifdef i386
+#define _PR_SI_ARCHITECTURE "x86"
+#else
+#define _PR_SI_ARCHITECTURE "ppc"
+#endif
+#define PR_DLL_SUFFIX ".dylib"
+
+#define _PR_VMBASE 0x30000000
+#define _PR_STACK_VMBASE 0x50000000
+#define _MD_DEFAULT_STACK_SIZE 65536L
+#define _MD_MMAP_FLAGS MAP_PRIVATE
+
+#undef HAVE_STACK_GROWING_UP
+#define HAVE_WEAK_MALLOC_SYMBOLS
+/* do this until I figure out the rhapsody dll stuff. */
+#define HAVE_DLL
+#define USE_RLD
+#define _PR_HAVE_SOCKADDR_LEN
+
+#define USE_SETJMP
+
+#include <setjmp.h>
+
+#define PR_CONTEXT_TYPE jmp_buf
+
+#define CONTEXT(_th) ((_th)->md.context)
+
+#define _MD_GET_SP(_th) (_th)->md.context[2]
+#define PR_NUM_GCREGS _JBLEN
+
+/*
+** Initialize a thread context to run "_main()" when started
+*/
+#define _MD_INIT_CONTEXT(_thread, _sp, _main, status) \
+{ \
+ *status = PR_TRUE; \
+ if (setjmp(CONTEXT(_thread))) { \
+ _main(); \
+ } \
+ _MD_GET_SP(_thread) = (unsigned char*) ((_sp) - 128); \
+}
+
+#define _MD_SWITCH_CONTEXT(_thread) \
+ if (!setjmp(CONTEXT(_thread))) { \
+ (_thread)->md.errcode = errno; \
+ _PR_Schedule(); \
+ }
+
+/*
+** Restore a thread context, saved by _MD_SWITCH_CONTEXT
+*/
+#define _MD_RESTORE_CONTEXT(_thread) \
+{ \
+ errno = (_thread)->md.errcode; \
+ _MD_SET_CURRENT_THREAD(_thread); \
+ longjmp(CONTEXT(_thread), 1); \
+}
+
+/* Machine-dependent (MD) data structures */
+
+struct _MDThread {
+ PR_CONTEXT_TYPE context;
+ int id;
+ int errcode;
+};
+
+struct _MDThreadStack {
+ PRInt8 notused;
+};
+
+struct _MDLock {
+ PRInt8 notused;
+};
+
+struct _MDSemaphore {
+ PRInt8 notused;
+};
+
+struct _MDCVar {
+ PRInt8 notused;
+};
+
+struct _MDSegment {
+ PRInt8 notused;
+};
+
+struct _MDCPU {
+ struct _MDCPU_Unix md_unix;
+};
+
+#define _MD_INIT_LOCKS()
+#define _MD_NEW_LOCK(lock) PR_SUCCESS
+#define _MD_FREE_LOCK(lock)
+#define _MD_LOCK(lock)
+#define _MD_UNLOCK(lock)
+#define _MD_INIT_IO()
+#define _MD_IOQ_LOCK()
+#define _MD_IOQ_UNLOCK()
+
+#define _MD_INIT_RUNNING_CPU(cpu) _MD_unix_init_running_cpu(cpu)
+#define _MD_INIT_THREAD _MD_InitializeThread
+#define _MD_EXIT_THREAD(thread)
+#define _MD_SUSPEND_THREAD(thread) _MD_suspend_thread
+#define _MD_RESUME_THREAD(thread) _MD_resume_thread
+#define _MD_CLEAN_THREAD(_thread)
+
+#define _MD_EARLY_INIT _MD_EarlyInit
+#define _MD_FINAL_INIT _PR_UnixInit
+#define _MD_GET_INTERVAL _PR_UNIX_GetInterval
+#define _MD_INTERVAL_PER_SEC _PR_UNIX_TicksPerSecond
+
+/*
+ * We wrapped the select() call. _MD_SELECT refers to the built-in,
+ * unwrapped version.
+ */
+#define _MD_SELECT(nfds,r,w,e,tv) syscall(SYS_select,nfds,r,w,e,tv)
+
+
+#endif /* nspr_rhapsody_defs_h___ */
diff --git a/pr/include/md/_unixos.h b/pr/include/md/_unixos.h
index b82f9265..bd203620 100644
--- a/pr/include/md/_unixos.h
+++ b/pr/include/md/_unixos.h
@@ -49,7 +49,7 @@
|| defined(UNIXWARE) || defined(NCR) || defined(SNI) || defined(NEC) \
|| defined(BSDI) || defined(SONY)
#include <sys/select.h>
-#elif defined(SUNOS4) || defined(SCO) || defined(FREEBSD)
+#elif defined(SUNOS4) || defined(SCO) || defined(FREEBSD) || defined(RHAPSODY)
#include <sys/types.h>
#elif defined(LINUX)
#include <sys/time.h>
@@ -156,7 +156,7 @@ extern void _MD_unix_init_running_cpu(struct _PRCPU *cpu);
** work - it just means that we don't really have a functional
** redzone.
*/
-#if defined(DEBUG)
+#if defined(DEBUG) && !defined(RHAPSODY)
#if !defined(SOLARIS)
#include <string.h> /* for memset() */
#define _MD_INIT_STACK(ts,REDZONE) \
diff --git a/pr/include/md/prosdep.h b/pr/include/md/prosdep.h
index 555a34cd..69985422 100644
--- a/pr/include/md/prosdep.h
+++ b/pr/include/md/prosdep.h
@@ -74,6 +74,9 @@ PR_BEGIN_EXTERN_C
#elif defined(OSF1)
#include "md/_osf1.h"
+#elif defined(RHAPSODY)
+#include "md/_rhapsody.h"
+
#elif defined(SOLARIS)
#include "md/_solaris.h"
diff --git a/pr/include/private/primpl.h b/pr/include/private/primpl.h
index f93ed80f..5a053fce 100644
--- a/pr/include/private/primpl.h
+++ b/pr/include/private/primpl.h
@@ -1470,6 +1470,7 @@ extern PRBool _pr_ipv6_enabled; /* defined in prnetdb.c */
&& (!defined(HPUX) || !defined(_PR_PTHREADS)) \
&& (!defined(IRIX) || !defined(_PR_PTHREADS)) \
&& (!defined(LINUX) || !defined(_PR_PTHREADS)) \
+ && (!defined(RHAPSODY)) \
&& !defined(PURIFY) \
&& !(defined (UNIXWARE) && defined (USE_SVR4_THREADS))
#define _PR_OVERRIDE_MALLOC
diff --git a/pr/src/linking/prlink.c b/pr/src/linking/prlink.c
index 11dd33e7..4a996cf2 100644
--- a/pr/src/linking/prlink.c
+++ b/pr/src/linking/prlink.c
@@ -32,6 +32,10 @@
#include <dlfcn.h>
#elif defined(USE_HPSHL)
#include <dl.h>
+#elif defined(USE_RLD)
+#include <fcntl.h>
+#include <streams/streams.h>
+#include <mach-o/rld.h>
#endif
/* Define this on systems which don't have it (AIX) */
@@ -62,6 +66,9 @@ struct PRLibrary {
#ifdef XP_UNIX
#if defined(USE_HPSHL)
shl_t dlh;
+#elif defined(USE_RLD)
+ NXStream* dlh;
+ int rld_fd;
#else
void* dlh;
#endif
@@ -75,14 +82,14 @@ static char* _pr_currentLibPath = NULL;
/************************************************************************/
-#if ( !defined(USE_DLFCN) && !defined(HAVE_STRERROR) ) || defined(HPUX) || defined(BSDI) || defined(LINUX)
+#if !defined(USE_DLFCN) && !defined(HAVE_STRERROR)
static char* errStrBuf = NULL;
#define ERR_STR_BUF_LENGTH 20
static char* errno_string(PRIntn oserr)
{
if (errStrBuf == NULL)
errStrBuf = PR_MALLOC(ERR_STR_BUF_LENGTH);
- PR_snprintf(errStrBuf, ERR_STR_BUF_LENGTH, "error %ld", oserr);
+ PR_snprintf(errStrBuf, ERR_STR_BUF_LENGTH, "error %d", oserr);
return errStrBuf;
}
#endif
@@ -95,21 +102,13 @@ static void DLLErrorInternal(PRIntn oserr)
*/
{
const char *error = NULL;
-#ifdef HAVE_DLL
-# ifdef USE_DLFCN
- error = dlerror(); /* $$$ That'll be wrong some of the time - AOF */
-# elif defined(USE_HPSHL)
-# ifdef HAVE_STRERROR
- error = strerror(oserr); /* This should be okay */
-# else
- error = errno_string(oserr);
-# endif /* HAVE_STRERROR */
-# else
- error = errno_string(oserr);
-# endif
+#ifdef USE_DLFCN
+ error = dlerror(); /* $$$ That'll be wrong some of the time - AOF */
+#elif defined(HAVE_STRERROR)
+ error = strerror(oserr); /* this should be okay */
#else
error = errno_string(oserr);
-#endif /* HAVE_DLL */
+#endif
if (NULL != error)
PR_SetErrorText(strlen(error), error);
} /* DLLErrorInternal */
@@ -167,6 +166,8 @@ void _PR_InitLinker(void)
#elif defined(USE_HPSHL)
h = NULL;
/* don't abort with this NULL */
+#elif defined(USE_RLD)
+ h = NULL; /* XXXX toshok */
#else
#error no dll strategy
#endif /* USE_DLFCN */
@@ -279,7 +280,7 @@ PR_GetLibraryPath()
#endif
#ifdef XP_UNIX
-#if defined USE_DLFCN
+#if defined USE_DLFCN || defined USE_RLD
{
char *home;
char *local;
@@ -640,6 +641,11 @@ PR_LoadLibrary(const char *name)
* with BIND_DEFERRED, so we have to use the BIND_IMMEDIATE flag.
*/
shl_t h = shl_load(name, BIND_IMMEDIATE | DYNAMIC_PATH, 0L);
+#elif defined(USE_RLD)
+ int fd = open(name, O_RDONLY);
+ NXStream *h = NXOpenFile(fd, NX_READONLY);
+
+ lm->rld_fd = fd;
#else
#error Configuration error
#endif
@@ -706,6 +712,10 @@ PR_UnloadLibrary(PRLibrary *lib)
result = dlclose(lib->dlh);
#elif defined(USE_HPSHL)
result = shl_unload(lib->dlh);
+#elif defined(USE_RLD)
+ result = rld_unload(lib->dlh);
+ NXClose(lib->dlh);
+ close(lib->rld_fd);
#else
#error Configuration error
#endif
@@ -816,6 +826,9 @@ pr_FindSymbolInLib(PRLibrary *lm, const char *name)
#elif defined(USE_HPSHL)
if (shl_findsym(&lm->dlh, name, TYPE_PROCEDURE, &f) == -1)
f = NULL;
+#elif defined(USE_RLD)
+ if (rld_lookup(lm->dlh, name, (unsigned long*)&f) == -1)
+ f = NULL;
#endif
#endif /* HAVE_DLL */
#endif /* XP_UNIX */
diff --git a/pr/src/md/prosdep.c b/pr/src/md/prosdep.c
index fc2d35cb..2d1770dc 100644
--- a/pr/src/md/prosdep.c
+++ b/pr/src/md/prosdep.c
@@ -42,7 +42,7 @@ static void GetPageSize(void)
/* Get page size */
#ifdef XP_UNIX
#if defined SUNOS4 || defined LINUX || defined BSDI || defined AIX \
- || defined FREEBSD
+ || defined FREEBSD || defined RHAPSODY
_pr_pageSize = getpagesize();
#elif defined(HPUX)
/* I have no idea. Don't get me started. --Rob */
diff --git a/pr/src/md/unix/Makefile b/pr/src/md/unix/Makefile
index 2fb04575..6219058c 100644
--- a/pr/src/md/unix/Makefile
+++ b/pr/src/md/unix/Makefile
@@ -81,6 +81,10 @@ RELIANTUNIX_CSRCS = \
reliantunix.c \
$(NULL)
+RHAPSODY_CSRCS = \
+ rhapsody.c \
+ $(NULL)
+
NEC_CSRCS = \
nec.c \
$(NULL)
@@ -137,6 +141,9 @@ endif
ifeq ($(OS_ARCH),SINIX)
CSRCS += $(RELIANTUNIX_CSRCS)
endif
+ifeq ($(OS_ARCH),Rhapsody)
+CSRCS += $(RHAPSODY_CSRCS)
+endif
ifeq ($(OS_ARCH),NEC)
CSRCS += $(NEC_CSRCS)
endif
diff --git a/pr/src/md/unix/darwin.c b/pr/src/md/unix/darwin.c
new file mode 100644
index 00000000..04000437
--- /dev/null
+++ b/pr/src/md/unix/darwin.c
@@ -0,0 +1,100 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/*
+ * The contents of this file are subject to the Netscape Public License
+ * Version 1.0 (the "NPL"); you may not use this file except in
+ * compliance with the NPL. You may obtain a copy of the NPL at
+ * http://www.mozilla.org/NPL/
+ *
+ * Software distributed under the NPL is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
+ * for the specific language governing rights and limitations under the
+ * NPL.
+ *
+ * The Initial Developer of this code under the NPL is Netscape
+ * Communications Corporation. Portions created by Netscape are
+ * Copyright (C) 1998 Netscape Communications Corporation. All Rights
+ * Reserved.
+ */
+
+#include "primpl.h"
+
+#include <signal.h>
+
+void _MD_EarlyInit(void)
+{
+ /*
+ * Ignore FPE because coercion of a NaN to an int causes SIGFPE
+ * to be raised.
+ */
+ struct sigaction act;
+
+ act.sa_handler = SIG_IGN;
+ sigemptyset(&act.sa_mask);
+ act.sa_flags = SA_RESTART;
+ sigaction(SIGFPE, &act, 0);
+}
+
+PRWord *_MD_HomeGCRegisters(PRThread *t, int isCurrent, int *np)
+{
+#ifndef _PR_PTHREADS
+ if (isCurrent) {
+ (void) setjmp(CONTEXT(t));
+ }
+ *np = sizeof(CONTEXT(t)) / sizeof(PRWord);
+ return (PRWord *) CONTEXT(t);
+#else
+ *np = 0;
+ return NULL;
+#endif
+}
+
+#ifndef _PR_PTHREADS
+void
+_MD_SET_PRIORITY(_MDThread *thread, PRUintn newPri)
+{
+ return;
+}
+
+PRStatus
+_MD_InitializeThread(PRThread *thread)
+{
+ return PR_SUCCESS;
+}
+
+PRStatus
+_MD_WAIT(PRThread *thread, PRIntervalTime ticks)
+{
+ PR_ASSERT(!(thread->flags & _PR_GLOBAL_SCOPE));
+ _PR_MD_SWITCH_CONTEXT(thread);
+ return PR_SUCCESS;
+}
+
+PRStatus
+_MD_WAKEUP_WAITER(PRThread *thread)
+{
+ if (thread) {
+ PR_ASSERT(!(thread->flags & _PR_GLOBAL_SCOPE));
+ }
+ return PR_SUCCESS;
+}
+
+/* These functions should not be called for OSF1 */
+void
+_MD_YIELD(void)
+{
+ PR_NOT_REACHED("_MD_YIELD should not be called for OSF1.");
+}
+
+PRStatus
+_MD_CREATE_THREAD(
+ PRThread *thread,
+ void (*start) (void *),
+ PRThreadPriority priority,
+ PRThreadScope scope,
+ PRThreadState state,
+ PRUint32 stackSize)
+{
+ PR_NOT_REACHED("_MD_CREATE_THREAD should not be called for OSF1.");
+ return PR_FAILURE;
+}
+#endif /* ! _PR_PTHREADS */
diff --git a/pr/src/md/unix/freebsd.c b/pr/src/md/unix/freebsd.c
index 05652483..baaf0619 100644
--- a/pr/src/md/unix/freebsd.c
+++ b/pr/src/md/unix/freebsd.c
@@ -78,11 +78,11 @@ _MD_WAKEUP_WAITER(PRThread *thread)
return PR_SUCCESS;
}
-/* These functions should not be called for OSF1 */
+/* These functions should not be called for FreeBSD */
void
_MD_YIELD(void)
{
- PR_NOT_REACHED("_MD_YIELD should not be called for OSF1.");
+ PR_NOT_REACHED("_MD_YIELD should not be called for FreeBSD.");
}
PRStatus
@@ -94,7 +94,7 @@ _MD_CREATE_THREAD(
PRThreadState state,
PRUint32 stackSize)
{
- PR_NOT_REACHED("_MD_CREATE_THREAD should not be called for OSF1.");
+ PR_NOT_REACHED("_MD_CREATE_THREAD should not be called for FreeBSD.");
return PR_FAILURE;
}
#endif /* ! _PR_PTHREADS */
diff --git a/pr/src/md/unix/objs.mk b/pr/src/md/unix/objs.mk
index 7de75fd3..6e95f14d 100644
--- a/pr/src/md/unix/objs.mk
+++ b/pr/src/md/unix/objs.mk
@@ -73,6 +73,10 @@ RELIANTUNIX_CSRCS = \
reliantunix.c \
$(NULL)
+RHAPSODY_CSRCS = \
+ rhapsody.c \
+ $(NULL)
+
NEC_CSRCS = \
nec.c \
$(NULL)
@@ -130,6 +134,9 @@ endif
ifeq ($(OS_ARCH),SINIX)
CSRCS += $(RELIANTUNIX_CSRCS)
endif
+ifeq ($(OS_ARCH),Rhapsody)
+CSRCS += $(RHAPSODY_CSRCS)
+endif
ifeq ($(OS_ARCH),NEC)
CSRCS += $(NEC_CSRCS)
endif
diff --git a/pr/src/md/unix/rhapsody.c b/pr/src/md/unix/rhapsody.c
new file mode 100644
index 00000000..04000437
--- /dev/null
+++ b/pr/src/md/unix/rhapsody.c
@@ -0,0 +1,100 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/*
+ * The contents of this file are subject to the Netscape Public License
+ * Version 1.0 (the "NPL"); you may not use this file except in
+ * compliance with the NPL. You may obtain a copy of the NPL at
+ * http://www.mozilla.org/NPL/
+ *
+ * Software distributed under the NPL is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
+ * for the specific language governing rights and limitations under the
+ * NPL.
+ *
+ * The Initial Developer of this code under the NPL is Netscape
+ * Communications Corporation. Portions created by Netscape are
+ * Copyright (C) 1998 Netscape Communications Corporation. All Rights
+ * Reserved.
+ */
+
+#include "primpl.h"
+
+#include <signal.h>
+
+void _MD_EarlyInit(void)
+{
+ /*
+ * Ignore FPE because coercion of a NaN to an int causes SIGFPE
+ * to be raised.
+ */
+ struct sigaction act;
+
+ act.sa_handler = SIG_IGN;
+ sigemptyset(&act.sa_mask);
+ act.sa_flags = SA_RESTART;
+ sigaction(SIGFPE, &act, 0);
+}
+
+PRWord *_MD_HomeGCRegisters(PRThread *t, int isCurrent, int *np)
+{
+#ifndef _PR_PTHREADS
+ if (isCurrent) {
+ (void) setjmp(CONTEXT(t));
+ }
+ *np = sizeof(CONTEXT(t)) / sizeof(PRWord);
+ return (PRWord *) CONTEXT(t);
+#else
+ *np = 0;
+ return NULL;
+#endif
+}
+
+#ifndef _PR_PTHREADS
+void
+_MD_SET_PRIORITY(_MDThread *thread, PRUintn newPri)
+{
+ return;
+}
+
+PRStatus
+_MD_InitializeThread(PRThread *thread)
+{
+ return PR_SUCCESS;
+}
+
+PRStatus
+_MD_WAIT(PRThread *thread, PRIntervalTime ticks)
+{
+ PR_ASSERT(!(thread->flags & _PR_GLOBAL_SCOPE));
+ _PR_MD_SWITCH_CONTEXT(thread);
+ return PR_SUCCESS;
+}
+
+PRStatus
+_MD_WAKEUP_WAITER(PRThread *thread)
+{
+ if (thread) {
+ PR_ASSERT(!(thread->flags & _PR_GLOBAL_SCOPE));
+ }
+ return PR_SUCCESS;
+}
+
+/* These functions should not be called for OSF1 */
+void
+_MD_YIELD(void)
+{
+ PR_NOT_REACHED("_MD_YIELD should not be called for OSF1.");
+}
+
+PRStatus
+_MD_CREATE_THREAD(
+ PRThread *thread,
+ void (*start) (void *),
+ PRThreadPriority priority,
+ PRThreadScope scope,
+ PRThreadState state,
+ PRUint32 stackSize)
+{
+ PR_NOT_REACHED("_MD_CREATE_THREAD should not be called for OSF1.");
+ return PR_FAILURE;
+}
+#endif /* ! _PR_PTHREADS */
diff --git a/pr/src/md/unix/unix.c b/pr/src/md/unix/unix.c
index 880e8bba..fef2f660 100644
--- a/pr/src/md/unix/unix.c
+++ b/pr/src/md/unix/unix.c
@@ -48,7 +48,7 @@
|| defined(SUNOS4) || defined(NCR)
#define _PRSockLen_t int
#elif (defined(AIX) && !defined(AIX4_1)) || defined(FREEBSD) \
- || defined(UNIXWARE)
+ || defined(UNIXWARE) || defined(RHAPSODY)
#define _PRSockLen_t size_t
#else
#error "Cannot determine architecture"
diff --git a/pr/src/md/unix/unix_errors.c b/pr/src/md/unix/unix_errors.c
index 793cbaed..2e33d995 100644
--- a/pr/src/md/unix/unix_errors.c
+++ b/pr/src/md/unix/unix_errors.c
@@ -160,7 +160,7 @@ void _MD_unix_map_unlink_error(int err)
case EROFS:
PR_SetError(PR_READ_ONLY_FILESYSTEM_ERROR, err);
break;
-#if !defined(OSF1) && !defined(FREEBSD) && !defined(BSDI)
+#if !defined(OSF1) && !defined(FREEBSD) && !defined(BSDI) && !defined(RHAPSODY)
case EMULTIHOP:
case ENOLINK:
PR_SetError(PR_REMOTE_FILE_ERROR, err);
@@ -185,7 +185,7 @@ void _MD_unix_map_stat_error(int err)
PR_SetError(PR_PENDING_INTERRUPT_ERROR, err);
break;
case ETIMEDOUT:
-#if !defined(OSF1) && !defined(FREEBSD) && !defined(BSDI)
+#if !defined(OSF1) && !defined(FREEBSD) && !defined(BSDI) && !defined(RHAPSODY)
case EMULTIHOP:
case ENOLINK:
#endif
@@ -278,7 +278,7 @@ void _MD_unix_map_rename_error(int err)
case ELOOP:
PR_SetError(PR_LOOP_ERROR, err);
break;
-#if !defined(OSF1) && !defined(FREEBSD) && !defined(BSDI)
+#if !defined(OSF1) && !defined(FREEBSD) && !defined(BSDI) && !defined(RHAPSODY)
case EMULTIHOP:
case ENOLINK:
PR_SetError(PR_REMOTE_FILE_ERROR, err);
@@ -329,7 +329,7 @@ void _MD_unix_map_access_error(int err)
case ELOOP:
PR_SetError(PR_LOOP_ERROR, err);
break;
-#if !defined(OSF1) && !defined(FREEBSD) && !defined(BSDI)
+#if !defined(OSF1) && !defined(FREEBSD) && !defined(BSDI) && !defined(RHAPSODY)
case EMULTIHOP:
case ENOLINK:
#endif
@@ -395,7 +395,7 @@ void _MD_unix_map_mkdir_error(int err)
case EIO:
PR_SetError(PR_IO_ERROR, err);
break;
-#if !defined(OSF1) && !defined(FREEBSD) && !defined(BSDI)
+#if !defined(OSF1) && !defined(FREEBSD) && !defined(BSDI) && !defined(RHAPSODY)
case EMULTIHOP:
case ENOLINK:
PR_SetError(PR_REMOTE_FILE_ERROR, err);
@@ -432,7 +432,7 @@ void _MD_unix_map_rmdir_error(int err)
case ELOOP:
PR_SetError(PR_LOOP_ERROR, err);
break;
-#if !defined(OSF1) && !defined(FREEBSD) && !defined(BSDI)
+#if !defined(OSF1) && !defined(FREEBSD) && !defined(BSDI) && !defined(RHAPSODY)
case EMULTIHOP:
case ENOLINK:
#endif
@@ -1345,7 +1345,7 @@ void _MD_unix_map_open_error(int err)
PR_SetError(PR_NO_ACCESS_RIGHTS_ERROR, err);
break;
case ETIMEDOUT:
-#if !defined(OSF1) && !defined(FREEBSD) && !defined(BSDI)
+#if !defined(OSF1) && !defined(FREEBSD) && !defined(BSDI) && !defined(RHAPSODY)
case EMULTIHOP:
case ENOLINK:
#endif
diff --git a/pr/src/md/unix/uxwrap.c b/pr/src/md/unix/uxwrap.c
index 7eef902f..892a3373 100644
--- a/pr/src/md/unix/uxwrap.c
+++ b/pr/src/md/unix/uxwrap.c
@@ -296,10 +296,10 @@ int select(int width, fd_set *rd, fd_set *wr, fd_set *ex, struct timeval *tv)
}
/*
- * Linux, BSDI, and FreeBSD don't have poll()
+ * Linux, BSDI, FreeBSD, and Rhapsody don't have poll().
*/
-#if !defined(LINUX) && !defined(FREEBSD) && !defined(BSDI)
+#if !defined(LINUX) && !defined(FREEBSD) && !defined(BSDI) && !defined(RHAPSODY)
/*
*-----------------------------------------------------------------------
diff --git a/pr/src/memory/prseg.c b/pr/src/memory/prseg.c
index 6a95bd53..c32c5225 100644
--- a/pr/src/memory/prseg.c
+++ b/pr/src/memory/prseg.c
@@ -149,6 +149,7 @@ PR_IMPLEMENT(void) PR_MapSegment(PRSegment *seg, PRSegmentAccess how)
seg->access = how;
#ifdef XP_UNIX
+#ifndef RHAPSODY
if (seg->flags & _PR_SEG_VM) {
int prot;
switch (how) {
@@ -165,6 +166,7 @@ PR_IMPLEMENT(void) PR_MapSegment(PRSegment *seg, PRSegmentAccess how)
(void) mprotect(seg->vaddr, seg->size, prot);
}
#endif
+#endif
}
/*