commit 31584e39b3b37c4e38c51bb8ab6d94e2e5970237
parent a0e172eccc37c27c5bcfb9e8c7291d54c341a29b
Author: Kai Engert <kaie@kuix.de>
Date: Wed, 29 Oct 2025 13:27:27 +0000
Bug 1995970 - NSPR_4_38_BETA2. r=jcristau UPGRADE_NSPR_RELEASE
Differential Revision: https://phabricator.services.mozilla.com/D269743
Diffstat:
26 files changed, 40 insertions(+), 1660 deletions(-)
diff --git a/nsprpub/TAG-INFO b/nsprpub/TAG-INFO
@@ -1 +1 @@
-NSPR_4_37_RTM
-\ No newline at end of file
+NSPR_4_38_BETA2
+\ No newline at end of file
diff --git a/nsprpub/configure b/nsprpub/configure
@@ -3003,7 +3003,7 @@ test -n "$target_alias" &&
program_prefix=${target_alias}-
MOD_MAJOR_VERSION=4
-MOD_MINOR_VERSION=37
+MOD_MINOR_VERSION=38
MOD_PATCH_VERSION=0
NSPR_MODNAME=nspr20
_HAVE_PTHREADS=
@@ -7326,170 +7326,6 @@ tools are selected during the Xcode/Developer Tools installation." "$LINENO" 5
PR_MD_CSRCS=freebsd.c
;;
-*-hpux*)
- printf "%s\n" "#define XP_UNIX 1" >>confdefs.h
-
- printf "%s\n" "#define HPUX 1" >>confdefs.h
-
- printf "%s\n" "#define _HPUX_SOURCE 1" >>confdefs.h
-
- # HPUX report the POLLHUP event for a socket when the
- # shutdown(SHUT_WR) operation is called for the remote end, even though
- # the socket is still writeable. Use select(), instead of poll(), to
- # workaround this problem.
- printf "%s\n" "#define _PR_POLL_WITH_SELECT 1" >>confdefs.h
-
- printf "%s\n" "#define _USE_BIG_FDS 1" >>confdefs.h
-
- DSO_LDOPTS='-b +h $(notdir $@)'
- PR_MD_CSRCS=hpux.c
- if test "$OS_TEST" = "ia64"; then
- DLL_SUFFIX=so
- DSO_LDOPTS="$DSO_LDOPTS +b '\$\$ORIGIN'"
- CPU_ARCH_TAG=_$OS_TEST
- if test -z "$USE_64"; then
- COMPILER_TAG=_32
- fi
- PR_MD_ASFILES=os_HPUX_ia64.s
- else
- printf "%s\n" "#define hppa 1" >>confdefs.h
-
- DLL_SUFFIX=sl
- PR_MD_ASFILES=os_HPUX.s
- fi
- if test -n "$USE_64"; then
- MDCPUCFG_H=_hpux64.cfg
- else
- MDCPUCFG_H=_hpux32.cfg
- fi
- if test -z "$GNU_CC"; then
- CC="$CC -Ae"
- CXX="$CXX -ext"
- DSO_CFLAGS=+Z
- else
- DSO_CFLAGS=-fPIC
- ASFLAGS="$ASFLAGS -x assembler-with-cpp"
- fi
-
- if test -n "$MOZILLA_CLIENT"; then
- DEFAULT_IMPL_STRATEGY=_EMU
- fi
-
- if echo "$OS_RELEASE" | egrep '^(A.09|B.10)' >/dev/null; then
- printf "%s\n" "#define _PR_NO_LARGE_FILES 1" >>confdefs.h
-
- fi
-
- if echo "$OS_RELEASE" | egrep '^(B.10.10|B.10.20)' >/dev/null; then
- printf "%s\n" "#define _PR_NEED_H_ERRNO 1" >>confdefs.h
-
- fi
-
- if echo "$OS_RELEASE" | egrep '^(B.10.10|B.10.20)' >/dev/null; then
- printf "%s\n" "#define HAVE_INT_LOCALTIME_R 1" >>confdefs.h
-
- fi
-
- if echo "$OS_RELEASE" | egrep '^(B.10.30|B.11)' >/dev/null; then
- printf "%s\n" "#define HAVE_POINTER_LOCALTIME_R 1" >>confdefs.h
-
- fi
-
- # HP-UX 11i v2 (B.11.23) or higher
-
- case "$OS_RELEASE" in
- [C-Z]*|B.[2-9]*|B.1[2-9]*|B.11.[3-9]*|B.11.2[3-9]*)
- USE_IPV6=1
- ;;
- esac
-
-
- if test "$OS_RELEASE" = "B.10.01"; then
- printf "%s\n" "#define HPUX10 1" >>confdefs.h
-
- DEFAULT_IMPL_STRATEGY=_EMU
- fi
-
- if test "$OS_RELEASE" = "B.10.10"; then
- printf "%s\n" "#define HPUX10 1" >>confdefs.h
-
- printf "%s\n" "#define HPUX10_10 1" >>confdefs.h
-
- DEFAULT_IMPL_STRATEGY=_PTH
- fi
-
- if test "$OS_RELEASE" = "B.10.20"; then
- printf "%s\n" "#define HPUX10 1" >>confdefs.h
-
- printf "%s\n" "#define HPUX10_20 1" >>confdefs.h
-
- if test -z "$GNU_CC"; then
- CFLAGS="$CFLAGS +DAportable +DS1.1"
- CXXFLAGS="$CXXFLAGS +DAportable +DS1.1"
- fi
- DEFAULT_IMPL_STRATEGY=_PTH
- fi
-
- if test "$OS_RELEASE" = "B.10.30"; then
- printf "%s\n" "#define HPUX10 1" >>confdefs.h
-
- printf "%s\n" "#define HPUX10_30 1" >>confdefs.h
-
- if test -z "$GNU_CC"; then
- CFLAGS="$CFLAGS +DAportable +DS1.1"
- CXXFLAGS="$CXXFLAGS +DAportable +DS1.1"
- fi
- DEFAULT_IMPL_STRATEGY=_PTH
- fi
-
- if echo "$OS_RELEASE" | grep ^B.11 >/dev/null; then
- printf "%s\n" "#define HPUX10 1" >>confdefs.h
-
- printf "%s\n" "#define HPUX11 1" >>confdefs.h
-
- printf "%s\n" "#define _LARGEFILE64_SOURCE 1" >>confdefs.h
-
- printf "%s\n" "#define _PR_HAVE_OFF64_T 1" >>confdefs.h
-
- printf "%s\n" "#define HAVE_FCNTL_FILE_LOCKING 1" >>confdefs.h
-
- if test -z "$GNU_CC"; then
- if test -z "$USE_64"; then
- if test "$OS_TEST" = "ia64"; then
- CFLAGS="$CFLAGS +DD32"
- CXXFLAGS="$CXXFLAGS +DD32"
- else
- CFLAGS="$CFLAGS +DAportable +DS2.0"
- CXXFLAGS="$CXXFLAGS +DAportable +DS2.0"
- fi
- else
- if test "$OS_TEST" = "ia64"; then
- CFLAGS="$CFLAGS +DD64"
- CXXFLAGS="$CXXFLAGS +DD64"
- else
- CFLAGS="$CFLAGS +DA2.0W +DS2.0"
- CXXFLAGS="$CXXFLAGS +DA2.0W +DS2.0"
- fi
- fi
- fi
- DEFAULT_IMPL_STRATEGY=_PTH
- fi
-
- if test "$DEFAULT_IMPL_STRATEGY" = "_EMU"; then
- USE_NSPR_THREADS=1
- USE_PTHREADS=
- USE_USER_PTHREADS=
- elif test "$DEFAULT_IMPL_STRATEGY" = "_PTH"; then
- USE_PTHREADS=1
- if test "$USE_NSPR_THREADS"; then
- USE_PTHREADS=
- fi
- if test "$USE_USER_PTHREADS"; then
- USE_PTHREADS=
- fi
- fi
- ;;
-
*-linux*|*-gnu*|*-k*bsd*-gnu|*-android*|*-linuxandroid*)
if test -z "$USE_NSPR_THREADS"; then
USE_PTHREADS=1
diff --git a/nsprpub/configure.in b/nsprpub/configure.in
@@ -15,7 +15,7 @@ dnl ========================================================
dnl = Defaults
dnl ========================================================
MOD_MAJOR_VERSION=4
-MOD_MINOR_VERSION=37
+MOD_MINOR_VERSION=38
MOD_PATCH_VERSION=0
NSPR_MODNAME=nspr20
_HAVE_PTHREADS=
@@ -1396,148 +1396,6 @@ tools are selected during the Xcode/Developer Tools installation.])
PR_MD_CSRCS=freebsd.c
;;
-*-hpux*)
- AC_DEFINE(XP_UNIX)
- AC_DEFINE(HPUX)
- AC_DEFINE(_HPUX_SOURCE)
- # HPUX report the POLLHUP event for a socket when the
- # shutdown(SHUT_WR) operation is called for the remote end, even though
- # the socket is still writeable. Use select(), instead of poll(), to
- # workaround this problem.
- AC_DEFINE(_PR_POLL_WITH_SELECT)
- AC_DEFINE(_USE_BIG_FDS)
- DSO_LDOPTS='-b +h $(notdir $@)'
- PR_MD_CSRCS=hpux.c
- if test "$OS_TEST" = "ia64"; then
- DLL_SUFFIX=so
- DSO_LDOPTS="$DSO_LDOPTS +b '\$\$ORIGIN'"
- CPU_ARCH_TAG=_$OS_TEST
- if test -z "$USE_64"; then
- COMPILER_TAG=_32
- fi
- PR_MD_ASFILES=os_HPUX_ia64.s
- else
- AC_DEFINE(hppa)
- DLL_SUFFIX=sl
- PR_MD_ASFILES=os_HPUX.s
- fi
- if test -n "$USE_64"; then
- MDCPUCFG_H=_hpux64.cfg
- else
- MDCPUCFG_H=_hpux32.cfg
- fi
- if test -z "$GNU_CC"; then
- CC="$CC -Ae"
- CXX="$CXX -ext"
- DSO_CFLAGS=+Z
- else
- DSO_CFLAGS=-fPIC
- ASFLAGS="$ASFLAGS -x assembler-with-cpp"
- fi
-
- if test -n "$MOZILLA_CLIENT"; then
- DEFAULT_IMPL_STRATEGY=_EMU
- fi
-
- if echo "$OS_RELEASE" | egrep '^(A.09|B.10)' >/dev/null; then
- AC_DEFINE(_PR_NO_LARGE_FILES)
- fi
-
- if echo "$OS_RELEASE" | egrep '^(B.10.10|B.10.20)' >/dev/null; then
- AC_DEFINE(_PR_NEED_H_ERRNO)
- fi
-
- if echo "$OS_RELEASE" | egrep '^(B.10.10|B.10.20)' >/dev/null; then
- AC_DEFINE(HAVE_INT_LOCALTIME_R)
- fi
-
- if echo "$OS_RELEASE" | egrep '^(B.10.30|B.11)' >/dev/null; then
- AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
- fi
-
- # HP-UX 11i v2 (B.11.23) or higher
- changequote(<<,>>)
- case "$OS_RELEASE" in
- [C-Z]*|B.[2-9]*|B.1[2-9]*|B.11.[3-9]*|B.11.2[3-9]*)
- USE_IPV6=1
- ;;
- esac
- changequote([,])
-
- if test "$OS_RELEASE" = "B.10.01"; then
- AC_DEFINE(HPUX10)
- DEFAULT_IMPL_STRATEGY=_EMU
- fi
-
- if test "$OS_RELEASE" = "B.10.10"; then
- AC_DEFINE(HPUX10)
- AC_DEFINE(HPUX10_10)
- DEFAULT_IMPL_STRATEGY=_PTH
- fi
-
- if test "$OS_RELEASE" = "B.10.20"; then
- AC_DEFINE(HPUX10)
- AC_DEFINE(HPUX10_20)
- if test -z "$GNU_CC"; then
- CFLAGS="$CFLAGS +DAportable +DS1.1"
- CXXFLAGS="$CXXFLAGS +DAportable +DS1.1"
- fi
- DEFAULT_IMPL_STRATEGY=_PTH
- fi
-
- if test "$OS_RELEASE" = "B.10.30"; then
- AC_DEFINE(HPUX10)
- AC_DEFINE(HPUX10_30)
- if test -z "$GNU_CC"; then
- CFLAGS="$CFLAGS +DAportable +DS1.1"
- CXXFLAGS="$CXXFLAGS +DAportable +DS1.1"
- fi
- DEFAULT_IMPL_STRATEGY=_PTH
- fi
-
- if echo "$OS_RELEASE" | grep ^B.11 >/dev/null; then
- AC_DEFINE(HPUX10)
- AC_DEFINE(HPUX11)
- AC_DEFINE(_LARGEFILE64_SOURCE)
- AC_DEFINE(_PR_HAVE_OFF64_T)
- AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
- if test -z "$GNU_CC"; then
- if test -z "$USE_64"; then
- if test "$OS_TEST" = "ia64"; then
- CFLAGS="$CFLAGS +DD32"
- CXXFLAGS="$CXXFLAGS +DD32"
- else
- CFLAGS="$CFLAGS +DAportable +DS2.0"
- CXXFLAGS="$CXXFLAGS +DAportable +DS2.0"
- fi
- else
- if test "$OS_TEST" = "ia64"; then
- CFLAGS="$CFLAGS +DD64"
- CXXFLAGS="$CXXFLAGS +DD64"
- else
- CFLAGS="$CFLAGS +DA2.0W +DS2.0"
- CXXFLAGS="$CXXFLAGS +DA2.0W +DS2.0"
- fi
- fi
- fi
- DEFAULT_IMPL_STRATEGY=_PTH
- fi
-
- if test "$DEFAULT_IMPL_STRATEGY" = "_EMU"; then
- USE_NSPR_THREADS=1
- USE_PTHREADS=
- USE_USER_PTHREADS=
- elif test "$DEFAULT_IMPL_STRATEGY" = "_PTH"; then
- USE_PTHREADS=1
- if test "$USE_NSPR_THREADS"; then
- USE_PTHREADS=
- fi
- if test "$USE_USER_PTHREADS"; then
- USE_PTHREADS=
- fi
- fi
- ;;
-
*-linux*|*-gnu*|*-k*bsd*-gnu|*-android*|*-linuxandroid*)
if test -z "$USE_NSPR_THREADS"; then
USE_PTHREADS=1
diff --git a/nsprpub/pr/include/gencfg.c b/nsprpub/pr/include/gencfg.c
@@ -13,10 +13,8 @@ error -
#endif
#if defined(__hpux)
-# ifndef HPUX
error -
- HPUX is not defined
-# endif
+ HPUX is not supported
#endif
#if defined(__alpha)
@@ -59,11 +57,7 @@ error -
# define INT64 long
# endif
#else
-# if defined(HPUX)
-# define INT64 long
-# else
# define INT64 long long
-# endif
#endif
struct align_short {
diff --git a/nsprpub/pr/include/md/_hpux.h b/nsprpub/pr/include/md/_hpux.h
@@ -1,288 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef nspr_xhppa_defs_h___
-#define nspr_xhppa_defs_h___
-
-/*
- * Internal configuration macros
- */
-
-#define PR_LINKER_ARCH "hpux"
-#define _PR_SI_SYSNAME "HPUX"
-#ifdef __ia64
-#define _PR_SI_ARCHITECTURE "ia64"
-#define PR_DLL_SUFFIX ".so"
-#else
-/*
- * _PR_SI_ARCHITECTURE must be "hppa1.1" for backward compatibility.
- * It was changed to "hppa" in NSPR 4.6.2, but was changed back in
- * NSPR 4.6.4.
- */
-#define _PR_SI_ARCHITECTURE "hppa1.1"
-#define PR_DLL_SUFFIX ".sl"
-#endif
-
-#define _PR_VMBASE 0x30000000
-#define _PR_STACK_VMBASE 0x50000000
-/*
- * _USE_BIG_FDS increases the size of fd_set from 256 bytes to
- * about 7500 bytes. PR_Poll allocates three fd_sets on the
- * stack, so it is safer to also increase the default thread
- * stack size.
- */
-#define _MD_DEFAULT_STACK_SIZE (2*65536L)
-#define _MD_MINIMUM_STACK_SIZE (2*65536L)
-#define _MD_MMAP_FLAGS MAP_PRIVATE
-
-#define NEED_TIME_R
-
-#define HAVE_STACK_GROWING_UP
-#undef HAVE_WEAK_IO_SYMBOLS
-#undef HAVE_WEAK_MALLOC_SYMBOLS
-#define HAVE_DLL
-#ifdef IS_64
-#define USE_DLFCN
-#else
-#define USE_HPSHL
-#endif
-#ifndef HAVE_STRERROR
-#define HAVE_STRERROR
-#endif
-#define _PR_POLL_AVAILABLE
-#define _PR_USE_POLL
-#define _PR_STAT_HAS_ONLY_ST_ATIME
-#define _PR_HAVE_POSIX_SEMAPHORES
-#define PR_HAVE_POSIX_NAMED_SHARED_MEMORY
-#define _PR_ACCEPT_INHERIT_NONBLOCK
-
-#if defined(__ia64)
-#define _PR_HAVE_ATOMIC_OPS
-#define _MD_INIT_ATOMIC()
-extern PRInt32 _PR_ia64_AtomicIncrement(PRInt32 *val);
-#define _MD_ATOMIC_INCREMENT _PR_ia64_AtomicIncrement
-extern PRInt32 _PR_ia64_AtomicDecrement(PRInt32 *val);
-#define _MD_ATOMIC_DECREMENT _PR_ia64_AtomicDecrement
-extern PRInt32 _PR_ia64_AtomicAdd(PRInt32 *ptr, PRInt32 val);
-#define _MD_ATOMIC_ADD _PR_ia64_AtomicAdd
-extern PRInt32 _PR_ia64_AtomicSet(PRInt32 *val, PRInt32 newval);
-#define _MD_ATOMIC_SET _PR_ia64_AtomicSet
-#endif
-
-#define _PR_HAVE_GETIPNODEBYNAME
-#define _PR_HAVE_GETIPNODEBYADDR
-#define _PR_HAVE_GETADDRINFO
-#ifdef _PR_INET6
-#define _PR_HAVE_INET_NTOP
-#else
-#define _PR_INET6_PROBE
-
-/* for HP-UX 11.11 without IPv6 */
-#ifndef AF_INET6
-#define AF_INET6 22
-#define AI_CANONNAME 2
-#define AI_NUMERICHOST 4
-#define AI_NUMERICSERV 8
-#define AI_V4MAPPED 0x00000010
-#define AI_ADDRCONFIG 0x00000040
-#define AI_ALL 0x00000020
-#define AI_DEFAULT (AI_V4MAPPED|AI_ADDRCONFIG)
-#define NI_NUMERICHOST 2
-struct addrinfo {
- int ai_flags; /* AI_PASSIVE, AI_CANONNAME */
- int ai_family; /* PF_xxx */
- int ai_socktype; /* SOCK_xxx */
- int ai_protocol; /* IPPROTO_xxx for IPv4 and IPv6 */
- socklen_t ai_addrlen; /* length of ai_addr */
- char *ai_canonname; /* canonical name for host */
- struct sockaddr *ai_addr; /* binary address */
- struct addrinfo *ai_next; /* next structure in linked list */
-};
-#endif /* for HP-UX 11.11 without IPv6 */
-
-#define _PR_HAVE_MD_SOCKADDR_IN6
-/* isomorphic to struct in6_addr on HP-UX B.11.23 */
-struct _md_in6_addr {
- union {
- PRUint8 _S6_u8[16];
- PRUint16 _S6_u16[8];
- PRUint32 _S6_u32[4];
- PRUint32 __S6_align;
- } _s6_un;
-};
-/* isomorphic to struct sockaddr_in6 on HP-UX B.11.23 */
-struct _md_sockaddr_in6 {
- PRUint16 sin6_family;
- PRUint16 sin6_port;
- PRUint32 sin6_flowinfo;
- struct _md_in6_addr sin6_addr;
- PRUint32 sin6_scope_id;
-};
-#endif
-
-#if !defined(_PR_PTHREADS)
-
-#include <syscall.h>
-#include <setjmp.h>
-
-#define USE_SETJMP
-
-#define _MD_GET_SP(_t) (*((int *)((_t)->md.jb) + 1))
-#define PR_NUM_GCREGS _JBLEN
-/* Caveat: This makes jmp_buf full of doubles. */
-#define CONTEXT(_th) ((_th)->md.jb)
-
-/* Stack needs two frames (64 bytes) at the bottom */ \
-#define _MD_SET_THR_SP(_t, _sp) ((_MD_GET_SP(_t)) = (int) (_sp + 64 *2))
-#define SAVE_CONTEXT(_th) _setjmp(CONTEXT(_th))
-#define GOTO_CONTEXT(_th) _longjmp(CONTEXT(_th), 1)
-
-#if !defined(PTHREADS_USER)
-
-#define _MD_INIT_CONTEXT(_thread, _sp, _main, status) \
-{ \
- *(status) = PR_TRUE; \
- if (_setjmp(CONTEXT(_thread))) (*_main)(); \
- /* Stack needs two frames (64 bytes) at the bottom */ \
- (_MD_GET_SP(_thread)) = (int) ((_sp) + 64*2); \
-}
-
-#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. HP-UX has no native threads. */
-
-struct _MDThread {
- jmp_buf jb;
- int id;
- int errcode;
-};
-
-struct _MDThreadStack {
- PRInt8 notused;
-};
-
-struct _MDLock {
- PRInt8 notused;
-};
-
-struct _MDSemaphore {
- PRInt8 notused;
-};
-
-struct _MDCVar {
- PRInt8 notused;
-};
-
-struct _MDSegment {
- PRInt8 notused;
-};
-
-/*
- * md-specific cpu structure field
- */
-#define _PR_MD_MAX_OSFD FD_SETSIZE
-
-struct _MDCPU_Unix {
- PRCList ioQ;
- PRUint32 ioq_timeout;
- PRInt32 ioq_max_osfd;
- PRInt32 ioq_osfd_cnt;
-#ifndef _PR_USE_POLL
- fd_set fd_read_set, fd_write_set, fd_exception_set;
- PRInt16 fd_read_cnt[_PR_MD_MAX_OSFD],fd_write_cnt[_PR_MD_MAX_OSFD],
- fd_exception_cnt[_PR_MD_MAX_OSFD];
-#else
- struct pollfd *ioq_pollfds;
- int ioq_pollfds_size;
-#endif /* _PR_USE_POLL */
-};
-
-#define _PR_IOQ(_cpu) ((_cpu)->md.md_unix.ioQ)
-#define _PR_ADD_TO_IOQ(_pq, _cpu) PR_APPEND_LINK(&_pq.links, &_PR_IOQ(_cpu))
-#define _PR_FD_READ_SET(_cpu) ((_cpu)->md.md_unix.fd_read_set)
-#define _PR_FD_READ_CNT(_cpu) ((_cpu)->md.md_unix.fd_read_cnt)
-#define _PR_FD_WRITE_SET(_cpu) ((_cpu)->md.md_unix.fd_write_set)
-#define _PR_FD_WRITE_CNT(_cpu) ((_cpu)->md.md_unix.fd_write_cnt)
-#define _PR_FD_EXCEPTION_SET(_cpu) ((_cpu)->md.md_unix.fd_exception_set)
-#define _PR_FD_EXCEPTION_CNT(_cpu) ((_cpu)->md.md_unix.fd_exception_cnt)
-#define _PR_IOQ_TIMEOUT(_cpu) ((_cpu)->md.md_unix.ioq_timeout)
-#define _PR_IOQ_MAX_OSFD(_cpu) ((_cpu)->md.md_unix.ioq_max_osfd)
-#define _PR_IOQ_OSFD_CNT(_cpu) ((_cpu)->md.md_unix.ioq_osfd_cnt)
-#define _PR_IOQ_POLLFDS(_cpu) ((_cpu)->md.md_unix.ioq_pollfds)
-#define _PR_IOQ_POLLFDS_SIZE(_cpu) ((_cpu)->md.md_unix.ioq_pollfds_size)
-
-#define _PR_IOQ_MIN_POLLFDS_SIZE(_cpu) 32
-
-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)
-
-#else /* PTHREADS_USER */
-
-#include "_nspr_pthread.h"
-
-#endif /* PTHREADS_USER */
-
-#endif /* !defined(_PR_PTHREADS) */
-
-#if !defined(PTHREADS_USER)
-#define _MD_EARLY_INIT _MD_EarlyInit
-#define _MD_FINAL_INIT _PR_UnixInit
-#endif
-
-#if defined(HPUX_LW_TIMER)
-extern void _PR_HPUX_LW_IntervalInit(void);
-extern PRIntervalTime _PR_HPUX_LW_GetInterval(void);
-#define _MD_INTERVAL_INIT _PR_HPUX_LW_IntervalInit
-#define _MD_GET_INTERVAL _PR_HPUX_LW_GetInterval
-#define _MD_INTERVAL_PER_SEC() 1000
-#else
-#define _MD_INTERVAL_USE_GTOD
-#endif
-
-/*
- * 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)
-
-#include <poll.h>
-#define _MD_POLL(fds,nfds,timeout) syscall(SYS_poll,fds,nfds,timeout)
-
-#ifdef HPUX11
-extern void _MD_hpux_map_sendfile_error(int err);
-#endif /* HPUX11 */
-
-#endif /* nspr_xhppa_defs_h___ */
diff --git a/nsprpub/pr/include/md/_hpux32.cfg b/nsprpub/pr/include/md/_hpux32.cfg
@@ -1,112 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef nspr_cpucfg___
-#define nspr_cpucfg___
-
-#ifndef XP_UNIX
-#define XP_UNIX
-#endif
-
-#ifndef HPUX
-#define HPUX
-#endif
-
-#undef IS_LITTLE_ENDIAN
-#define IS_BIG_ENDIAN 1
-
-#define PR_AF_INET6 22 /* same as AF_INET6 */
-
-#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 8
-#define PR_ALIGN_OF_POINTER 4
-
-#ifndef HAVE_LONG_LONG
-#define HAVE_LONG_LONG
-#endif
-#define HAVE_ALIGNED_DOUBLES
-#define HAVE_ALIGNED_LONGLONGS
-
-#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/nsprpub/pr/include/md/_hpux64.cfg b/nsprpub/pr/include/md/_hpux64.cfg
@@ -1,113 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef nspr_cpucfg___
-#define nspr_cpucfg___
-
-#ifndef XP_UNIX
-#define XP_UNIX
-#endif
-
-#ifndef HPUX
-#define HPUX
-#endif
-
-#undef IS_LITTLE_ENDIAN
-#define IS_BIG_ENDIAN 1
-#define IS_64
-
-#define PR_AF_INET6 22 /* same as AF_INET6 */
-
-#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 8
-#define PR_BYTES_PER_FLOAT 4
-#define PR_BYTES_PER_DOUBLE 8
-#define PR_BYTES_PER_WORD 8
-#define PR_BYTES_PER_DWORD 8
-
-#define PR_BYTES_PER_WORD_LOG2 3
-#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 64
-#define PR_BITS_PER_FLOAT 32
-#define PR_BITS_PER_DOUBLE 64
-#define PR_BITS_PER_WORD 64
-
-#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 6
-#define PR_BITS_PER_FLOAT_LOG2 5
-#define PR_BITS_PER_DOUBLE_LOG2 6
-#define PR_BITS_PER_WORD_LOG2 6
-
-#define PR_ALIGN_OF_SHORT 2
-#define PR_ALIGN_OF_INT 4
-#define PR_ALIGN_OF_LONG 8
-#define PR_ALIGN_OF_INT64 8
-#define PR_ALIGN_OF_FLOAT 4
-#define PR_ALIGN_OF_DOUBLE 8
-#define PR_ALIGN_OF_POINTER 8
-
-#ifndef HAVE_LONG_LONG
-#define HAVE_LONG_LONG
-#endif
-#define HAVE_ALIGNED_DOUBLES
-#define HAVE_ALIGNED_LONGLONGS
-
-#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/nsprpub/pr/include/md/_pth.h b/nsprpub/pr/include/md/_pth.h
@@ -63,8 +63,7 @@
*/
#if defined(AIX) || defined(SOLARIS) \
|| defined(LINUX) || defined(__GNU__) || defined(__GLIBC__) \
- || defined(HPUX) || defined(FREEBSD) \
- || defined(NETBSD) || defined(OPENBSD) \
+ || defined(FREEBSD) || defined(NETBSD) || defined(OPENBSD) \
|| defined(NTO) || defined(DARWIN) \
|| defined(RISCOS)
#define _PT_PTHREAD_INVALIDATE_THR_HANDLE(t) (t) = 0
@@ -104,10 +103,6 @@
#endif
#define PT_PRIO_MIN DEFAULT_PRIO
#define PT_PRIO_MAX DEFAULT_PRIO
-#elif defined(HPUX)
-#include <sys/sched.h>
-#define PT_PRIO_MIN sched_get_priority_min(SCHED_OTHER)
-#define PT_PRIO_MAX sched_get_priority_max(SCHED_OTHER)
#elif defined(LINUX) || defined(__GNU__) || defined(__GLIBC__) \
|| defined(FREEBSD)
#define PT_PRIO_MIN sched_get_priority_min(SCHED_OTHER)
@@ -149,7 +144,7 @@
#if defined(AIX)
extern int (*_PT_aix_yield_fcn)();
#define _PT_PTHREAD_YIELD() (*_PT_aix_yield_fcn)()
-#elif defined(HPUX) || defined(SOLARIS) \
+#elif defined(SOLARIS) \
|| defined(LINUX) || defined(__GNU__) || defined(__GLIBC__) \
|| defined(FREEBSD) || defined(NETBSD) || defined(OPENBSD) \
|| defined(NTO) || defined(DARWIN) \
diff --git a/nsprpub/pr/include/md/prosdep.h b/nsprpub/pr/include/md/prosdep.h
@@ -40,9 +40,6 @@ PR_BEGIN_EXTERN_C
#elif defined(OPENBSD)
#include "md/_openbsd.h"
-#elif defined(HPUX)
-#include "md/_hpux.h"
-
#elif defined(LINUX) || defined(__GNU__) || defined(__GLIBC__)
#include "md/_linux.h"
diff --git a/nsprpub/pr/include/prinit.h b/nsprpub/pr/include/prinit.h
@@ -30,11 +30,11 @@ PR_BEGIN_EXTERN_C
** The format of the version string is
** "<major version>.<minor version>[.<patch level>] [<Beta>]"
*/
-#define PR_VERSION "4.37"
+#define PR_VERSION "4.38 Beta"
#define PR_VMAJOR 4
-#define PR_VMINOR 37
+#define PR_VMINOR 38
#define PR_VPATCH 0
-#define PR_BETA PR_FALSE
+#define PR_BETA PR_TRUE
/*
** PRVersionCheck
diff --git a/nsprpub/pr/include/private/primpl.h b/nsprpub/pr/include/private/primpl.h
@@ -1589,10 +1589,6 @@ struct PRThread {
PRUint32 interrupt_blocked; /* interrupt blocked */
struct pollfd *syspoll_list; /* Unix polling list used by PR_Poll */
PRUint32 syspoll_count; /* number of elements in syspoll_list */
-#if defined(_PR_POLL_WITH_SELECT)
- int *selectfd_list; /* Unix fd's that PR_Poll selects on */
- PRUint32 selectfd_count; /* number of elements in selectfd_list */
-#endif
#elif defined(_PR_BTHREADS)
PRUint32 flags;
_MDThread md;
diff --git a/nsprpub/pr/include/prtypes.h b/nsprpub/pr/include/prtypes.h
@@ -208,22 +208,12 @@ PR_BEGIN_EXTERN_C
#if PR_BYTES_PER_BYTE == 1
typedef unsigned char PRUint8;
/*
-** There are two scenarios that require us to define PRInt8 as type 'char'.
-** (1)
-** Some cfront-based C++ compilers do not like 'signed char' and
-** issue the warning message:
-** warning: "signed" not implemented (ignored)
-** For these compilers, we have to define PRInt8 as plain 'char'.
-** Make sure that plain 'char' is indeed signed under these compilers.
-** (2)
** Mozilla C++ code expects the PRInt{N} and int{N}_t types to match (see bug
** 634793). If a platform defines int8_t as 'char', but NSPR defines it as
** 'signed char', it results in a type mismatch.
** On such platforms we define PRInt8 as 'char' to avoid the mismatch.
*/
-#if (defined(HPUX) && defined(__cplusplus) /* reason 1*/ \
- && !defined(__GNUC__) && __cplusplus < 199707L) \
- || (defined(__sun) && defined(__cplusplus)) /* reason 2 */
+#if defined(__sun) && defined(__cplusplus)
typedef char PRInt8;
#else
typedef signed char PRInt8;
diff --git a/nsprpub/pr/src/linking/prlink.c b/nsprpub/pr/src/linking/prlink.c
@@ -944,61 +944,6 @@ PR_GetLibraryFilePathname(const char* name, PRFuncPtr addr) {
}
PR_Free(info);
return result;
-#elif defined(HPUX) && defined(USE_HPSHL)
- int index;
- struct shl_descriptor desc;
- char* result;
-
- for (index = 0; shl_get_r(index, &desc) == 0; index++) {
- if (strstr(desc.filename, name) != NULL) {
- result = PR_Malloc(strlen(desc.filename) + 1);
- if (result != NULL) {
- strcpy(result, desc.filename);
- }
- return result;
- }
- }
- /*
- * Since the index value of a library is decremented if
- * a library preceding it in the shared library search
- * list was unloaded, it is possible that we missed some
- * libraries as we went up the list. So we should go
- * down the list to be sure that we not miss anything.
- */
- for (index--; index >= 0; index--) {
- if ((shl_get_r(index, &desc) == 0) &&
- (strstr(desc.filename, name) != NULL)) {
- result = PR_Malloc(strlen(desc.filename) + 1);
- if (result != NULL) {
- strcpy(result, desc.filename);
- }
- return result;
- }
- }
- PR_SetError(PR_LIBRARY_NOT_LOADED_ERROR, 0);
- return NULL;
-#elif defined(HPUX) && defined(USE_DLFCN)
- struct load_module_desc desc;
- char* result;
- const char* module_name;
-
- if (dlmodinfo((unsigned long)addr, &desc, sizeof desc, NULL, 0, 0) == 0) {
- PR_SetError(PR_LIBRARY_NOT_LOADED_ERROR, _MD_ERRNO());
- DLLErrorInternal(_MD_ERRNO());
- return NULL;
- }
- module_name = dlgetname(&desc, sizeof desc, NULL, 0, 0);
- if (module_name == NULL) {
- /* should not happen */
- _PR_MD_MAP_DEFAULT_ERROR(_MD_ERRNO());
- DLLErrorInternal(_MD_ERRNO());
- return NULL;
- }
- result = PR_Malloc(strlen(module_name) + 1);
- if (result != NULL) {
- strcpy(result, module_name);
- }
- return result;
#elif defined(WIN32)
PRUnichar wname[MAX_PATH];
HMODULE handle = NULL;
diff --git a/nsprpub/pr/src/md/prosdep.c b/nsprpub/pr/src/md/prosdep.c
@@ -27,9 +27,6 @@ static void GetPageSize(void) {
# if defined AIX || defined LINUX || defined __GNU__ || defined __GLIBC__ || \
defined FREEBSD || defined NETBSD || defined OPENBSD || defined DARWIN
_pr_pageSize = getpagesize();
-# elif defined(HPUX)
- /* I have no idea. Don't get me started. --Rob */
- _pr_pageSize = sysconf(_SC_PAGE_SIZE);
# else
_pr_pageSize = sysconf(_SC_PAGESIZE);
# endif
diff --git a/nsprpub/pr/src/md/unix/hpux.c b/nsprpub/pr/src/md/unix/hpux.c
@@ -1,182 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "primpl.h"
-#include <setjmp.h>
-
-#if defined(HPUX_LW_TIMER)
-
-# include <machine/inline.h>
-# include <machine/clock.h>
-# include <unistd.h>
-# include <sys/time.h>
-# include <sys/pstat.h>
-
-int __lw_get_thread_times(int which, int64_t* sample, int64_t* time);
-
-static double msecond_per_itick;
-
-void _PR_HPUX_LW_IntervalInit(void) {
- struct pst_processor psp;
- int iticksperclktick, clk_tck;
- int rv;
-
- rv = pstat_getprocessor(&psp, sizeof(psp), 1, 0);
- PR_ASSERT(rv != -1);
-
- iticksperclktick = psp.psp_iticksperclktick;
- clk_tck = sysconf(_SC_CLK_TCK);
- msecond_per_itick = (1000.0) / (double)(iticksperclktick * clk_tck);
-}
-
-PRIntervalTime _PR_HPUX_LW_GetInterval(void) {
- int64_t time, sample;
-
- __lw_get_thread_times(1, &sample, &time);
- /*
- * Division is slower than float multiplication.
- * return (time / iticks_per_msecond);
- */
- return (time * msecond_per_itick);
-}
-#endif /* HPUX_LW_TIMER */
-
-#if !defined(PTHREADS_USER)
-
-void _MD_EarlyInit(void) {
-# ifndef _PR_PTHREADS
- /*
- * The following piece of code is taken from ns/nspr/src/md_HP-UX.c.
- * In the comment for revision 1.6, dated 1995/09/11 23:33:34,
- * robm says:
- * This version has some problems which need to be addressed.
- * First, intercept all system calls and prevent them from
- * executing the library code which performs stack switches
- * before normal system call invocation. In order for library
- * calls which make system calls to work (like stdio), however,
- * we must also allocate our own stack and switch the primordial
- * stack to use it. This isn't so bad, except that I fudged the
- * backtrace length when copying the old stack to the new one.
- *
- * This is the original comment of robm in the code:
- * XXXrobm Horrific. To avoid a problem with HP's system call
- * code, we allocate a new stack for the primordial thread and
- * use it. However, we don't know how far back the original stack
- * goes. We should create a routine that performs a backtrace and
- * finds out just how much we need to copy. As a temporary measure,
- * I just copy an arbitrary guess.
- *
- * In an email to servereng dated 2 Jan 1997, Mike Patnode (mikep)
- * suggests that this only needs to be done for HP-UX 9.
- */
-# endif /* !_PR_PTHREADS */
-}
-
-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 HP-UX */
-void _MD_YIELD(void) {
- PR_NOT_REACHED("_MD_YIELD should not be called for HP-UX.");
-}
-
-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 HP-UX.");
-}
-# endif /* _PR_PTHREADS */
-
-void _MD_suspend_thread(PRThread* thread) {
-# ifdef _PR_PTHREADS
-# endif
-}
-
-void _MD_resume_thread(PRThread* thread) {
-# ifdef _PR_PTHREADS
-# endif
-}
-#endif /* PTHREADS_USER */
-
-/*
- * The HP version of strchr is buggy. It looks past the end of the
- * string and causes a segmentation fault when our (NSPR) version
- * of malloc is used.
- *
- * A better solution might be to put a cushion in our malloc just in
- * case HP's version of strchr somehow gets used instead of this one.
- */
-char* strchr(const char* s, int c) {
- char ch;
-
- if (!s) {
- return NULL;
- }
-
- ch = (char)c;
-
- while ((*s) && ((*s) != ch)) {
- s++;
- }
-
- if ((*s) == ch) {
- return (char*)s;
- }
-
- return NULL;
-}
-
-/*
- * Implemementation of memcmp in HP-UX (verified on releases A.09.03,
- * A.09.07, and B.10.10) dumps core if called with:
- * 1. First operand with address = 1(mod 4).
- * 2. Size = 1(mod 4)
- * 3. Last byte of the second operand is the last byte of the page and
- * next page is not accessible(not mapped or protected)
- * Thus, using the following naive version (tons of optimizations are
- * possible;^)
- */
-
-int memcmp(const void* s1, const void* s2, size_t n) {
- register unsigned char *p1 = (unsigned char*)s1, *p2 = (unsigned char*)s2;
-
- while (n-- > 0) {
- register int r = ((int)((unsigned int)*p1)) - ((int)((unsigned int)*p2));
- if (r) {
- return r;
- }
- p1++;
- p2++;
- }
- return 0;
-}
diff --git a/nsprpub/pr/src/md/unix/unix.c b/nsprpub/pr/src/md/unix/unix.c
@@ -35,7 +35,7 @@
*/
#if defined(HAVE_SOCKLEN_T) || (defined(__GLIBC__) && __GLIBC__ >= 2)
# define _PRSockLen_t socklen_t
-#elif defined(HPUX) || defined(SOLARIS) || defined(AIX4_1) || \
+#elif defined(SOLARIS) || defined(AIX4_1) || \
defined(LINUX) || defined(DARWIN) || defined(QNX)
# define _PRSockLen_t int
#elif (defined(AIX) && !defined(AIX4_1)) || defined(FREEBSD) || \
diff --git a/nsprpub/pr/src/md/unix/uxrng.c b/nsprpub/pr/src/md/unix/uxrng.c
@@ -21,31 +21,6 @@ static size_t GetHighResClock(void* buf, size_t maxbytes) {
return 0;
}
-#elif defined(HPUX)
-
-# ifdef __ia64
-# include <ia64/sys/inline.h>
-
-static size_t GetHighResClock(void* buf, size_t maxbytes) {
- PRUint64 t;
-
-# ifdef __GNUC__
- __asm__ __volatile__("mov %0 = ar.itc" : "=r"(t));
-# else
- t = _Asm_mov_from_ar(_AREG44);
-# endif
- return _pr_CopyLowBits(buf, maxbytes, &t, sizeof(t));
-}
-# else
-static size_t GetHighResClock(void* buf, size_t maxbytes) {
- extern int ret_cr16();
- int cr16val;
-
- cr16val = ret_cr16();
- return (_pr_CopyLowBits(buf, maxbytes, &cr16val, sizeof(cr16val)));
-}
-# endif
-
#elif defined(AIX)
static size_t GetHighResClock(void* buf, size_t maxbytes) { return 0; }
diff --git a/nsprpub/pr/src/md/unix/uxwrap.c b/nsprpub/pr/src/md/unix/uxwrap.c
@@ -294,8 +294,6 @@ int select(int width, fd_set* rd, fd_set* wr, fd_set* ex, struct timeval* tv)
int wrap_poll(void* listptr, unsigned long nfds, long timeout)
# elif (defined(AIX) && !defined(AIX_RENAME_SELECT))
int poll(void* listptr, unsigned long nfds, long timeout)
-# elif defined(HPUX)
-int poll(struct pollfd filedes[], unsigned int nfds, int timeout)
# elif defined(NETBSD)
int poll(struct pollfd* filedes, nfds_t nfds, int timeout)
# elif defined(OPENBSD)
diff --git a/nsprpub/pr/src/md/windows/ntio.c b/nsprpub/pr/src/md/windows/ntio.c
@@ -2826,7 +2826,7 @@ static PRBool IsRootDirectory(char* fn, size_t buflen) {
return PR_TRUE;
}
- if (isalpha(fn[0]) && fn[1] == ':' && _PR_IS_SLASH(fn[2]) && fn[3] == '\0') {
+ if (isalpha((unsigned char)fn[0]) && fn[1] == ':' && _PR_IS_SLASH(fn[2]) && fn[3] == '\0') {
rv = GetDriveType(fn) > 1 ? PR_TRUE : PR_FALSE;
return rv;
}
diff --git a/nsprpub/pr/src/md/windows/w95io.c b/nsprpub/pr/src/md/windows/w95io.c
@@ -608,7 +608,7 @@ static PRBool IsRootDirectory(char* fn, size_t buflen) {
return PR_TRUE;
}
- if (isalpha(fn[0]) && fn[1] == ':' && _PR_IS_SLASH(fn[2]) && fn[3] == '\0') {
+ if (isalpha((unsigned char)fn[0]) && fn[1] == ':' && _PR_IS_SLASH(fn[2]) && fn[3] == '\0') {
rv = GetDriveType(fn) > 1 ? PR_TRUE : PR_FALSE;
return rv;
}
diff --git a/nsprpub/pr/src/misc/prsystem.c b/nsprpub/pr/src/misc/prsystem.c
@@ -22,10 +22,6 @@
# include <mach/mach_port.h>
#endif
-#if defined(HPUX)
-# include <sys/mpctl.h>
-# include <sys/pstat.h>
-#endif
#if defined(XP_UNIX)
# include <unistd.h>
@@ -181,12 +177,6 @@ PR_IMPLEMENT(PRInt32) PR_GetNumberOfProcessors(void) {
numCpus = -1; /* set to -1 for return value on error */
_PR_MD_MAP_DEFAULT_ERROR(_MD_ERRNO());
}
-#elif defined(HPUX)
- numCpus = mpctl(MPC_GETNUMSPUS, 0, 0);
- if (numCpus < 1) {
- numCpus = -1; /* set to -1 for return value on error */
- _PR_MD_MAP_DEFAULT_ERROR(_MD_ERRNO());
- }
#elif defined(RISCOS)
numCpus = 1;
#elif defined(LINUX)
@@ -275,14 +265,6 @@ PR_IMPLEMENT(PRUint64) PR_GetPhysicalMemorySize(void) {
bytes = memSize;
}
-#elif defined(HPUX)
-
- struct pst_static info;
- int result = pstat_getstatic(&info, sizeof(info), 1, 0);
- if (result == 1) {
- bytes = (PRUint64)info.physical_memory * info.page_size;
- }
-
#elif defined(DARWIN)
mach_port_t mach_host = mach_host_self();
diff --git a/nsprpub/pr/src/pthreads/ptio.c b/nsprpub/pr/src/pthreads/ptio.c
@@ -10,12 +10,6 @@
#if defined(_PR_PTHREADS)
-# if defined(_PR_POLL_WITH_SELECT)
-# if !(defined(HPUX) && defined(_USE_BIG_FDS))
-/* set fd limit for select(), before including system header files */
-# define FD_SETSIZE (16 * 1024)
-# endif
-# endif
# include <pthread.h>
# include <string.h> /* for memset() */
@@ -182,9 +176,7 @@ static ssize_t (*pt_aix_sendfile_fptr)() = NULL;
static PRBool _pr_ipv6_v6only_on_by_default;
# endif
-# if (defined(HPUX) && !defined(HPUX10_30) && !defined(HPUX11))
-# define _PRSelectFdSetArg_t int*
-# elif defined(AIX4_1)
+# if defined(AIX4_1)
# define _PRSelectFdSetArg_t void*
# elif (defined(AIX) && !defined(AIX4_1)) || defined(SOLARIS) || \
defined(HPUX10_30) || defined(HPUX11) || defined(LINUX) || \
@@ -265,11 +257,6 @@ static PRBool IsValidNetAddrLen(const PRNetAddr* addr, PRInt32 addr_len) {
* might hang up before an interrupt is noticed.
*/
# define PT_DEFAULT_POLL_MSEC 5000
-# if defined(_PR_POLL_WITH_SELECT)
-# define PT_DEFAULT_SELECT_SEC (PT_DEFAULT_POLL_MSEC / PR_MSEC_PER_SEC)
-# define PT_DEFAULT_SELECT_USEC \
- ((PT_DEFAULT_POLL_MSEC % PR_MSEC_PER_SEC) * PR_USEC_PER_MSEC)
-# endif
/*
* pt_SockLen is the type for the length of a socket address
@@ -405,164 +392,6 @@ PR_IMPLEMENT(void) PT_FPrintStats(PRFileDesc* debug_out, const char* msg) {
# endif /* DEBUG */
-# if defined(_PR_POLL_WITH_SELECT)
-/*
- * HPUX report the POLLHUP event for a socket when the
- * shutdown(SHUT_WR) operation is called for the remote end, even though
- * the socket is still writeable. Use select(), instead of poll(), to
- * workaround this problem.
- */
-static void pt_poll_now_with_select(pt_Continuation* op) {
- PRInt32 msecs;
- fd_set rd, wr, *rdp, *wrp;
- struct timeval tv;
- PRIntervalTime epoch, now, elapsed, remaining;
- PRBool wait_for_remaining;
- PRThread* self = PR_GetCurrentThread();
-
- PR_ASSERT(PR_INTERVAL_NO_WAIT != op->timeout);
- PR_ASSERT(op->arg1.osfd < FD_SETSIZE);
-
- switch (op->timeout) {
- case PR_INTERVAL_NO_TIMEOUT:
- tv.tv_sec = PT_DEFAULT_SELECT_SEC;
- tv.tv_usec = PT_DEFAULT_SELECT_USEC;
- do {
- PRIntn rv;
-
- if (op->event & POLLIN) {
- FD_ZERO(&rd);
- FD_SET(op->arg1.osfd, &rd);
- rdp = &rd;
- } else {
- rdp = NULL;
- }
- if (op->event & POLLOUT) {
- FD_ZERO(&wr);
- FD_SET(op->arg1.osfd, &wr);
- wrp = ≀
- } else {
- wrp = NULL;
- }
-
- rv = select(op->arg1.osfd + 1, rdp, wrp, NULL, &tv);
-
- if (_PT_THREAD_INTERRUPTED(self)) {
- self->state &= ~PT_THREAD_ABORTED;
- op->result.code = -1;
- op->syserrno = EINTR;
- op->status = pt_continuation_done;
- return;
- }
-
- if ((-1 == rv) && ((errno == EINTR) || (errno == EAGAIN))) {
- continue; /* go around the loop again */
- }
-
- if (rv > 0) {
- PRInt16 revents = 0;
-
- if ((op->event & POLLIN) && FD_ISSET(op->arg1.osfd, &rd)) {
- revents |= POLLIN;
- }
- if ((op->event & POLLOUT) && FD_ISSET(op->arg1.osfd, &wr)) {
- revents |= POLLOUT;
- }
-
- if (op->function(op, revents)) {
- op->status = pt_continuation_done;
- }
- } else if (rv == -1) {
- op->result.code = -1;
- op->syserrno = errno;
- op->status = pt_continuation_done;
- }
- /* else, select timed out */
- } while (pt_continuation_done != op->status);
- break;
- default:
- now = epoch = PR_IntervalNow();
- remaining = op->timeout;
- do {
- PRIntn rv;
-
- if (op->event & POLLIN) {
- FD_ZERO(&rd);
- FD_SET(op->arg1.osfd, &rd);
- rdp = &rd;
- } else {
- rdp = NULL;
- }
- if (op->event & POLLOUT) {
- FD_ZERO(&wr);
- FD_SET(op->arg1.osfd, &wr);
- wrp = ≀
- } else {
- wrp = NULL;
- }
-
- wait_for_remaining = PR_TRUE;
- msecs = (PRInt32)PR_IntervalToMilliseconds(remaining);
- if (msecs > PT_DEFAULT_POLL_MSEC) {
- wait_for_remaining = PR_FALSE;
- msecs = PT_DEFAULT_POLL_MSEC;
- }
- tv.tv_sec = msecs / PR_MSEC_PER_SEC;
- tv.tv_usec = (msecs % PR_MSEC_PER_SEC) * PR_USEC_PER_MSEC;
- rv = select(op->arg1.osfd + 1, rdp, wrp, NULL, &tv);
-
- if (_PT_THREAD_INTERRUPTED(self)) {
- self->state &= ~PT_THREAD_ABORTED;
- op->result.code = -1;
- op->syserrno = EINTR;
- op->status = pt_continuation_done;
- return;
- }
-
- if (rv > 0) {
- PRInt16 revents = 0;
-
- if ((op->event & POLLIN) && FD_ISSET(op->arg1.osfd, &rd)) {
- revents |= POLLIN;
- }
- if ((op->event & POLLOUT) && FD_ISSET(op->arg1.osfd, &wr)) {
- revents |= POLLOUT;
- }
-
- if (op->function(op, revents)) {
- op->status = pt_continuation_done;
- }
-
- } else if ((rv == 0) || ((errno == EINTR) || (errno == EAGAIN))) {
- if (rv == 0) { /* select timed out */
- if (wait_for_remaining) {
- now += remaining;
- } else {
- now += PR_MillisecondsToInterval(msecs);
- }
- } else {
- now = PR_IntervalNow();
- }
- elapsed = (PRIntervalTime)(now - epoch);
- if (elapsed >= op->timeout) {
- op->result.code = -1;
- op->syserrno = ETIMEDOUT;
- op->status = pt_continuation_done;
- } else {
- remaining = op->timeout - elapsed;
- }
- } else {
- op->result.code = -1;
- op->syserrno = errno;
- op->status = pt_continuation_done;
- }
- } while (pt_continuation_done != op->status);
- break;
- }
-
-} /* pt_poll_now_with_select */
-
-# endif /* _PR_POLL_WITH_SELECT */
static void pt_poll_now(pt_Continuation* op) {
PRInt32 msecs;
@@ -571,15 +400,6 @@ static void pt_poll_now(pt_Continuation* op) {
PRThread* self = PR_GetCurrentThread();
PR_ASSERT(PR_INTERVAL_NO_WAIT != op->timeout);
-# if defined(_PR_POLL_WITH_SELECT)
- /*
- * If the fd is small enough call the select-based poll operation
- */
- if (op->arg1.osfd < FD_SETSIZE) {
- pt_poll_now_with_select(op);
- return;
- }
-# endif
switch (op->timeout) {
case PR_INTERVAL_NO_TIMEOUT:
@@ -1989,7 +1809,7 @@ static PRInt32 pt_TCP_SendTo(PRFileDesc* fd, const void* buf, PRInt32 amount,
PRIntn flags, const PRNetAddr* addr,
PRIntervalTime timeout) {
# if defined(LINUX) || HAS_CONNECTX
- PRInt32 syserrno, bytes = -1;
+ PRInt32 syserrno;
PRBool fNeedContinue = PR_FALSE;
pt_SockLen addr_len;
const PRNetAddr* addrp = addr;
@@ -2001,7 +1821,7 @@ static PRInt32 pt_TCP_SendTo(PRFileDesc* fd, const void* buf, PRInt32 amount,
# endif
if (pt_TestAbort()) {
- return bytes;
+ return -1;
}
PR_ASSERT(IsValidNetAddr(addr) == PR_TRUE);
@@ -2029,9 +1849,14 @@ static PRInt32 pt_TCP_SendTo(PRFileDesc* fd, const void* buf, PRInt32 amount,
addrp = &addrCopy;
# endif
+ size_t bytes = 0;
+ PRInt32 netResult = 0;
# ifndef HAS_CONNECTX
- bytes = sendto(fd->secret->md.osfd, buf, amount, MSG_FASTOPEN,
- (struct sockaddr*)addrp, addr_len);
+ netResult = sendto(fd->secret->md.osfd, buf, amount, MSG_FASTOPEN,
+ (struct sockaddr*)addrp, addr_len);
+ if (netResult >= 0) {
+ bytes = netResult;
+ }
# else
sa_endpoints_t endpoints;
endpoints.sae_srcif = 0;
@@ -2042,11 +1867,11 @@ static PRInt32 pt_TCP_SendTo(PRFileDesc* fd, const void* buf, PRInt32 amount,
struct iovec iov[1];
iov[0].iov_base = buf;
iov[0].iov_len = amount;
- PRInt32 rv = connectx(fd->secret->md.osfd, &endpoints, SAE_ASSOCID_ANY,
- CONNECT_DATA_IDEMPOTENT, iov, 1, &bytes, NULL);
+ netResult = connectx(fd->secret->md.osfd, &endpoints, SAE_ASSOCID_ANY,
+ CONNECT_DATA_IDEMPOTENT, iov, 1, &bytes, NULL);
# endif
syserrno = errno;
- if ((bytes == -1) && (syserrno == EWOULDBLOCK || syserrno == EAGAIN) &&
+ if ((netResult < 0) && (syserrno == EWOULDBLOCK || syserrno == EAGAIN) &&
(!fd->secret->nonblocking)) {
if (PR_INTERVAL_NO_WAIT == timeout) {
syserrno = ETIMEDOUT;
@@ -2065,14 +1890,18 @@ static PRInt32 pt_TCP_SendTo(PRFileDesc* fd, const void* buf, PRInt32 amount,
op.result.code = 0; /* initialize the number sent */
op.function = pt_sendto_cont;
op.event = POLLOUT | POLLPRI;
- bytes = pt_Continue(&op);
+ netResult = pt_Continue(&op);
+ if (netResult >= 0) {
+ bytes = netResult;
+ }
syserrno = op.syserrno;
}
- if (bytes < 0) {
+ if (netResult < 0) {
pt_MapError(_PR_MD_MAP_SENDTO_ERROR, syserrno);
+ return -1;
}
return bytes;
-# else /* !HAS_CONNECTX */
+# else /* !(defined(LINUX) || HAS_CONNECTX) */
PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0);
return -1;
# endif
@@ -3273,7 +3102,7 @@ static PRIOMethods _pr_socketpollfd_methods = {
(PRReservedFN)_PR_InvalidInt,
(PRReservedFN)_PR_InvalidInt};
-# if defined(HPUX) || defined(SOLARIS) || defined(LINUX) || \
+# if defined(SOLARIS) || defined(LINUX) || \
defined(__GNU__) || defined(__GLIBC__) || defined(AIX) || \
defined(FREEBSD) || defined(NETBSD) || defined(OPENBSD) || \
defined(NTO) || defined(DARWIN) || defined(RISCOS)
@@ -3306,14 +3135,7 @@ static void pt_MakeFdNonblock(PRIntn osfd) {
* Other platforms just use the generic pt_MakeFdNonblock
* to put a socket in non-blocking mode.
*/
-# ifdef HPUX
-static void pt_MakeSocketNonblock(PRIntn osfd) {
- PRIntn one = 1;
- (void)ioctl(osfd, FIOSNBIO, &one);
-}
-# else
# define pt_MakeSocketNonblock pt_MakeFdNonblock
-# endif
static PRFileDesc* pt_SetMethods(PRIntn osfd, PRDescType type,
PRBool isAcceptedSocket, PRBool imported) {
@@ -4005,265 +3827,10 @@ static PRInt32 _pr_poll_with_poll(PRPollDesc* pds, PRIntn npds,
} /* _pr_poll_with_poll */
-# if defined(_PR_POLL_WITH_SELECT)
-/*
- * HPUX report the POLLHUP event for a socket when the
- * shutdown(SHUT_WR) operation is called for the remote end, even though
- * the socket is still writeable. Use select(), instead of poll(), to
- * workaround this problem.
- */
-static PRInt32 _pr_poll_with_select(PRPollDesc* pds, PRIntn npds,
- PRIntervalTime timeout) {
- PRInt32 ready = 0;
- /*
- * For restarting select() if it is interrupted by a signal.
- * We use these variables to figure out how much time has
- * elapsed and how much of the timeout still remains.
- */
- PRIntervalTime start = 0, elapsed, remaining;
-
- if (pt_TestAbort()) {
- return -1;
- }
-
- if (0 == npds) {
- PR_Sleep(timeout);
- } else {
-# define STACK_POLL_DESC_COUNT 64
- int stack_selectfd[STACK_POLL_DESC_COUNT];
- int* selectfd;
- fd_set rd, wr, ex, *rdp = NULL, *wrp = NULL, *exp = NULL;
- struct timeval tv, *tvp;
- PRIntn index, msecs, maxfd = 0;
-
- if (npds <= STACK_POLL_DESC_COUNT) {
- selectfd = stack_selectfd;
- } else {
- PRThread* me = PR_GetCurrentThread();
- if (npds > me->selectfd_count) {
- PR_Free(me->selectfd_list);
- me->selectfd_list = (int*)PR_MALLOC(npds * sizeof(int));
- if (NULL == me->selectfd_list) {
- me->selectfd_count = 0;
- PR_SetError(PR_OUT_OF_MEMORY_ERROR, 0);
- return -1;
- }
- me->selectfd_count = npds;
- }
- selectfd = me->selectfd_list;
- }
- FD_ZERO(&rd);
- FD_ZERO(&wr);
- FD_ZERO(&ex);
-
- for (index = 0; index < npds; ++index) {
- PRInt16 in_flags_read = 0, in_flags_write = 0;
- PRInt16 out_flags_read = 0, out_flags_write = 0;
-
- if ((NULL != pds[index].fd) && (0 != pds[index].in_flags)) {
- if (pds[index].in_flags & PR_POLL_READ) {
- in_flags_read = (pds[index].fd->methods->poll)(
- pds[index].fd, pds[index].in_flags & ~PR_POLL_WRITE,
- &out_flags_read);
- }
- if (pds[index].in_flags & PR_POLL_WRITE) {
- in_flags_write = (pds[index].fd->methods->poll)(
- pds[index].fd, pds[index].in_flags & ~PR_POLL_READ,
- &out_flags_write);
- }
- if ((0 != (in_flags_read & out_flags_read)) ||
- (0 != (in_flags_write & out_flags_write))) {
- /* this one is ready right now */
- if (0 == ready) {
- /*
- * We will return without calling the system
- * poll function. So zero the out_flags
- * fields of all the poll descriptors before
- * this one.
- */
- int i;
- for (i = 0; i < index; i++) {
- pds[i].out_flags = 0;
- }
- }
- ready += 1;
- pds[index].out_flags = out_flags_read | out_flags_write;
- } else {
- /* now locate the NSPR layer at the bottom of the stack */
- PRFileDesc* bottom =
- PR_GetIdentitiesLayer(pds[index].fd, PR_NSPR_IO_LAYER);
- /* ignore a socket without PR_NSPR_IO_LAYER available */
-
- pds[index].out_flags = 0; /* pre-condition */
- if ((NULL != bottom) &&
- (_PR_FILEDESC_OPEN == bottom->secret->state)) {
- if (0 == ready) {
- PRBool add_to_rd = PR_FALSE;
- PRBool add_to_wr = PR_FALSE;
- PRBool add_to_ex = PR_FALSE;
-
- selectfd[index] = bottom->secret->md.osfd;
- if (in_flags_read & PR_POLL_READ) {
- pds[index].out_flags |= _PR_POLL_READ_SYS_READ;
- add_to_rd = PR_TRUE;
- }
- if (in_flags_read & PR_POLL_WRITE) {
- pds[index].out_flags |= _PR_POLL_READ_SYS_WRITE;
- add_to_wr = PR_TRUE;
- }
- if (in_flags_write & PR_POLL_READ) {
- pds[index].out_flags |= _PR_POLL_WRITE_SYS_READ;
- add_to_rd = PR_TRUE;
- }
- if (in_flags_write & PR_POLL_WRITE) {
- pds[index].out_flags |= _PR_POLL_WRITE_SYS_WRITE;
- add_to_wr = PR_TRUE;
- }
- if (pds[index].in_flags & PR_POLL_EXCEPT) {
- add_to_ex = PR_TRUE;
- }
- if ((selectfd[index] > maxfd) &&
- (add_to_rd || add_to_wr || add_to_ex)) {
- maxfd = selectfd[index];
- /*
- * If maxfd is too large to be used with
- * select, fall back to calling poll.
- */
- if (maxfd >= FD_SETSIZE) {
- break;
- }
- }
- if (add_to_rd) {
- FD_SET(bottom->secret->md.osfd, &rd);
- rdp = &rd;
- }
- if (add_to_wr) {
- FD_SET(bottom->secret->md.osfd, &wr);
- wrp = ≀
- }
- if (add_to_ex) {
- FD_SET(bottom->secret->md.osfd, &ex);
- exp = &ex;
- }
- }
- } else {
- if (0 == ready) {
- int i;
- for (i = 0; i < index; i++) {
- pds[i].out_flags = 0;
- }
- }
- ready += 1; /* this will cause an abrupt return */
- pds[index].out_flags = PR_POLL_NVAL; /* bogii */
- }
- }
- } else {
- pds[index].out_flags = 0;
- }
- }
- if (0 == ready) {
- if (maxfd >= FD_SETSIZE) {
- /*
- * maxfd too large to be used with select, fall back to
- * calling poll
- */
- return (_pr_poll_with_poll(pds, npds, timeout));
- }
- switch (timeout) {
- case PR_INTERVAL_NO_WAIT:
- tv.tv_sec = 0;
- tv.tv_usec = 0;
- tvp = &tv;
- break;
- case PR_INTERVAL_NO_TIMEOUT:
- tvp = NULL;
- break;
- default:
- msecs = PR_IntervalToMilliseconds(timeout);
- tv.tv_sec = msecs / PR_MSEC_PER_SEC;
- tv.tv_usec = (msecs % PR_MSEC_PER_SEC) * PR_USEC_PER_MSEC;
- tvp = &tv;
- start = PR_IntervalNow();
- }
-
- retry:
- ready = select(maxfd + 1, rdp, wrp, exp, tvp);
- if (-1 == ready) {
- PRIntn oserror = errno;
-
- if ((EINTR == oserror) || (EAGAIN == oserror)) {
- if (timeout == PR_INTERVAL_NO_TIMEOUT) {
- goto retry;
- } else if (timeout == PR_INTERVAL_NO_WAIT) {
- ready = 0; /* don't retry, just time out */
- } else {
- elapsed = (PRIntervalTime)(PR_IntervalNow() - start);
- if (elapsed > timeout) {
- ready = 0; /* timed out */
- } else {
- remaining = timeout - elapsed;
- msecs = PR_IntervalToMilliseconds(remaining);
- tv.tv_sec = msecs / PR_MSEC_PER_SEC;
- tv.tv_usec = (msecs % PR_MSEC_PER_SEC) * PR_USEC_PER_MSEC;
- goto retry;
- }
- }
- } else if (EBADF == oserror) {
- /* find all the bad fds */
- ready = 0;
- for (index = 0; index < npds; ++index) {
- pds[index].out_flags = 0;
- if ((NULL != pds[index].fd) && (0 != pds[index].in_flags)) {
- if (fcntl(selectfd[index], F_GETFL, 0) == -1) {
- pds[index].out_flags = PR_POLL_NVAL;
- ready++;
- }
- }
- }
- } else {
- _PR_MD_MAP_SELECT_ERROR(oserror);
- }
- } else if (ready > 0) {
- for (index = 0; index < npds; ++index) {
- PRInt16 out_flags = 0;
- if ((NULL != pds[index].fd) && (0 != pds[index].in_flags)) {
- if (FD_ISSET(selectfd[index], &rd)) {
- if (pds[index].out_flags & _PR_POLL_READ_SYS_READ) {
- out_flags |= PR_POLL_READ;
- }
- if (pds[index].out_flags & _PR_POLL_WRITE_SYS_READ) {
- out_flags |= PR_POLL_WRITE;
- }
- }
- if (FD_ISSET(selectfd[index], &wr)) {
- if (pds[index].out_flags & _PR_POLL_READ_SYS_WRITE) {
- out_flags |= PR_POLL_READ;
- }
- if (pds[index].out_flags & _PR_POLL_WRITE_SYS_WRITE) {
- out_flags |= PR_POLL_WRITE;
- }
- }
- if (FD_ISSET(selectfd[index], &ex)) {
- out_flags |= PR_POLL_EXCEPT;
- }
- }
- pds[index].out_flags = out_flags;
- }
- }
- }
- }
- return ready;
-
-} /* _pr_poll_with_select */
-# endif /* _PR_POLL_WITH_SELECT */
PR_IMPLEMENT(PRInt32)
PR_Poll(PRPollDesc* pds, PRIntn npds, PRIntervalTime timeout) {
-# if defined(_PR_POLL_WITH_SELECT)
- return (_pr_poll_with_select(pds, npds, timeout));
-# else
return (_pr_poll_with_poll(pds, npds, timeout));
-# endif
}
PR_IMPLEMENT(PRDirEntry*) PR_ReadDir(PRDir* dir, PRDirFlags flags) {
@@ -4735,7 +4302,7 @@ PR_IMPLEMENT(PRInt32) PR_FD_NISSET(PRInt32 fd, PR_fd_set* set) {
# include <sys/types.h>
# include <sys/time.h>
-# if !defined(HPUX) && !defined(LINUX) && !defined(__GNU__) && \
+# if !defined(LINUX) && !defined(__GNU__) && \
!defined(__GLIBC__)
# include <sys/select.h>
# endif
diff --git a/nsprpub/pr/src/pthreads/ptsynch.c b/nsprpub/pr/src/pthreads/ptsynch.c
@@ -792,12 +792,7 @@ PR_OpenSemaphore(const char* name, PRIntn flags, PRIntn mode, PRUintn value) {
}
sem->sem = sem_open(osname, oflag, mode, value);
} else {
-# ifdef HPUX
- /* Pass 0 as the mode and value arguments to work around a bug. */
- sem->sem = sem_open(osname, 0, 0, 0);
-# else
sem->sem = sem_open(osname, 0);
-# endif
}
if ((sem_t*)-1 == sem->sem) {
_PR_MD_MAP_DEFAULT_ERROR(errno);
diff --git a/nsprpub/pr/src/pthreads/ptthread.c b/nsprpub/pr/src/pthreads/ptthread.c
@@ -820,11 +820,6 @@ static void _pt_thread_death_internal(void* arg, PRBool callDestructors) {
if (NULL != thred->syspoll_list) {
PR_Free(thred->syspoll_list);
}
-# if defined(_PR_POLL_WITH_SELECT)
- if (NULL != thred->selectfd_list) {
- PR_Free(thred->selectfd_list);
- }
-# endif
# if defined(DEBUG)
memset(thred, 0xaf, sizeof(PRThread));
# endif /* defined(DEBUG) */
@@ -957,41 +952,6 @@ static void _PR_Fini(void) __attribute__((destructor));
*/
# pragma fini(_PR_Fini)
static void _PR_Fini(void);
-# elif defined(HPUX)
-/*
- * Current versions of HP C compiler define __HP_cc.
- * HP C compiler A.11.01.20 doesn't define __HP_cc.
- */
-# if defined(__ia64) || defined(_LP64)
-# pragma FINI "_PR_Fini"
-static void _PR_Fini(void);
-# else
-/*
- * Only HP-UX 10.x style initializers are supported in 32-bit links.
- * Need to use the +I PR_HPUX10xInit linker option.
- */
-# include <dl.h>
-
-static void _PR_Fini(void);
-
-void PR_HPUX10xInit(shl_t handle, int loading) {
- /*
- * This function is called when a shared library is loaded as well
- * as when the shared library is unloaded. Note that it may not
- * be called when the user's program terminates.
- *
- * handle is the shl_load API handle for the shared library being
- * initialized.
- *
- * loading is non-zero at startup and zero at termination.
- */
- if (loading) {
- /* ... do some initializations ... */
- } else {
- _PR_Fini();
- }
-}
-# endif
# elif defined(AIX)
/* Need to use the -binitfini::_PR_Fini linker option. */
# endif
diff --git a/nsprpub/pr/src/threads/prrwlock.c b/nsprpub/pr/src/threads/prrwlock.c
@@ -7,18 +7,7 @@
#include <string.h>
-#if defined(HPUX) && defined(_PR_PTHREADS)
-
-# include <pthread.h>
-# define HAVE_UNIX98_RWLOCK
-# define RWLOCK_T pthread_rwlock_t
-# define RWLOCK_INIT(lock) pthread_rwlock_init(lock, NULL)
-# define RWLOCK_DESTROY(lock) pthread_rwlock_destroy(lock)
-# define RWLOCK_RDLOCK(lock) pthread_rwlock_rdlock(lock)
-# define RWLOCK_WRLOCK(lock) pthread_rwlock_wrlock(lock)
-# define RWLOCK_UNLOCK(lock) pthread_rwlock_unlock(lock)
-
-#elif defined(SOLARIS) && \
+#if defined(SOLARIS) && \
(defined(_PR_PTHREADS) || defined(_PR_GLOBAL_THREADS_ONLY))
# include <synch.h>
diff --git a/nsprpub/pr/tests/vercheck.c b/nsprpub/pr/tests/vercheck.c
@@ -38,6 +38,7 @@ static char* compatible_version[] = {
"4.16", "4.17", "4.18", "4.19", "4.20", "4.21", "4.22",
"4.23", "4.24", "4.25", "4,26", "4.27", "4.28", "4.29",
"4.30", "4.31", "4.32", "4.33", "4.34", "4.35", "4.36",
+ "4.37",
PR_VERSION};
/*
@@ -49,8 +50,8 @@ static char* compatible_version[] = {
*/
static char* incompatible_version[] = {
"2.1 19980529", "3.0", "3.0.1", "3.1", "3.1.1",
- "3.1.2", "3.1.3", "3.5", "3.5.1", "4.37.1",
- "4.38", "4.38.1", "10.0", "11.1", "12.14.20"};
+ "3.1.2", "3.1.3", "3.5", "3.5.1", "4.38.1",
+ "4.39", "4.39.1", "10.0", "11.1", "12.14.20"};
int main(int argc, char** argv) {
int idx;