summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwtc%netscape.com <devnull@localhost>2000-04-04 00:27:26 +0000
committerwtc%netscape.com <devnull@localhost>2000-04-04 00:27:26 +0000
commitd03f5b02d834d217331fcdca5aa01c7d61a5c460 (patch)
tree8bc51bc144e92ae5535842b0b65fa108b372aaf8
parent5af6ab2c71b1c434ba0d7df64e83a954b99d7a9f (diff)
downloadnspr-hg-d03f5b02d834d217331fcdca5aa01c7d61a5c460.tar.gz
Bugzilla bug #31697: merged the Mac OS X (Darwin) port onto theSeaMonkey_M15_RELEASESeaMonkey_M15_BASE
NSPRPUB_CLIENT_BRANCH. Modified files: Rhapsody.mk, arch.mk, _pth.h, _rhapsody.h, prlink.c, rhapsody.c, uxproces.c, uxrng.c, ptio.c, pr/tests/Makefile, pr/tests/Makefile.in
-rw-r--r--config/Rhapsody.mk17
-rw-r--r--config/arch.mk3
-rw-r--r--pr/include/md/_darwin.h2
-rw-r--r--pr/include/md/_pth.h6
-rw-r--r--pr/include/md/_rhapsody.h2
-rw-r--r--pr/src/linking/prlink.c11
-rw-r--r--pr/src/md/unix/darwin.c27
-rw-r--r--pr/src/md/unix/rhapsody.c27
-rw-r--r--pr/src/md/unix/uxproces.c8
-rw-r--r--pr/src/md/unix/uxrng.c3
-rw-r--r--pr/src/pthreads/ptio.c7
-rw-r--r--pr/tests/Makefile2
-rw-r--r--pr/tests/Makefile.in2
13 files changed, 90 insertions, 27 deletions
diff --git a/config/Rhapsody.mk b/config/Rhapsody.mk
index 7f3c9116..afc1352e 100644
--- a/config/Rhapsody.mk
+++ b/config/Rhapsody.mk
@@ -21,12 +21,19 @@
include $(MOD_DEPTH)/config/UNIX.mk
-CC = cc
-ifeq ($(OS_RELEASE),5.0)
-CCC = cc++
+#
+# The default implementation strategy for Rhapsody is pthreads.
+#
+ifeq ($(CLASSIC_NSPR),1)
+IMPL_STRATEGY = _EMU
+DEFINES += -D_PR_LOCAL_THREADS_ONLY
else
-CCC = c++
+USE_PTHREADS = 1
+IMPL_STRATEGY = _PTH
endif
+
+CC = cc
+CCC = c++
RANLIB = ranlib
ifeq (86,$(findstring 86,$(OS_TEST)))
@@ -49,8 +56,6 @@ endif
OS_CFLAGS = $(DSO_CFLAGS) $(OS_REL_CFLAGS) -Wmost -fno-common -pipe -DRHAPSODY -DHAVE_STRERROR -DHAVE_BSD_FLOCK
-DEFINES += -D_PR_LOCAL_THREADS_ONLY
-
ARCH = rhapsody
# May override this with -bundle to create a loadable module.
diff --git a/config/arch.mk b/config/arch.mk
index 67734e44..9f4be290 100644
--- a/config/arch.mk
+++ b/config/arch.mk
@@ -50,6 +50,9 @@ OS_ARCH := UNIXWARE
OS_RELEASE := $(shell uname -v)
endif
endif
+ifeq ($(OS_ARCH),Mac OS)
+OS_ARCH := Rhapsody
+endif
ifeq ($(OS_ARCH),ncr)
OS_ARCH := NCR
endif
diff --git a/pr/include/md/_darwin.h b/pr/include/md/_darwin.h
index d97e6a3c..98a2f1ed 100644
--- a/pr/include/md/_darwin.h
+++ b/pr/include/md/_darwin.h
@@ -42,8 +42,8 @@
#define USE_MACH_DYLD
#define _PR_HAVE_SOCKADDR_LEN
#define _PR_STAT_HAS_ST_ATIMESPEC
-#define _PR_TIMESPEC_HAS_TS_SEC
#define _PR_NO_LARGE_FILES
+#define PR_HAVE_SYSV_NAMED_SHARED_MEMORY
#define USE_SETJMP
diff --git a/pr/include/md/_pth.h b/pr/include/md/_pth.h
index 6e2e90c0..2fe641ff 100644
--- a/pr/include/md/_pth.h
+++ b/pr/include/md/_pth.h
@@ -93,7 +93,7 @@
#elif defined(IRIX) || defined(OSF1) || defined(AIX) || defined(SOLARIS) \
|| defined(HPUX) || defined(LINUX) || defined(FREEBSD) \
|| defined(NETBSD) || defined(OPENBSD) || defined(BSDI) \
- || defined(VMS) || defined(NTO)
+ || defined(VMS) || defined(NTO) || defined(RHAPSODY)
#define _PT_PTHREAD_ZERO_THR_HANDLE(t) (t) = 0
#define _PT_PTHREAD_THR_HANDLE_IS_ZERO(t) (t) == 0
#define _PT_PTHREAD_COPY_THR_HANDLE(st, dt) (dt) = (st)
@@ -204,7 +204,7 @@
#define PT_PRIO_MIN 1
#define PT_PRIO_MAX 127
#elif defined(FREEBSD) || defined(NETBSD) || defined(OPENBSD) \
- || defined(BSDI) /* XXX */
+ || defined(BSDI) || defined(RHAPSODY) /* XXX */
#define PT_PRIO_MIN 0
#define PT_PRIO_MAX 126
#else
@@ -237,7 +237,7 @@ extern int (*_PT_aix_yield_fcn)();
PR_END_MACRO
#elif defined(HPUX) || defined(LINUX) || defined(SOLARIS) \
|| defined(FREEBSD) || defined(NETBSD) || defined(OPENBSD) \
- || defined(BSDI) || defined(NTO)
+ || defined(BSDI) || defined(NTO) || defined(RHAPSODY)
#define _PT_PTHREAD_YIELD() sched_yield()
#else
#error "Need to define _PT_PTHREAD_YIELD for this platform"
diff --git a/pr/include/md/_rhapsody.h b/pr/include/md/_rhapsody.h
index d97e6a3c..98a2f1ed 100644
--- a/pr/include/md/_rhapsody.h
+++ b/pr/include/md/_rhapsody.h
@@ -42,8 +42,8 @@
#define USE_MACH_DYLD
#define _PR_HAVE_SOCKADDR_LEN
#define _PR_STAT_HAS_ST_ATIMESPEC
-#define _PR_TIMESPEC_HAS_TS_SEC
#define _PR_NO_LARGE_FILES
+#define PR_HAVE_SYSV_NAMED_SHARED_MEMORY
#define USE_SETJMP
diff --git a/pr/src/linking/prlink.c b/pr/src/linking/prlink.c
index e4d093f1..2601966f 100644
--- a/pr/src/linking/prlink.c
+++ b/pr/src/linking/prlink.c
@@ -734,7 +734,7 @@ pr_LoadLibraryByPathname(const char *name, PRIntn flags)
NSModule h = NULL;
if (NSCreateObjectFileImageFromFile(name, &ofi)
== NSObjectFileImageSuccess) {
- h = NSLinkModule(ofi, name, TRUE);
+ h = NSLinkModule(ofi, name, NSLINKMODULE_OPTION_PRIVATE);
}
#else
#error Configuration error
@@ -1083,7 +1083,14 @@ pr_FindSymbolInLib(PRLibrary *lm, const char *name)
f = NULL;
}
#elif defined(USE_MACH_DYLD)
- f = NSAddressOfSymbol(NSLookupAndBindSymbol(name));
+ {
+ NSSymbol symbol;
+ symbol = NSLookupSymbolInModule(lm->dlh, name);
+ if (symbol != NULL)
+ f = NSAddressOfSymbol(symbol);
+ else
+ f = NULL;
+ }
#endif
#endif /* HAVE_DLL */
#endif /* XP_UNIX */
diff --git a/pr/src/md/unix/darwin.c b/pr/src/md/unix/darwin.c
index ff5f1ad7..93421318 100644
--- a/pr/src/md/unix/darwin.c
+++ b/pr/src/md/unix/darwin.c
@@ -87,13 +87,32 @@ _MD_CREATE_THREAD(
}
#endif /* ! _PR_PTHREADS */
+#if defined(_PR_PTHREADS)
+
/*
-** Whoops, we don't have a syscall stub for this
+** Stubs for unimplemented functions
*/
-int mprotect (caddr_t addr, size_t size, int prot)
+
+int pthread_condattr_init(pthread_condattr_t *attr)
+{
+ return 0;
+}
+
+int pthread_kill(pthread_t thread, int sig)
{
- return -1;
-}
+ return ENOSYS;
+}
+
+typedef struct siginfo_t siginfo_t;
+
+int sigtimedwait(const sigset_t *set, siginfo_t *info,
+ const struct timespec *timeout)
+{
+ errno = ENOSYS;
+ return -1;
+}
+
+#endif /* _PR_PTHREADS */
/* rhapsody.c */
diff --git a/pr/src/md/unix/rhapsody.c b/pr/src/md/unix/rhapsody.c
index ff5f1ad7..93421318 100644
--- a/pr/src/md/unix/rhapsody.c
+++ b/pr/src/md/unix/rhapsody.c
@@ -87,13 +87,32 @@ _MD_CREATE_THREAD(
}
#endif /* ! _PR_PTHREADS */
+#if defined(_PR_PTHREADS)
+
/*
-** Whoops, we don't have a syscall stub for this
+** Stubs for unimplemented functions
*/
-int mprotect (caddr_t addr, size_t size, int prot)
+
+int pthread_condattr_init(pthread_condattr_t *attr)
+{
+ return 0;
+}
+
+int pthread_kill(pthread_t thread, int sig)
{
- return -1;
-}
+ return ENOSYS;
+}
+
+typedef struct siginfo_t siginfo_t;
+
+int sigtimedwait(const sigset_t *set, siginfo_t *info,
+ const struct timespec *timeout)
+{
+ errno = ENOSYS;
+ return -1;
+}
+
+#endif /* _PR_PTHREADS */
/* rhapsody.c */
diff --git a/pr/src/md/unix/uxproces.c b/pr/src/md/unix/uxproces.c
index 8c0a9b96..ac0c6ef8 100644
--- a/pr/src/md/unix/uxproces.c
+++ b/pr/src/md/unix/uxproces.c
@@ -27,7 +27,11 @@
#include <dlfcn.h> /* For dlopen, dlsym, dlclose */
#endif
+#if defined(RHAPSODY)
+#include <crt_externs.h>
+#else
extern char **environ;
+#endif
/*
* HP-UX 9 doesn't have the SA_RESTART flag.
@@ -156,7 +160,11 @@ ForkAndExec(
childEnvp = envp;
if (attr && attr->fdInheritBuffer) {
if (NULL == childEnvp) {
+#ifdef RHAPSODY
+ childEnvp = *(_NSGetEnviron());
+#else
childEnvp = environ;
+#endif
}
for (nEnv = 0; childEnvp[nEnv]; nEnv++) {
}
diff --git a/pr/src/md/unix/uxrng.c b/pr/src/md/unix/uxrng.c
index 23b88705..305d13af 100644
--- a/pr/src/md/unix/uxrng.c
+++ b/pr/src/md/unix/uxrng.c
@@ -261,7 +261,8 @@ GetHighResClock(void *buf, size_t maxbytes)
{
return 0;
}
-#elif defined(SCO) || defined(UNIXWARE) || defined(BSDI) || defined(NTO) || defined(QNX)
+#elif defined(SCO) || defined(UNIXWARE) || defined(BSDI) || defined(NTO) \
+ || defined(QNX) || defined(RHAPSODY)
#include <sys/times.h>
static size_t
diff --git a/pr/src/pthreads/ptio.c b/pr/src/pthreads/ptio.c
index b301ebd5..9dfcffeb 100644
--- a/pr/src/pthreads/ptio.c
+++ b/pr/src/pthreads/ptio.c
@@ -123,7 +123,7 @@ static ssize_t (*pt_aix_sendfile_fptr)() = NULL;
#define _PRSockOptVal_t char *
#elif defined(IRIX) || defined(OSF1) || defined(AIX) || defined(HPUX) \
|| defined(LINUX) || defined(FREEBSD) || defined(BSDI) || defined(VMS) \
- || defined(NTO) || defined(OPENBSD)
+ || defined(NTO) || defined(OPENBSD) || defined(RHAPSODY)
#define _PRSockOptVal_t void *
#else
#error "Cannot determine architecture"
@@ -137,7 +137,7 @@ static ssize_t (*pt_aix_sendfile_fptr)() = NULL;
|| defined(OSF1) || defined(SOLARIS) \
|| defined(HPUX10_30) || defined(HPUX11) || defined(LINUX) \
|| defined(FREEBSD) || defined(NETBSD) || defined(OPENBSD) \
- || defined(BSDI) || defined(VMS) || defined(NTO)
+ || defined(BSDI) || defined(VMS) || defined(NTO) || defined(RHAPSODY)
#define _PRSelectFdSetArg_t fd_set *
#else
#error "Cannot determine architecture"
@@ -2424,7 +2424,8 @@ static PRIOMethods _pr_socketpollfd_methods = {
#if defined(HPUX) || defined(OSF1) || defined(SOLARIS) || defined (IRIX) \
|| defined(AIX) || defined(LINUX) || defined(FREEBSD) || defined(NETBSD) \
- || defined(OPENBSD) || defined(BSDI) || defined(VMS) || defined(NTO)
+ || defined(OPENBSD) || defined(BSDI) || defined(VMS) || defined(NTO) \
+ || defined(RHAPSODY)
#define _PR_FCNTL_FLAGS O_NONBLOCK
#else
#error "Can't determine architecture"
diff --git a/pr/tests/Makefile b/pr/tests/Makefile
index d1851723..943eaa10 100644
--- a/pr/tests/Makefile
+++ b/pr/tests/Makefile
@@ -423,7 +423,7 @@ LIBPTHREAD = -lpthread
ifeq ($(OS_ARCH),AIX)
LIBPTHREAD = -lpthreads
endif
-ifeq (,$(filter-out FreeBSD OpenBSD BSD_OS NTO,$(OS_ARCH)))
+ifeq (,$(filter-out FreeBSD OpenBSD BSD_OS NTO Rhapsody,$(OS_ARCH)))
LIBPTHREAD =
endif
ifeq ($(OS_ARCH)$(basename $(OS_RELEASE)),HP-UXB.10)
diff --git a/pr/tests/Makefile.in b/pr/tests/Makefile.in
index 30dad6d7..56104459 100644
--- a/pr/tests/Makefile.in
+++ b/pr/tests/Makefile.in
@@ -425,7 +425,7 @@ LIBPTHREAD = -lpthread
ifeq ($(OS_ARCH),AIX)
LIBPTHREAD = -lpthreads
endif
-ifeq (,$(filter-out FreeBSD OpenBSD BSD_OS NTO,$(OS_ARCH)))
+ifeq (,$(filter-out FreeBSD OpenBSD BSD_OS NTO Rhapsody,$(OS_ARCH)))
LIBPTHREAD =
endif
ifeq ($(OS_ARCH)$(basename $(OS_RELEASE)),HP-UXB.10)