From e348f4ebe2235391ebc401defa8ed2a5acbefee4 Mon Sep 17 00:00:00 2001 From: cvs2hg Date: Sat, 27 Jul 2002 00:56:34 +0000 Subject: fixup commit for branch 'UNINSTALL_WORK_BRANCH' --- Makefile.in | 6 +- admin/repackage.sh | 20 +- build/autoconf/config.guess | 141 +- build/autoconf/config.sub | 153 +- build/cygwin-wrapper | 17 + config/Linux.mk | 12 +- config/Makefile.in | 2 +- config/autoconf.mk.in | 1 + config/prdepend.h | 1 + config/rules.mk | 2 +- configure | 388 +- configure.in | 118 +- lib/ds/plarena.c | 2 +- lib/libc/src/base64.c | 2 +- macbuild/NSPR.Debug.Prefix | 1 - macbuild/NSPR.Prefix | 11 +- macbuild/NSPR20.toc | 69 - macbuild/NSPR20PPC.mcp | Bin 163973 -> 0 bytes macbuild/NSPR20PPC.xml | 8232 ++++++++++++++++++++++++++++++++++++++ macbuild/NSPRCarbon.Prefix | 7 +- macbuild/NSPRCarbonDebug.Prefix | 10 +- macbuild/NSPRConfig.h | 1 - macbuild/NSPRDebug.Prefix | 7 +- pr/include/md/_aix.h | 2 + pr/include/md/_aix32.cfg | 3 + pr/include/md/_aix32in6.cfg | 142 - pr/include/md/_beos.h | 16 +- pr/include/md/_darwin.cfg | 4 - pr/include/md/_freebsd.cfg | 9 +- pr/include/md/_freebsd.h | 24 +- pr/include/md/_hpux.h | 4 + pr/include/md/_hpux64.cfg | 4 +- pr/include/md/_linux.h | 2 + pr/include/md/_macos.h | 76 +- pr/include/md/_nto.h | 2 + pr/include/md/_openvms.h | 1 + pr/include/md/_os2.h | 65 +- pr/include/md/_os2_errors.h | 10 +- pr/include/md/_pth.h | 27 +- pr/include/md/_solaris.h | 2 + pr/include/md/_unixos.h | 3 + pr/include/md/_win16.h | 7 - pr/include/md/_win95.h | 2 +- pr/include/obsolete/Makefile.in | 2 +- pr/include/prinet.h | 2 +- pr/include/prinit.h | 6 +- pr/include/prio.h | 2 +- pr/include/private/Makefile.in | 2 +- pr/include/private/primpl.h | 14 +- pr/include/prtypes.h | 4 +- pr/src/io/prfdcach.c | 4 +- pr/src/io/prfile.c | 18 +- pr/src/io/prio.c | 2 +- pr/src/io/priometh.c | 10 +- pr/src/io/prlayer.c | 4 +- pr/src/io/prlog.c | 9 +- pr/src/io/prmapopt.c | 6 +- pr/src/io/prmwait.c | 39 +- pr/src/io/prsocket.c | 106 +- pr/src/linking/prlink.c | 43 +- pr/src/malloc/prmem.c | 74 +- pr/src/md/beos/bfile.c | 419 +- pr/src/md/beos/bmisc.c | 7 + pr/src/md/beos/bnet.c | 773 ++-- pr/src/md/beos/bproc.c | 184 +- pr/src/md/mac/macdll.c | 106 +- pr/src/md/mac/macio.c | 15 +- pr/src/md/mac/macsocket.h | 1 + pr/src/md/mac/macsockotpt.c | 341 +- pr/src/md/mac/macthr.c | 170 +- pr/src/md/mac/mdcriticalregion.c | 1 + pr/src/md/mac/mdmac.c | 5 + pr/src/md/os2/os2_errors.c | 125 +- pr/src/md/os2/os2cv.c | 108 +- pr/src/md/os2/os2inrval.c | 43 +- pr/src/md/os2/os2io.c | 6 + pr/src/md/os2/os2misc.c | 344 +- pr/src/md/os2/os2poll.c | 266 +- pr/src/md/os2/os2sock.c | 1020 ++--- pr/src/md/os2/os2thred.c | 10 +- pr/src/md/os2/os2vacpp.asm | 199 +- pr/src/md/unix/darwin.c | 27 - pr/src/md/unix/irix.c | 8 +- pr/src/md/unix/unix.c | 50 +- pr/src/md/unix/unix_errors.c | 7 + pr/src/md/unix/uxproces.c | 2 +- pr/src/md/unix/uxrng.c | 19 +- pr/src/md/unix/uxshm.c | 5 +- pr/src/md/windows/Makefile.in | 8 + pr/src/md/windows/ntthread.c | 7 + pr/src/md/windows/w95sock.c | 26 +- pr/src/md/windows/w95thred.c | 8 +- pr/src/misc/pralarm.c | 2 +- pr/src/misc/prdtoa.c | 10 + pr/src/misc/prenv.c | 2 +- pr/src/misc/prerr.c | 2 +- pr/src/misc/prerror.c | 4 +- pr/src/misc/prinit.c | 26 +- pr/src/misc/prinrval.c | 4 +- pr/src/misc/prnetdb.c | 222 +- pr/src/misc/prsystem.c | 14 +- pr/src/misc/prtime.c | 46 +- pr/src/misc/prtpool.c | 4 +- pr/src/pthreads/Makefile.in | 5 + pr/src/pthreads/ptio.c | 293 +- pr/src/pthreads/ptsynch.c | 9 +- pr/src/pthreads/ptthread.c | 31 +- pr/src/threads/combined/prucpu.c | 173 +- pr/src/threads/combined/pruthr.c | 1 - pr/src/threads/prtpd.c | 2 +- pr/tests/Makefile.in | 12 +- pr/tests/affinity.c | 10 + pr/tests/sigpipe.c | 26 +- pr/tests/vercheck.c | 8 +- 114 files changed, 12545 insertions(+), 2626 deletions(-) create mode 100755 build/cygwin-wrapper delete mode 100644 macbuild/NSPR.Debug.Prefix delete mode 100644 macbuild/NSPR20.toc delete mode 100644 macbuild/NSPR20PPC.mcp create mode 100644 macbuild/NSPR20PPC.xml delete mode 100644 pr/include/md/_aix32in6.cfg diff --git a/Makefile.in b/Makefile.in index ac081b6b..ca5b0fc1 100644 --- a/Makefile.in +++ b/Makefile.in @@ -41,6 +41,8 @@ VPATH = @srcdir@ include $(MOD_DEPTH)/config/autoconf.mk +MAKE := $(patsubst -j%,,$(MAKE)) -j1 + DIRS = config pr lib ifdef MOZILLA_CLIENT @@ -108,12 +110,12 @@ ifeq ($(OS_ARCH),WINNT) @if test ! -d $(MDIST)/$(MOD_NAME)/$(BUILD_NUMBER); then \ rm -rf $(MDIST)/$(MOD_NAME)/$(BUILD_NUMBER); \ echo "making directory $(MDIST)/$(MOD_NAME)/$(BUILD_NUMBER)"; \ - config/prmkdir.bat $(MDIST_DOS)\\$(MOD_NAME)\\$(BUILD_NUMBER); \ + $(topsrcdir)/config/prmkdir.bat $(MDIST_DOS)\\$(MOD_NAME)\\$(BUILD_NUMBER); \ fi @if test ! -d $(MDIST)/$(MOD_NAME)/$(BUILD_NUMBER)/$(RELEASE_OBJDIR_NAME); then \ rm -rf $(MDIST)/$(MOD_NAME)/$(BUILD_NUMBER)/$(RELEASE_OBJDIR_NAME); \ echo "making directory $(MDIST)/$(MOD_NAME)/$(BUILD_NUMBER)/$(RELEASE_OBJDIR_NAME)"; \ - config/prmkdir.bat $(MDIST_DOS)\\$(MOD_NAME)\\$(BUILD_NUMBER)\\$(RELEASE_OBJDIR_NAME); \ + $(topsrcdir)/config/prmkdir.bat $(MDIST_DOS)\\$(MOD_NAME)\\$(BUILD_NUMBER)\\$(RELEASE_OBJDIR_NAME); \ fi else @if test ! -d $(MDIST)/$(MOD_NAME)/$(BUILD_NUMBER); then \ diff --git a/admin/repackage.sh b/admin/repackage.sh index 2a705c49..fb2a464a 100755 --- a/admin/repackage.sh +++ b/admin/repackage.sh @@ -60,10 +60,10 @@ # # These variables should be modified for each NSPR release. # -FROMTOP=/share/builds/components/nspr20/v4.1.1 -TOTOP=./v4.1.1 -NSPRDIR=nspr-4.1.1 -SOURCETAG=NSPRPUB_RELEASE_4_1_1 +FROMTOP=/share/builds/components/nspr20/v4.2 +TOTOP=./v4.2 +NSPRDIR=nspr-4.2 +SOURCETAG=NSPR_4_2_RELEASE # # enumerate Unix object directories on /s/b/c @@ -80,12 +80,16 @@ IRIX6.5_n32_PTH_DBG.OBJ IRIX6.5_n32_PTH_OPT.OBJ Linux2.2_x86_glibc_PTH_DBG.OBJ Linux2.2_x86_glibc_PTH_OPT.OBJ -OSF1V4.0D_DBG.OBJ -OSF1V4.0D_OPT.OBJ +Linux2.4_x86_glibc_PTH_DBG.OBJ +Linux2.4_x86_glibc_PTH_OPT.OBJ +OSF1V5.0_DBG.OBJ +OSF1V5.0_OPT.OBJ SunOS5.6_DBG.OBJ SunOS5.6_OPT.OBJ -SunOS5.7_64_DBG.OBJ -SunOS5.7_64_OPT.OBJ +SunOS5.8_64_DBG.OBJ +SunOS5.8_64_OPT.OBJ +SunOS5.8_DBG.OBJ +SunOS5.8_OPT.OBJ " # # enumerate Windows object directories on /s/b/c diff --git a/build/autoconf/config.guess b/build/autoconf/config.guess index 627c6158..a903c1da 100755 --- a/build/autoconf/config.guess +++ b/build/autoconf/config.guess @@ -1,9 +1,9 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 -# Free Software Foundation, Inc. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002 Free Software Foundation, Inc. -timestamp='2001-10-05' +timestamp='2002-03-20' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -24,7 +24,7 @@ timestamp='2001-10-05' # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. -# Originally written by Per Bothner . +# Originally written by Per Bothner . # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # @@ -98,7 +98,7 @@ trap 'rm -f $dummy.c $dummy.o $dummy.rel $dummy; exit 1' 1 2 15 set_cc_for_build='case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int dummy(){}" > $dummy.c ; - for c in cc gcc c89 ; do + for c in cc gcc c89 c99 ; do ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ; if test $? = 0 ; then CC_FOR_BUILD="$c"; break ; @@ -135,23 +135,22 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. - # Determine the machine/vendor (is the vendor relevant). - case "${UNAME_MACHINE}" in - amiga) machine=m68k-unknown ;; - arm32) machine=arm-unknown ;; - atari*) machine=m68k-atari ;; - sun3*) machine=m68k-sun ;; - mac68k) machine=m68k-apple ;; - macppc) machine=powerpc-apple ;; - hp3[0-9][05]) machine=m68k-hp ;; - ibmrt|romp-ibm) machine=romp-ibm ;; - sparc*) machine=`uname -p`-unknown ;; - *) machine=${UNAME_MACHINE}-unknown ;; + # + # Note: NetBSD doesn't particularly care about the vendor + # portion of the name. We always set it to "unknown". + sysctl="sysctl -n hw.machine_arch" + UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ + /usr/sbin/$sysctl 2>/dev/null || echo unknown)` + case "${UNAME_MACHINE_ARCH}" in + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; + sh3eb) machine=sh-unknown ;; + *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. - case "${UNAME_MACHINE}" in - i386|sparc|amiga|arm*|hp300|mvme68k|vax|atari|luna68k|mac68k|news68k|next68k|pc532|sun3*|x68k) + case "${UNAME_MACHINE_ARCH}" in + arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep __ELF__ >/dev/null @@ -291,6 +290,9 @@ EOF *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit 0 ;; + *:[Mm]orph[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-morphos + exit 0 ;; *:OS/390:*:*) echo i370-ibm-openedition exit 0 ;; @@ -339,7 +341,7 @@ EOF echo m68k-sun-sunos${UNAME_RELEASE} exit 0 ;; sun*:*:4.2BSD:*) - UNAME_RELEASE=`(head -1 /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) @@ -508,7 +510,7 @@ EOF fi exit 0 ;; *:AIX:*:[45]) - IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'` + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else @@ -682,9 +684,6 @@ EOF C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit 0 ;; - CRAY*X-MP:*:*:*) - echo xmp-cray-unicos - exit 0 ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; @@ -706,9 +705,6 @@ EOF CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; - CRAY-2:*:*:*) - echo cray2-cray-unicos - exit 0 ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` @@ -746,6 +742,9 @@ EOF i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit 0 ;; + x86:Interix*:3*) + echo i386-pc-interix3 + exit 0 ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we @@ -771,16 +770,30 @@ EOF echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; ia64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux + echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; mips:Linux:*:*) - case `sed -n '/^byte/s/^.*: \(.*\) endian/\1/p' < /proc/cpuinfo` in - big) echo mips-unknown-linux-gnu && exit 0 ;; - little) echo mipsel-unknown-linux-gnu && exit 0 ;; - esac + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef mips + #undef mipsel + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=mipsel + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=mips + #else + CPU= + #endif + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` + rm -f $dummy.c + test x"${CPU}" != x && echo "${CPU}-pc-linux-gnu" && exit 0 ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu @@ -829,7 +842,8 @@ EOF # The BFD linker knows what the default object file format is, so # first see if it will tell us. cd to the root directory to prevent # problems with other programs or directories called `ld' in the path. - ld_supported_targets=`cd /; ld --help 2>&1 \ + # Set LC_ALL=C to ensure ld outputs messages in English. + ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ | sed -ne '/supported targets:/!d s/[ ][ ]*/ /g s/.*supported targets: *// @@ -853,32 +867,29 @@ EOF esac # Determine whether the default compiler is a.out or elf eval $set_cc_for_build - cat >$dummy.c < -#ifdef __cplusplus -#include /* for printf() prototype */ - int main (int argc, char *argv[]) { -#else - int main (argc, argv) int argc; char *argv[]; { -#endif -#ifdef __ELF__ -# ifdef __GLIBC__ -# if __GLIBC__ >= 2 - printf ("%s-pc-linux-gnu\n", argv[1]); -# else - printf ("%s-pc-linux-gnulibc1\n", argv[1]); -# endif -# else - printf ("%s-pc-linux-gnulibc1\n", argv[1]); -# endif -#else - printf ("%s-pc-linux-gnuaout\n", argv[1]); -#endif - return 0; -} + sed 's/^ //' << EOF >$dummy.c + #include + #ifdef __ELF__ + # ifdef __GLIBC__ + # if __GLIBC__ >= 2 + LIBC=gnu + # else + LIBC=gnulibc1 + # endif + # else + LIBC=gnulibc1 + # endif + #else + #ifdef __INTEL_COMPILER + LIBC=gnu + #else + LIBC=gnuaout + #endif + #endif EOF - $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm -f $dummy.c $dummy && exit 0 - rm -f $dummy.c $dummy + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` + rm -f $dummy.c + test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0 test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 ;; i*86:DYNIX/ptx:4*:*) @@ -957,7 +968,7 @@ EOF exit 0 ;; M68*:*:R3V[567]*:*) test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; - 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0) + 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` @@ -1068,15 +1079,17 @@ EOF echo `uname -p`-apple-darwin${UNAME_RELEASE} exit 0 ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) - if test "${UNAME_MACHINE}" = "x86pc"; then + UNAME_PROCESSOR=`uname -p` + if test "$UNAME_PROCESSOR" = "x86"; then + UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi - echo `uname -p`-${UNAME_MACHINE}-nto-qnx + echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit 0 ;; *:QNX:*:4*) echo i386-pc-qnx exit 0 ;; - NSR-[KW]:NONSTOP_KERNEL:*:*) + NSR-[GKLNPTVW]:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit 0 ;; *:NonStop-UX:*:*) @@ -1100,7 +1113,9 @@ EOF echo ${UNAME_MACHINE}-unknown-plan9 exit 0 ;; i*86:OS/2:*:*) - echo ${UNAME_MACHINE}-pc-os2-emx + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + echo ${UNAME_MACHINE}-pc-os2-emx exit 0 ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 diff --git a/build/autoconf/config.sub b/build/autoconf/config.sub index 0cee56fb..e3d3d3ca 100755 --- a/build/autoconf/config.sub +++ b/build/autoconf/config.sub @@ -1,9 +1,9 @@ #! /bin/sh # Configuration validation subroutine script. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 -# Free Software Foundation, Inc. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002 Free Software Foundation, Inc. -timestamp='2001-10-05' +timestamp='2002-04-26' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -118,7 +118,7 @@ esac # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in - nto-qnx* | linux-gnu* | storm-chaos* | os2-emx* | windows32-*) + nto-qnx* | linux-gnu* | storm-chaos* | os2-emx* | windows32-* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; @@ -224,9 +224,13 @@ esac case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. +#### MozillaHack +# mips*el +#### End MozillaHack 1750a | 580 \ | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ | c4x | clipper \ | d10v | d30v | dsp16xx \ @@ -234,25 +238,24 @@ case $basic_machine in | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | m32r | m68000 | m68k | m88k | mcore \ - | mips16 | mips64 | mips64el | mips64orion | mips64orionel \ + | mips | mips16 | mips64 | mips64el | mips64orion | mips64orionel \ | mips64vr4100 | mips64vr4100el | mips64vr4300 \ | mips64vr4300el | mips64vr5000 | mips64vr5000el \ | mipsbe | mipseb | mips*el | mipsle | mipstx39 | mipstx39el \ - | mipsisa32 \ + | mipsisa32 | mipsisa64 \ | mn10200 | mn10300 \ | ns16k | ns32k \ - | openrisc \ + | openrisc | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ - | s390 | s390x \ - | sh | sh[34] | sh[34]eb | shbe | shle \ - | sparc | sparc64 | sparclet | sparclite | sparcv9 | sparcv9b \ - | stormy16 | strongarm \ + | sh | sh[34] | sh[34]eb | shbe | shle | sh64 \ + | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \ + | strongarm \ | tahoe | thumb | tic80 | tron \ - | v850 \ + | v850 | v850e \ | we32k \ - | x86 | xscale \ + | x86 | xscale | xstormy16 | xtensa \ | z8k) basic_machine=$basic_machine-unknown ;; @@ -276,15 +279,19 @@ case $basic_machine in exit 1 ;; # Recognize the basic CPU types with company name. +#### MozillaHack +# mips*el +#### End MozillaHack 580-* \ | a29k-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ - | alphapca5[67]-* | arc-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armv*-* \ | avr-* \ | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c54x-* \ - | clipper-* | cray2-* | cydra-* \ + | clipper-* | cydra-* \ | d10v-* | d30v-* \ | elxsi-* \ | f30[01]-* | f700-* | fr30-* | fx80-* \ @@ -292,7 +299,7 @@ case $basic_machine in | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | m32r-* \ - | m68000-* | m680[01234]0-* | m68360-* | m683?2-* | m68k-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | mcore-* \ | mips-* | mips16-* | mips64-* | mips64el-* | mips64orion-* \ | mips64orionel-* | mips64vr4100-* | mips64vr4100el-* \ @@ -304,14 +311,14 @@ case $basic_machine in | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ - | s390-* | s390x-* \ - | sh-* | sh[34]-* | sh[34]eb-* | shbe-* | shle-* \ - | sparc-* | sparc64-* | sparc86x-* | sparclite-* \ - | sparcv9-* | sparcv9b-* | stormy16-* | strongarm-* | sv1-* \ - | t3e-* | tahoe-* | thumb-* | tic30-* | tic54x-* | tic80-* | tron-* \ - | v850-* | vax-* \ + | sh-* | sh[34]-* | sh[34]eb-* | shbe-* | shle-* | sh64-* \ + | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \ + | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ + | tahoe-* | thumb-* | tic30-* | tic54x-* | tic80-* | tron-* \ + | v850-* | v850e-* | vax-* \ | we32k-* \ - | x86-* | x86_64-* | xmp-* | xps100-* | xscale-* \ + | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \ + | xtensa-* \ | ymp-* \ | z8k-*) ;; @@ -376,6 +383,10 @@ case $basic_machine in basic_machine=ns32k-sequent os=-dynix ;; + c90) + basic_machine=c90-cray + os=-unicos + ;; convex-c1) basic_machine=c1-convex os=-bsd @@ -396,16 +407,8 @@ case $basic_machine in basic_machine=c38-convex os=-bsd ;; - cray | ymp) - basic_machine=ymp-cray - os=-unicos - ;; - cray2) - basic_machine=cray2-cray - os=-unicos - ;; - [cjt]90) - basic_machine=${basic_machine}-cray + cray | j90) + basic_machine=j90-cray os=-unicos ;; crds | unos) @@ -420,6 +423,14 @@ case $basic_machine in decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; + decsystem10* | dec10*) + basic_machine=pdp10-dec + os=-tops10 + ;; + decsystem20* | dec20*) + basic_machine=pdp10-dec + os=-tops20 + ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola @@ -610,14 +621,6 @@ case $basic_machine in basic_machine=m68k-atari os=-mint ;; - mipsel*-linux*) - basic_machine=mipsel-unknown - os=-linux-gnu - ;; - mips*-linux*) - basic_machine=mips-unknown - os=-linux-gnu - ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; @@ -632,6 +635,10 @@ case $basic_machine in basic_machine=m68k-rom68k os=-coff ;; + morphos) + basic_machine=powerpc-unknown + os=-morphos + ;; msdos) basic_machine=i386-pc os=-msdos @@ -711,6 +718,10 @@ case $basic_machine in basic_machine=hppa1.1-oki os=-proelf ;; + or32 | or32-*) + basic_machine=or32-unknown + os=-coff + ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose @@ -796,6 +807,12 @@ case $basic_machine in rtpc | rtpc-*) basic_machine=romp-ibm ;; + s390 | s390-*) + basic_machine=s390-ibm + ;; + s390x | s390x-*) + basic_machine=s390x-ibm + ;; sa29200) basic_machine=a29k-amd os=-udi @@ -865,7 +882,7 @@ case $basic_machine in sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; - sv1) + sv1) basic_machine=sv1-cray os=-unicos ;; @@ -873,8 +890,16 @@ case $basic_machine in basic_machine=i386-sequent os=-dynix ;; + t3d) + basic_machine=alpha-cray + os=-unicos + ;; t3e) - basic_machine=t3e-cray + basic_machine=alphaev5-cray + os=-unicos + ;; + t90) + basic_machine=t90-cray os=-unicos ;; tic54x | c54x*) @@ -887,6 +912,10 @@ case $basic_machine in tx39el) basic_machine=mipstx39el-unknown ;; + toad1) + basic_machine=pdp10-xkl + os=-tops20 + ;; tower | tower-32) basic_machine=m68k-ncr ;; @@ -937,13 +966,13 @@ case $basic_machine in basic_machine=i386-pc os=-windows32-msvcrt ;; - xmp) - basic_machine=xmp-cray - os=-unicos - ;; xps | xps100) basic_machine=xps100-honeywell ;; + ymp) + basic_machine=ymp-cray + os=-unicos + ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim @@ -964,13 +993,6 @@ case $basic_machine in op60c) basic_machine=hppa1.1-oki ;; - mips) - if [ x$os = x-linux-gnu ]; then - basic_machine=mips-unknown - else - basic_machine=mips-mips - fi - ;; romp) basic_machine=romp-ibm ;; @@ -993,6 +1015,9 @@ case $basic_machine in sh3 | sh4 | sh3eb | sh4eb) basic_machine=sh-unknown ;; + sh64) + basic_machine=sh64-unknown + ;; sparc | sparcv9 | sparcv9b) basic_machine=sparc-sun ;; @@ -1063,6 +1088,9 @@ case $os in # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. +#### MozillaHack +# msvc | mksnt +#### End MozillaHack -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ @@ -1078,10 +1106,11 @@ case $os in | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \ - | -msvc* | -mksnt* \ + | -msvc* | -mksnt* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ - | -os2* | -vos*) + | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ + | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* ) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) @@ -1133,12 +1162,18 @@ case $os in -acis*) os=-aos ;; + -atheos*) + os=-atheos + ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; + -nova*) + os=-rtmk-nova + ;; -ns2 ) os=-nextstep2 ;; @@ -1213,6 +1248,7 @@ case $basic_machine in arm*-semi) os=-aout ;; + # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; @@ -1243,6 +1279,9 @@ case $basic_machine in mips*-*) os=-elf ;; + or32-*) + os=-coff + ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; @@ -1390,7 +1429,7 @@ case $basic_machine in -ptx*) vendor=sequent ;; - -vxsim* | -vxworks*) + -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) diff --git a/build/cygwin-wrapper b/build/cygwin-wrapper new file mode 100755 index 00000000..c510a7d7 --- /dev/null +++ b/build/cygwin-wrapper @@ -0,0 +1,17 @@ +#!/bin/sh +# +# Stupid wrapper to avoid win32 dospath/cygdrive issues +# +prog=$1 +shift +if test -z "$prog"; then + exit 0 +fi +if test "$prog" = "-up"; then + prog=$1 + shift + args=`echo $* | sed -e 's|-I\(.\):|-I/cygdrive/\1|g;'` +else + args=`echo $* | sed -e 's|/cygdrive/\(.\)/|\1:/|g;'` +fi +exec $prog $args diff --git a/config/Linux.mk b/config/Linux.mk index eabdb5b1..66fa6a52 100644 --- a/config/Linux.mk +++ b/config/Linux.mk @@ -81,7 +81,7 @@ RANLIB = ranlib OS_INCLUDES = G++INCLUDES = -I/usr/include/g++ -PLATFORM_FLAGS = -ansi -Wall -pipe -DLINUX -Dlinux +PLATFORM_FLAGS = -ansi -Wall -pipe -DLINUX PORT_FLAGS = -D_POSIX_SOURCE -D_BSD_SOURCE -D_SVID_SOURCE -DHAVE_STRERROR -DHAVE_FCNTL_FILE_LOCKING OS_CFLAGS = $(DSO_CFLAGS) $(PLATFORM_FLAGS) $(PORT_FLAGS) @@ -97,15 +97,7 @@ ifeq ($(CPU_ARCH),x86) PLATFORM_FLAGS += -Di386 endif ifeq ($(CPU_ARCH),m68k) -# -# gcc on Linux/m68k either has a bug or triggers a code-sequence -# bug in the 68060 which causes gcc to crash. The simplest way to -# avoid this is to enable a minimum level of optimization. -# -ifndef BUILD_OPT -OPTIMIZER += -O -endif -PLATFORM_FLAGS += -m68020-40 +PLATFORM_FLAGS += -m68020-60 endif # diff --git a/config/Makefile.in b/config/Makefile.in index 0360255b..eb789134 100644 --- a/config/Makefile.in +++ b/config/Makefile.in @@ -90,7 +90,7 @@ endif ifeq ($(OS_ARCH), HP-UX) ifeq ($(USE_64),1) - XLDOPTS += +DA2.0W + XLDOPTS += +DD64 endif endif diff --git a/config/autoconf.mk.in b/config/autoconf.mk.in index 3a049f60..2784f4f2 100644 --- a/config/autoconf.mk.in +++ b/config/autoconf.mk.in @@ -67,6 +67,7 @@ STRIP = @STRIP@ NSINSTALL = @NSINSTALL@ FILTER = @FILTER@ IMPLIB = @IMPLIB@ +CYGWIN_WRAPPER = @CYGWIN_WRAPPER@ OS_CPPFLAGS = @CPPFLAGS@ OS_CFLAGS = $(OS_CPPFLAGS) @CFLAGS@ $(DSO_CFLAGS) diff --git a/config/prdepend.h b/config/prdepend.h index 8bebd56b..28c1b139 100644 --- a/config/prdepend.h +++ b/config/prdepend.h @@ -39,3 +39,4 @@ */ #error "Do not include this header file." + diff --git a/config/rules.mk b/config/rules.mk index ffd63dfc..29e56a79 100644 --- a/config/rules.mk +++ b/config/rules.mk @@ -206,7 +206,7 @@ ifdef RELEASE_BINS $(NSINSTALL) -t -m 0755 $(RELEASE_BINS) $(DESTDIR)$(bindir) endif ifdef RELEASE_HEADERS - $(NSINSTALL) -t -m 0644 $(RELEASE_HEADERS) $(DESTDIR)$(includedir) + $(NSINSTALL) -t -m 0644 $(RELEASE_HEADERS) $(DESTDIR)$(includedir)/$(include_subdir) endif ifdef RELEASE_LIBS $(NSINSTALL) -t -m 0755 $(RELEASE_LIBS) $(DESTDIR)$(libdir) diff --git a/configure b/configure index e5d01dbe..a433d4b1 100755 --- a/configure +++ b/configure @@ -700,6 +700,7 @@ NSINSTALL='$(MOD_DEPTH)/config/$(OBJDIR_NAME)/nsinstall' NOSUCHFILE=/no-such-file LIBNSPR='-L$(dist_libdir) -lnspr$(MOD_MAJOR_VERSION)' LIBPLC='-L$(dist_libdir) -lplc$(MOD_MAJOR_VERSION)' +CYGWIN_WRAPPER= RESOLVE_LINK_SYMBOLS= @@ -716,7 +717,7 @@ case "$target" in if test "$CC" = "cl" || test "$CXX" = "cl"; then _WIN32_MSVC=1 elif test -z "$CC"; then - echo 'main() { return 0; }' > dummy.c + echo 'int main() { return 0; }' > dummy.c cl -o dummy dummy.c if test $? = 0; then _WIN32_MSVC=1 @@ -960,7 +961,7 @@ if test -z "$SKIP_PATH_CHECKS"; then # Extract the first word of "$WHOAMI whoami", so it can be a program name with args. set dummy $WHOAMI whoami; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:964: checking for $ac_word" >&5 +echo "configure:965: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_WHOAMI'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1025,14 +1026,14 @@ if test "$target" != "$host"; then _SAVE_LDFLAGS="$LDFLAGS" echo $ac_n "checking for $host compiler""... $ac_c" 1>&6 -echo "configure:1029: checking for $host compiler" >&5 +echo "configure:1030: checking for $host compiler" >&5 if test -z "$HOST_CC"; then for ac_prog in gcc cc /usr/ucb/cc do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1036: checking for $ac_word" >&5 +echo "configure:1037: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_HOST_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1079,16 +1080,16 @@ test -n "$HOST_CC" || HOST_CC="""" LDFLAGS="$HOST_LDFLAGS" echo $ac_n "checking whether the $host compiler ($HOST_CC $HOST_CFLAGS $HOST_LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1083: checking whether the $host compiler ($HOST_CC $HOST_CFLAGS $HOST_LDFLAGS) works" >&5 +echo "configure:1084: checking whether the $host compiler ($HOST_CC $HOST_CFLAGS $HOST_LDFLAGS) works" >&5 cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1093: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_prog_host_cc_works=1 echo "$ac_t""yes" 1>&6 else @@ -1109,7 +1110,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1113: checking for $ac_word" >&5 +echo "configure:1114: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1144,7 +1145,7 @@ test -n "$CC" || CC="echo" # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1148: checking for $ac_word" >&5 +echo "configure:1149: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1174,7 +1175,7 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1178: checking for $ac_word" >&5 +echo "configure:1179: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1225,7 +1226,7 @@ fi # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1229: checking for $ac_word" >&5 +echo "configure:1230: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1257,7 +1258,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1261: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:1262: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -1268,12 +1269,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 1272 "configure" +#line 1273 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:1277: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1278: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -1299,12 +1300,12 @@ if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:1303: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:1304: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:1308: checking whether we are using GNU C" >&5 +echo "configure:1309: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1313,7 +1314,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1317: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1318: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -1332,7 +1333,7 @@ ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:1336: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:1337: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1369,7 +1370,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1373: checking for $ac_word" >&5 +echo "configure:1374: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1406,7 +1407,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1410: checking for $ac_word" >&5 +echo "configure:1411: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1438,7 +1439,7 @@ test -n "$CXX" || CXX="gcc" echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1442: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5 +echo "configure:1443: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5 ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -1449,12 +1450,12 @@ cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext << EOF -#line 1453 "configure" +#line 1454 "configure" #include "confdefs.h" int main(){return(0);} EOF -if { (eval echo configure:1458: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1459: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cxx_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -1480,12 +1481,12 @@ if test $ac_cv_prog_cxx_works = no; then { echo "configure: error: installation or configuration problem: C++ compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:1484: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:1485: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6 cross_compiling=$ac_cv_prog_cxx_cross echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6 -echo "configure:1489: checking whether we are using GNU C++" >&5 +echo "configure:1490: checking whether we are using GNU C++" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1494,7 +1495,7 @@ else yes; #endif EOF -if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:1498: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:1499: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gxx=yes else ac_cv_prog_gxx=no @@ -1513,7 +1514,7 @@ ac_test_CXXFLAGS="${CXXFLAGS+set}" ac_save_CXXFLAGS="$CXXFLAGS" CXXFLAGS= echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6 -echo "configure:1517: checking whether ${CXX-g++} accepts -g" >&5 +echo "configure:1518: checking whether ${CXX-g++} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1550,7 +1551,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1554: checking for $ac_word" >&5 +echo "configure:1555: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1587,7 +1588,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1591: checking for $ac_word" >&5 +echo "configure:1592: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1624,7 +1625,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1628: checking for $ac_word" >&5 +echo "configure:1629: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1661,7 +1662,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1665: checking for $ac_word" >&5 +echo "configure:1666: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1698,7 +1699,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1702: checking for $ac_word" >&5 +echo "configure:1703: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1735,7 +1736,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1739: checking for $ac_word" >&5 +echo "configure:1740: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_DLLTOOL'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1772,7 +1773,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1776: checking for $ac_word" >&5 +echo "configure:1777: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_WINDRES'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1810,7 +1811,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1814: checking for $ac_word" >&5 +echo "configure:1815: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1842,7 +1843,7 @@ test -n "$CXX" || CXX="gcc" echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1846: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5 +echo "configure:1847: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5 ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -1853,12 +1854,12 @@ cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext << EOF -#line 1857 "configure" +#line 1858 "configure" #include "confdefs.h" int main(){return(0);} EOF -if { (eval echo configure:1862: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1863: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cxx_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -1884,12 +1885,12 @@ if test $ac_cv_prog_cxx_works = no; then { echo "configure: error: installation or configuration problem: C++ compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:1888: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:1889: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6 cross_compiling=$ac_cv_prog_cxx_cross echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6 -echo "configure:1893: checking whether we are using GNU C++" >&5 +echo "configure:1894: checking whether we are using GNU C++" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1898,7 +1899,7 @@ else yes; #endif EOF -if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:1902: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:1903: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gxx=yes else ac_cv_prog_gxx=no @@ -1917,7 +1918,7 @@ ac_test_CXXFLAGS="${CXXFLAGS+set}" ac_save_CXXFLAGS="$CXXFLAGS" CXXFLAGS= echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6 -echo "configure:1921: checking whether ${CXX-g++} accepts -g" >&5 +echo "configure:1922: checking whether ${CXX-g++} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1954,7 +1955,7 @@ fi # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1958: checking for $ac_word" >&5 +echo "configure:1959: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1984,7 +1985,7 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1988: checking for $ac_word" >&5 +echo "configure:1989: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2035,7 +2036,7 @@ fi # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2039: checking for $ac_word" >&5 +echo "configure:2040: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2067,7 +2068,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:2071: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:2072: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -2078,12 +2079,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 2082 "configure" +#line 2083 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:2087: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2088: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -2109,12 +2110,12 @@ if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:2113: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:2114: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:2118: checking whether we are using GNU C" >&5 +echo "configure:2119: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2123,7 +2124,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2127: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2128: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -2142,7 +2143,7 @@ ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:2146: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:2147: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2175,7 +2176,7 @@ fi fi echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:2179: checking how to run the C preprocessor" >&5 +echo "configure:2180: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -2190,13 +2191,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2200: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2201: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -2207,13 +2208,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2217: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2218: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -2224,13 +2225,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2234: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2235: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -2257,7 +2258,7 @@ echo "$ac_t""$CPP" 1>&6 # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2261: checking for $ac_word" >&5 +echo "configure:2262: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2289,7 +2290,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2293: checking for $ac_word" >&5 +echo "configure:2294: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_AS'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2330,7 +2331,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2334: checking for $ac_word" >&5 +echo "configure:2335: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_AR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2371,7 +2372,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2375: checking for $ac_word" >&5 +echo "configure:2376: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_LD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2412,7 +2413,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2416: checking for $ac_word" >&5 +echo "configure:2417: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_STRIP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2453,7 +2454,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2457: checking for $ac_word" >&5 +echo "configure:2458: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_DLLTOOL'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2494,7 +2495,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2498: checking for $ac_word" >&5 +echo "configure:2499: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_WINDRES'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2556,10 +2557,10 @@ else fi echo $ac_n "checking for gcc -pipe support""... $ac_c" 1>&6 -echo "configure:2560: checking for gcc -pipe support" >&5 +echo "configure:2561: checking for gcc -pipe support" >&5 if test -n "$GNU_CC" && test -n "$GNU_CXX" && test -n "$GNU_AS"; then echo '#include ' > dummy-hello.c - echo 'int main() { printf("Hello World\n"); exit(0); }' >> dummy-hello.c + echo 'int main() { printf("Hello World\n"); return 0; }' >> dummy-hello.c ${CC} -S dummy-hello.c -o dummy-hello.s 2>&5 cat dummy-hello.s | ${AS} -o dummy-hello.S - 2>&5 if test $? = 0; then @@ -2571,14 +2572,14 @@ if test -n "$GNU_CC" && test -n "$GNU_CXX" && test -n "$GNU_AS"; then _SAVE_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -pipe" cat > conftest.$ac_ext < int main() { printf("Hello World\n"); ; return 0; } EOF -if { (eval echo configure:2582: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2583: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* _res_gcc_pipe="yes" else @@ -2611,7 +2612,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2615: checking for $ac_word" >&5 +echo "configure:2616: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_PERL'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2671,8 +2672,17 @@ if test "$OS_ARCH" = "IRIX64"; then OS_ARCH=IRIX fi +if test "$OS_ARCH" = "AIX"; then + OS_RELEASE=`uname -v`.`uname -r` +fi + +if test "$OS_ARCH" = "FreeBSD"; then + OS_RELEASE=`echo $OS_RELEASE | sed 's/-.*//'` +fi + if test "$OS_ARCH" = "Linux"; then OS_RELEASE=`echo $OS_RELEASE | sed 's/-.*//'` + OS_RELEASE=`echo $OS_RELEASE | awk -F\. '{ print $1 "." $2 }'` fi if test "$OS_ARCH" = "POSIX_for_OpenVMS_AXP"; then @@ -2835,17 +2845,17 @@ EOF DSO_LDOPTS='-brtl -bM:SRE -bnoentry -bexpall' ac_safe=`echo "sys/atomic_op.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for sys/atomic_op.h""... $ac_c" 1>&6 -echo "configure:2839: checking for sys/atomic_op.h" >&5 +echo "configure:2849: checking for sys/atomic_op.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2849: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2859: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2967,11 +2977,7 @@ EOF MDCPUCFG_H=_aix64.cfg OBJECT_MODE=64 else - if test -n "$USE_IPV6"; then - MDCPUCFG_H=_aix32in6.cfg - else - MDCPUCFG_H=_aix32.cfg - fi + MDCPUCFG_H=_aix32.cfg fi PR_MD_CSRCS=aix.c RESOLVE_LINK_SYMBOLS=1 @@ -3004,6 +3010,46 @@ EOF _OPTIMIZE_FLAGS=-O2 _DEBUG_FLAGS='-gdwarf-2 -O0' MKSHLIB='$(CCC) $(DSO_LDOPTS) -o $@' + echo $ac_n "checking for gethostbyaddr in -lbind""... $ac_c" 1>&6 +echo "configure:3015: checking for gethostbyaddr in -lbind" >&5 +ac_lib_var=`echo bind'_'gethostbyaddr | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lbind $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + OS_LIBS="$OS_LIBS -lbind -lsocket" +else + echo "$ac_t""no" 1>&6 +fi + ;; powerpc) CC=mwcc @@ -3166,7 +3212,6 @@ EOF CFLAGS="$CFLAGS -Wmost -fno-common" if echo $OS_TEST | grep -c 86 2>/dev/null; then - CFLAGS="$CFLAGS -mno-486" cat >> confdefs.h <<\EOF #define i386 1 EOF @@ -3249,8 +3294,9 @@ EOF else DLL_SUFFIX=so.1.0 fi + MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@' DSO_CFLAGS=-fPIC - DSO_LDOPTS=-Bshareable + DSO_LDOPTS='-shared -Wl,-soname -Wl,$(notdir $@)' MDCPUCFG_H=_freebsd.cfg PR_MD_CSRCS=freebsd.c ;; @@ -3275,7 +3321,9 @@ EOF DLL_SUFFIX=sl DSO_LDOPTS='-b +h $(notdir $@)' PR_MD_CSRCS=hpux.c - PR_MD_ASFILES=os_HPUX.s + if test "$OS_TEST" != "ia64"; then + PR_MD_ASFILES=os_HPUX.s + fi if test -n "$USE_64"; then MDCPUCFG_H=_hpux64.cfg else @@ -3329,7 +3377,7 @@ EOF fi - if echo "$OS_RELEASE" | egrep '^(B.10.30|B.11.00|B.11.11)' >/dev/null; then + if echo "$OS_RELEASE" | egrep '^(B.10.30|B.11.00|B.11.11|B.11.20)' >/dev/null; then cat >> confdefs.h <<\EOF #define HAVE_POINTER_LOCALTIME_R 1 EOF @@ -3388,7 +3436,7 @@ EOF DEFAULT_IMPL_STRATEGY=_PTH fi - if echo "$OS_RELEASE" | egrep '^(B.11.00|B.11.11)' >/dev/null; then + if echo "$OS_RELEASE" | egrep '^(B.11.00|B.11.11|B.11.20)' >/dev/null; then cat >> confdefs.h <<\EOF #define HPUX10 1 EOF @@ -3411,11 +3459,21 @@ EOF if test -z "$GNU_CC"; then if test -z "$USE_64"; then - CFLAGS="$CFLAGS +DAportable +DS2.0" - CXXFLAGS="$CXXFLAGS +DAportable +DS2.0" + 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 - CFLAGS="$CFLAGS +DA2.0W +DS2.0" - CXXFLAGS="$CXXFLAGS +DA2.0W +DS2.0" + 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 @@ -3595,10 +3653,6 @@ EOF cat >> confdefs.h <<\EOF #define LINUX 1 -EOF - - cat >> confdefs.h <<\EOF -#define linux 1 EOF CFLAGS="$CFLAGS -ansi -Wall" @@ -3641,14 +3695,8 @@ EOF PR_MD_ASFILES=os_Linux_ia64.s ;; m68k) - CFLAGS="$CFLAGS -m68020-40" - CXXFLAGS="$CXXFLAGS -m68020-40" - # - # gcc on Linux/m68k either has a bug or triggers a code-sequence - # bug in the 68060 which causes gcc to crash. The simplest way to - # avoid this is to enable a minimum level of optimization. - # - _DEBUG_FLAGS="$_DEBUG_FLAGS -O" + CFLAGS="$CFLAGS -m68020-60" + CXXFLAGS="$CXXFLAGS -m68020-60" ;; esac ;; @@ -3664,6 +3712,7 @@ EOF PR_MD_ARCH_DIR=windows RESOLVE_LINK_SYMBOLS=1 + NSINSTALL='$(CYGWIN_WRAPPER) nsinstall' if test -n "$GNU_CC"; then cat >> confdefs.h <<\EOF @@ -3672,15 +3721,16 @@ EOF MKSHLIB='$(DLLTOOL) --as=$(AS) -k --dllname $*.dll --output-lib $@' else - CC=cl - CXX=cl + topsrcdir=$srcdir + CYGWIN_WRAPPER='sh $(topsrcdir)/build/cygwin-wrapper' + CC='$(CYGWIN_WRAPPER) cl' + CXX='$(CYGWIN_WRAPPER) cl' LD=link AR='lib -NOLOGO -OUT:"$@"' AR_FLAGS= RANLIB='echo not_ranlib' STRIP='echo not_strip' - NSINSTALL=nsinstall - RC=rc.exe + RC='$(CYGWIN_WRAPPER) rc.exe' GARBAGE='$(OBJDIR)/vc20.pdb $(OBJDIR)/vc40.pdb' OBJ_SUFFIX=obj LIB_SUFFIX=lib @@ -4100,19 +4150,30 @@ EOF #define _REENTRANT 1 EOF - ac_safe=`echo "machine/builtins.h" | sed 'y%./+-%__p_%'` + + if echo "$OS_RELEASE" | egrep -c '(V2.0|V3.2)' 2>/dev/null ; then + USE_NSPR_THREADS=1 + fi + + if test -z "$GNU_CC"; then + CC="$CC -std1 -ieee_with_inexact" + if test "$OS_RELEASE" != "V2.0"; then + CC="$CC -readonly_strings" + fi + _OPTIMIZE_FLAGS="$_OPTIMIZE_FLAGS -Olimit 4000" + ac_safe=`echo "machine/builtins.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for machine/builtins.h""... $ac_c" 1>&6 -echo "configure:4106: checking for machine/builtins.h" >&5 +echo "configure:4167: checking for machine/builtins.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4116: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4177: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4136,17 +4197,9 @@ else echo "$ac_t""no" 1>&6 fi - - if echo "$OS_RELEASE" | egrep -c '(V2.0|V3.2)' 2>/dev/null ; then - USE_NSPR_THREADS=1 - fi - - if test -z "$GNU_CC"; then - CC="$CC -std1 -ieee_with_inexact" - if test "$OS_RELEASE" != "V2.0"; then - CC="$CC -readonly_strings" - fi - _OPTIMIZE_FLAGS="$_OPTIMIZE_FLAGS -Olimit 4000" + else + CFLAGS="$CFLAGS -mieee" + CXXFLAGS="$CXXFLAGS -mieee" fi if echo $OS_RELEASE | egrep -c '(V2.0|V3.2)' 2>/dev/null; then @@ -4448,6 +4501,11 @@ EOF DSO_LDOPTS="$DSO_LDOPTS -f "'$(ULTRASPARC_FILTER_LIBRARY)' fi fi + # Purify requires that binaries linked against nspr also + # be linked against -lrt (or -lposix4) so add it to OS_LIBS + _rev=`uname -r` + _librt=`echo $_rev 5.6 | awk '{ if ($1 > $2) print "-lrt"; else print "-lposix4" }'` + OS_LIBS="$OS_LIBS $_librt" ;; *-sco-sysv5*) @@ -4502,11 +4560,11 @@ EOF EOF cat >> confdefs.h <<\EOF -#define BSD_SELECT 1 +#define XP_PC 1 EOF cat >> confdefs.h <<\EOF -#define XP_PC 1 +#define BSD_SELECT 1 EOF cat >> confdefs.h <<\EOF @@ -4622,12 +4680,12 @@ esac if test -z "$SKIP_LIBRARY_CHECKS"; then echo $ac_n "checking for dlopen""... $ac_c" 1>&6 -echo "configure:4626: checking for dlopen" >&5 +echo "configure:4684: checking for dlopen" >&5 if eval "test \"`echo '$''{'ac_cv_func_dlopen'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4712: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_dlopen=yes" else @@ -4669,7 +4727,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "configure:4673: checking for dlopen in -ldl" >&5 +echo "configure:4731: checking for dlopen in -ldl" >&5 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4677,7 +4735,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4750: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4716,13 +4774,13 @@ fi if test $ac_cv_prog_gcc = yes; then echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6 -echo "configure:4720: checking whether ${CC-cc} needs -traditional" >&5 +echo "configure:4778: checking whether ${CC-cc} needs -traditional" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_pattern="Autoconf.*'x'" cat > conftest.$ac_ext < Autoconf TIOCGETP @@ -4740,7 +4798,7 @@ rm -f conftest* if test $ac_cv_prog_gcc_traditional = no; then cat > conftest.$ac_ext < Autoconf TCGETA @@ -4764,12 +4822,12 @@ fi for ac_func in lchown strerror do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4768: checking for $ac_func" >&5 +echo "configure:4826: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4854: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4830,16 +4888,16 @@ fi echo $ac_n "checking for pthread_create in -lpthreads""... $ac_c" 1>&6 -echo "configure:4834: checking for pthread_create in -lpthreads" >&5 +echo "configure:4892: checking for pthread_create in -lpthreads" >&5 echo " #include - void *foo(void *v) { int a = 1; } + void *foo(void *v) { return v; } int main() { pthread_t t; if (!pthread_create(&t, 0, &foo, 0)) { pthread_join(t, 0); } - exit(0); + return 0; }" > dummy.c ; echo "${CC-cc} -o dummy${ac_exeext} dummy.c $CFLAGS $CPPFLAGS -lpthreads $LDFLAGS $LIBS" 1>&5; ${CC-cc} -o dummy${ac_exeext} dummy.c $CFLAGS $CPPFLAGS -lpthreads $LDFLAGS $LIBS 2>&5; @@ -4852,16 +4910,16 @@ echo " echo "$ac_t""no" 1>&6 echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6 -echo "configure:4856: checking for pthread_create in -lpthread" >&5 +echo "configure:4914: checking for pthread_create in -lpthread" >&5 echo " #include - void *foo(void *v) { int a = 1; } + void *foo(void *v) { return v; } int main() { pthread_t t; if (!pthread_create(&t, 0, &foo, 0)) { pthread_join(t, 0); } - exit(0); + return 0; }" > dummy.c ; echo "${CC-cc} -o dummy${ac_exeext} dummy.c $CFLAGS $CPPFLAGS -lpthread $LDFLAGS $LIBS" 1>&5; ${CC-cc} -o dummy${ac_exeext} dummy.c $CFLAGS $CPPFLAGS -lpthread $LDFLAGS $LIBS 2>&5; @@ -4874,16 +4932,16 @@ echo " echo "$ac_t""no" 1>&6 echo $ac_n "checking for pthread_create in -lc_r""... $ac_c" 1>&6 -echo "configure:4878: checking for pthread_create in -lc_r" >&5 +echo "configure:4936: checking for pthread_create in -lc_r" >&5 echo " #include - void *foo(void *v) { int a = 1; } + void *foo(void *v) { return v; } int main() { pthread_t t; if (!pthread_create(&t, 0, &foo, 0)) { pthread_join(t, 0); } - exit(0); + return 0; }" > dummy.c ; echo "${CC-cc} -o dummy${ac_exeext} dummy.c $CFLAGS $CPPFLAGS -lc_r $LDFLAGS $LIBS" 1>&5; ${CC-cc} -o dummy${ac_exeext} dummy.c $CFLAGS $CPPFLAGS -lc_r $LDFLAGS $LIBS 2>&5; @@ -4896,16 +4954,16 @@ echo " echo "$ac_t""no" 1>&6 echo $ac_n "checking for pthread_create in -lc""... $ac_c" 1>&6 -echo "configure:4900: checking for pthread_create in -lc" >&5 +echo "configure:4958: checking for pthread_create in -lc" >&5 echo " #include - void *foo(void *v) { int a = 1; } + void *foo(void *v) { return v; } int main() { pthread_t t; if (!pthread_create(&t, 0, &foo, 0)) { pthread_join(t, 0); } - exit(0); + return 0; }" > dummy.c ; echo "${CC-cc} -o dummy${ac_exeext} dummy.c $CFLAGS $CPPFLAGS -lc $LDFLAGS $LIBS" 1>&5; ${CC-cc} -o dummy${ac_exeext} dummy.c $CFLAGS $CPPFLAGS -lc $LDFLAGS $LIBS 2>&5; @@ -4946,7 +5004,7 @@ if test "${with_pthreads+set}" = set; then _PTHREAD_LDFLAGS= fi else - if test -n "$_HAVE_PTHREADS" && test -z "$USE_USER_PTHREADS" && test -z "$USER_NSPR_THREADS"; then + if test -n "$_HAVE_PTHREADS" && test -z "$USE_USER_PTHREADS" && test -z "$USE_NSPR_THREADS"; then USE_PTHREADS=1 USE_USER_PTHREADS= USE_NSPR_THREADS= @@ -5024,6 +5082,8 @@ if test "${enable_ipv6+set}" = set; then enableval="$enable_ipv6" if test "$enableval" = "yes"; then USE_IPV6=1 + else + USE_IPV6= fi fi @@ -5046,14 +5106,21 @@ if test -n "$USE_PTHREADS"; then rm -f conftest* ac_cv_have_dash_pthread=no echo $ac_n "checking whether ${CC-cc} accepts -pthread""... $ac_c" 1>&6 -echo "configure:5050: checking whether ${CC-cc} accepts -pthread" >&5 +echo "configure:5110: checking whether ${CC-cc} accepts -pthread" >&5 echo 'int main() { return 0; }' | cat > conftest.c ${CC-cc} -pthread -o conftest conftest.c > conftest.out 2>&1 if test $? -eq 0; then if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthread`" && test -z "`egrep -i '(error|incorrect)' conftest.out`" ; then ac_cv_have_dash_pthread=yes - CFLAGS="$CFLAGS -pthread" - CXXFLAGS="$CXXFLAGS -pthread" + case "$target_os" in + freebsd*) +# Freebsd doesn't use -pthread for compiles, it uses them for linking + ;; + *) + CFLAGS="$CFLAGS -pthread" + CXXFLAGS="$CXXFLAGS -pthread" + ;; + esac fi fi rm -f conftest* @@ -5062,7 +5129,7 @@ echo "configure:5050: checking whether ${CC-cc} accepts -pthread" >&5 ac_cv_have_dash_pthreads=no if test "$ac_cv_have_dash_pthread" = "no"; then echo $ac_n "checking whether ${CC-cc} accepts -pthreads""... $ac_c" 1>&6 -echo "configure:5066: checking whether ${CC-cc} accepts -pthreads" >&5 +echo "configure:5133: checking whether ${CC-cc} accepts -pthreads" >&5 echo 'int main() { return 0; }' | cat > conftest.c ${CC-cc} -pthreads -o conftest conftest.c > conftest.out 2>&1 if test $? -eq 0; then @@ -5082,7 +5149,22 @@ echo "configure:5066: checking whether ${CC-cc} accepts -pthreads" >&5 _PTHREAD_LDFLAGS= fi ;; - *-freebsd*|*-openbsd*|*-bsdi*|*-netbsd*) + *-freebsd*) + cat >> confdefs.h <<\EOF +#define _REENTRANT 1 +EOF + + cat >> confdefs.h <<\EOF +#define _THREAD_SAFE 1 +EOF + + if test "$ac_cv_have_dash_pthread" = "yes"; then + _PTHREAD_LDFLAGS="-pthread" + else + _PTHREAD_LDFLAGS="-lc_r" + fi + ;; + *-openbsd*|*-bsdi*|*-netbsd*) cat >> confdefs.h <<\EOF #define _THREAD_SAFE 1 EOF @@ -5227,7 +5309,7 @@ EOF _PTHREAD_LDFLAGS= USE_USER_PTHREADS= ;; -*-netbsd*) +*-netbsd*|*-openbsd*) if test -n "$USE_NSPR_THREADS"; then cat >> confdefs.h <<\EOF #define _PR_LOCAL_THREADS_ONLY 1 @@ -5396,6 +5478,7 @@ RELEASE_OBJDIR_NAME="${OS_CONFIG}${CPU_ARCH_TAG}${COMPILER_TAG}${IMPL_STRATEGY}$ + @@ -5698,6 +5781,7 @@ s%@RC@%$RC%g s%@DLLFLAGS@%$DLLFLAGS%g s%@EXEFLAGS@%$EXEFLAGS%g s%@OS_DLLFLAGS@%$OS_DLLFLAGS%g +s%@CYGWIN_WRAPPER@%$CYGWIN_WRAPPER%g CEOF EOF diff --git a/configure.in b/configure.in index 462e62e0..cc3cc06b 100644 --- a/configure.in +++ b/configure.in @@ -66,6 +66,7 @@ NSINSTALL='$(MOD_DEPTH)/config/$(OBJDIR_NAME)/nsinstall' NOSUCHFILE=/no-such-file LIBNSPR='-L$(dist_libdir) -lnspr$(MOD_MAJOR_VERSION)' LIBPLC='-L$(dist_libdir) -lplc$(MOD_MAJOR_VERSION)' +CYGWIN_WRAPPER= dnl Link in libraries necessary to resolve all symbols for shared libs RESOLVE_LINK_SYMBOLS= @@ -90,7 +91,7 @@ case "$target" in if test "$CC" = "cl" || test "$CXX" = "cl"; then _WIN32_MSVC=1 elif test -z "$CC"; then - echo 'main() { return 0; }' > dummy.c + echo 'int main() { return 0; }' > dummy.c cl -o dummy dummy.c if test $? = 0; then _WIN32_MSVC=1 @@ -445,7 +446,7 @@ dnl ======================================================== AC_MSG_CHECKING([for gcc -pipe support]) if test -n "$GNU_CC" && test -n "$GNU_CXX" && test -n "$GNU_AS"; then echo '#include ' > dummy-hello.c - echo 'int main() { printf("Hello World\n"); exit(0); }' >> dummy-hello.c + echo 'int main() { printf("Hello World\n"); return 0; }' >> dummy-hello.c ${CC} -S dummy-hello.c -o dummy-hello.s 2>&5 cat dummy-hello.s | ${AS} -o dummy-hello.S - 2>&5 if test $? = 0; then @@ -509,8 +510,17 @@ if test "$OS_ARCH" = "IRIX64"; then OS_ARCH=IRIX fi +if test "$OS_ARCH" = "AIX"; then + OS_RELEASE=`uname -v`.`uname -r` +fi + +if test "$OS_ARCH" = "FreeBSD"; then + OS_RELEASE=`echo $OS_RELEASE | sed 's/-.*//'` +fi + if test "$OS_ARCH" = "Linux"; then OS_RELEASE=`echo $OS_RELEASE | sed 's/-.*//'` + OS_RELEASE=`echo $OS_RELEASE | awk -F\. '{ print $1 "." $2 }'` fi if test "$OS_ARCH" = "POSIX_for_OpenVMS_AXP"; then @@ -720,11 +730,7 @@ case "$target" in MDCPUCFG_H=_aix64.cfg OBJECT_MODE=64 else - if test -n "$USE_IPV6"; then - MDCPUCFG_H=_aix32in6.cfg - else - MDCPUCFG_H=_aix32.cfg - fi + MDCPUCFG_H=_aix32.cfg fi PR_MD_CSRCS=aix.c RESOLVE_LINK_SYMBOLS=1 @@ -745,6 +751,7 @@ case "$target" in _OPTIMIZE_FLAGS=-O2 _DEBUG_FLAGS='-gdwarf-2 -O0' MKSHLIB='$(CCC) $(DSO_LDOPTS) -o $@' + AC_CHECK_LIB(bind, gethostbyaddr, [OS_LIBS="$OS_LIBS -lbind -lsocket"]) ;; powerpc) CC=mwcc @@ -829,7 +836,6 @@ case "$target" in AC_DEFINE(HAVE_BSD_FLOCK) CFLAGS="$CFLAGS -Wmost -fno-common" if echo $OS_TEST | grep -c 86 2>/dev/null; then - CFLAGS="$CFLAGS -mno-486" AC_DEFINE(i386) CPU_ARCH=i386 else @@ -876,8 +882,9 @@ case "$target" in else DLL_SUFFIX=so.1.0 fi + MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@' DSO_CFLAGS=-fPIC - DSO_LDOPTS=-Bshareable + DSO_LDOPTS='-shared -Wl,-soname -Wl,$(notdir $@)' MDCPUCFG_H=_freebsd.cfg PR_MD_CSRCS=freebsd.c ;; @@ -890,7 +897,9 @@ case "$target" in DLL_SUFFIX=sl DSO_LDOPTS='-b +h $(notdir $@)' PR_MD_CSRCS=hpux.c - PR_MD_ASFILES=os_HPUX.s + if test "$OS_TEST" != "ia64"; then + PR_MD_ASFILES=os_HPUX.s + fi if test -n "$USE_64"; then MDCPUCFG_H=_hpux64.cfg else @@ -929,7 +938,7 @@ case "$target" in AC_DEFINE(HAVE_INT_LOCALTIME_R) fi - if echo "$OS_RELEASE" | egrep '^(B.10.30|B.11.00|B.11.11)' >/dev/null; then + if echo "$OS_RELEASE" | egrep '^(B.10.30|B.11.00|B.11.11|B.11.20)' >/dev/null; then AC_DEFINE(HAVE_POINTER_LOCALTIME_R) fi @@ -964,7 +973,7 @@ case "$target" in DEFAULT_IMPL_STRATEGY=_PTH fi - if echo "$OS_RELEASE" | egrep '^(B.11.00|B.11.11)' >/dev/null; then + if echo "$OS_RELEASE" | egrep '^(B.11.00|B.11.11|B.11.20)' >/dev/null; then AC_DEFINE(HPUX10) AC_DEFINE(HPUX11) AC_DEFINE(_LARGEFILE64_SOURCE) @@ -972,11 +981,21 @@ case "$target" in AC_DEFINE(HAVE_FCNTL_FILE_LOCKING) if test -z "$GNU_CC"; then if test -z "$USE_64"; then - CFLAGS="$CFLAGS +DAportable +DS2.0" - CXXFLAGS="$CXXFLAGS +DAportable +DS2.0" + 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 - CFLAGS="$CFLAGS +DA2.0W +DS2.0" - CXXFLAGS="$CXXFLAGS +DA2.0W +DS2.0" + 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 @@ -1108,7 +1127,6 @@ case "$target" in AC_DEFINE(_LARGEFILE64_SOURCE) AC_DEFINE(HAVE_FCNTL_FILE_LOCKING) AC_DEFINE(LINUX) - AC_DEFINE(linux) CFLAGS="$CFLAGS -ansi -Wall" CXXFLAGS="$CXXFLAGS -ansi -Wall" MDCPUCFG_H=_linux.cfg @@ -1140,14 +1158,8 @@ case "$target" in PR_MD_ASFILES=os_Linux_ia64.s ;; m68k) - CFLAGS="$CFLAGS -m68020-40" - CXXFLAGS="$CXXFLAGS -m68020-40" - # - # gcc on Linux/m68k either has a bug or triggers a code-sequence - # bug in the 68060 which causes gcc to crash. The simplest way to - # avoid this is to enable a minimum level of optimization. - # - _DEBUG_FLAGS="$_DEBUG_FLAGS -O" + CFLAGS="$CFLAGS -m68020-60" + CXXFLAGS="$CXXFLAGS -m68020-60" ;; esac ;; @@ -1157,20 +1169,22 @@ case "$target" in AC_DEFINE(WIN32) PR_MD_ARCH_DIR=windows RESOLVE_LINK_SYMBOLS=1 + NSINSTALL='$(CYGWIN_WRAPPER) nsinstall' if test -n "$GNU_CC"; then AC_DEFINE(NONAMELESSUNION) MKSHLIB='$(DLLTOOL) --as=$(AS) -k --dllname $*.dll --output-lib $@' else - CC=cl - CXX=cl + topsrcdir=$srcdir + CYGWIN_WRAPPER='sh $(topsrcdir)/build/cygwin-wrapper' + CC='$(CYGWIN_WRAPPER) cl' + CXX='$(CYGWIN_WRAPPER) cl' LD=link AR='lib -NOLOGO -OUT:"$@"' AR_FLAGS= RANLIB='echo not_ranlib' STRIP='echo not_strip' - NSINSTALL=nsinstall - RC=rc.exe + RC='$(CYGWIN_WRAPPER) rc.exe' GARBAGE='$(OBJDIR)/vc20.pdb $(OBJDIR)/vc40.pdb' OBJ_SUFFIX=obj LIB_SUFFIX=lib @@ -1443,7 +1457,6 @@ mips-sony-newsos*) AC_DEFINE(XP_UNIX) AC_DEFINE(OSF1) AC_DEFINE(_REENTRANT) - AC_CHECK_HEADER(machine/builtins.h, AC_DEFINE(OSF1_HAVE_MACHINE_BUILTINS_H)) if echo "$OS_RELEASE" | egrep -c '(V2.0|V3.2)' 2>/dev/null ; then USE_NSPR_THREADS=1 @@ -1455,6 +1468,10 @@ mips-sony-newsos*) CC="$CC -readonly_strings" fi _OPTIMIZE_FLAGS="$_OPTIMIZE_FLAGS -Olimit 4000" + AC_CHECK_HEADER(machine/builtins.h, AC_DEFINE(OSF1_HAVE_MACHINE_BUILTINS_H)) + else + CFLAGS="$CFLAGS -mieee" + CXXFLAGS="$CXXFLAGS -mieee" fi if echo $OS_RELEASE | egrep -c '(V2.0|V3.2)' 2>/dev/null; then @@ -1648,6 +1665,11 @@ mips-sony-newsos*) DSO_LDOPTS="$DSO_LDOPTS -f "'$(ULTRASPARC_FILTER_LIBRARY)' fi fi + # Purify requires that binaries linked against nspr also + # be linked against -lrt (or -lposix4) so add it to OS_LIBS + _rev=`uname -r` + _librt=`echo $_rev 5.6 | awk '{ if ($1 > $2) print "-lrt"; else print "-lposix4" }'` + OS_LIBS="$OS_LIBS $_librt" ;; *-sco-sysv5*) @@ -1674,8 +1696,8 @@ mips-sony-newsos*) *-os2*) AC_DEFINE(XP_OS2) - AC_DEFINE(BSD_SELECT) AC_DEFINE(XP_PC) + AC_DEFINE(BSD_SELECT) AC_DEFINE(_PR_GLOBAL_THREADS_ONLY) OBJ_SUFFIX=obj LIB_SUFFIX=lib @@ -1858,13 +1880,13 @@ AC_DEFUN(MOZ_CHECK_PTHREADS, AC_MSG_CHECKING([for pthread_create in -l$1]) echo " #include - void *foo(void *v) { int a = 1; } + void *foo(void *v) { return v; } int main() { pthread_t t; if (!pthread_create(&t, 0, &foo, 0)) { pthread_join(t, 0); } - exit(0); + return 0; }" > dummy.c ; echo "${CC-cc} -o dummy${ac_exeext} dummy.c $CFLAGS $CPPFLAGS -l[$1] $LDFLAGS $LIBS" 1>&5; ${CC-cc} -o dummy${ac_exeext} dummy.c $CFLAGS $CPPFLAGS -l[$1] $LDFLAGS $LIBS 2>&5; @@ -1906,7 +1928,7 @@ AC_ARG_WITH(pthreads, USE_PTHREADS= _PTHREAD_LDFLAGS= fi], - [ if test -n "$_HAVE_PTHREADS" && test -z "$USE_USER_PTHREADS" && test -z "$USER_NSPR_THREADS"; then + [ if test -n "$_HAVE_PTHREADS" && test -z "$USE_USER_PTHREADS" && test -z "$USE_NSPR_THREADS"; then USE_PTHREADS=1 USE_USER_PTHREADS= USE_NSPR_THREADS= @@ -1966,6 +1988,8 @@ AC_ARG_ENABLE(ipv6, [ --enable-ipv6 Compile ipv6 support], [ if test "$enableval" = "yes"; then USE_IPV6=1 + else + USE_IPV6= fi]) @@ -1986,8 +2010,15 @@ if test -n "$USE_PTHREADS"; then if test $? -eq 0; then if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthread`" && test -z "`egrep -i '(error|incorrect)' conftest.out`" ; then ac_cv_have_dash_pthread=yes - CFLAGS="$CFLAGS -pthread" - CXXFLAGS="$CXXFLAGS -pthread" + case "$target_os" in + freebsd*) +# Freebsd doesn't use -pthread for compiles, it uses them for linking + ;; + *) + CFLAGS="$CFLAGS -pthread" + CXXFLAGS="$CXXFLAGS -pthread" + ;; + esac fi fi rm -f conftest* @@ -2018,7 +2049,17 @@ if test -n "$USE_PTHREADS"; then _PTHREAD_LDFLAGS= fi ;; - *-freebsd*|*-openbsd*|*-bsdi*|*-netbsd*) + *-freebsd*) + AC_DEFINE(_REENTRANT) + AC_DEFINE(_THREAD_SAFE) + dnl -pthread links in -lc_r, so don't specify it explicitly. + if test "$ac_cv_have_dash_pthread" = "yes"; then + _PTHREAD_LDFLAGS="-pthread" + else + _PTHREAD_LDFLAGS="-lc_r" + fi + ;; + *-openbsd*|*-bsdi*|*-netbsd*) AC_DEFINE(_THREAD_SAFE) dnl -pthread links in -lc_r, so don't specify it explicitly. if test "$ac_cv_have_dash_pthread" = "yes"; then @@ -2112,7 +2153,7 @@ case "$target" in _PTHREAD_LDFLAGS= USE_USER_PTHREADS= ;; -*-netbsd*) +*-netbsd*|*-openbsd*) if test -n "$USE_NSPR_THREADS"; then AC_DEFINE(_PR_LOCAL_THREADS_ONLY) fi @@ -2279,6 +2320,7 @@ AC_SUBST(RC) AC_SUBST(DLLFLAGS) AC_SUBST(EXEFLAGS) AC_SUBST(OS_DLLFLAGS) +AC_SUBST(CYGWIN_WRAPPER) dnl ======================================================== dnl Generate output files. diff --git a/lib/ds/plarena.c b/lib/ds/plarena.c index ad541a5d..7f144636 100644 --- a/lib/ds/plarena.c +++ b/lib/ds/plarena.c @@ -339,7 +339,7 @@ PR_IMPLEMENT(void) PL_CompactArenaPool(PLArenaPool *ap) #endif } -PR_IMPLEMENT(void) PL_ArenaFinish() +PR_IMPLEMENT(void) PL_ArenaFinish(void) { PLArena *a, *next; diff --git a/lib/libc/src/base64.c b/lib/libc/src/base64.c index 749965f7..00f19ab2 100644 --- a/lib/libc/src/base64.c +++ b/lib/libc/src/base64.c @@ -383,7 +383,7 @@ PL_Base64Decode srclen = PL_strlen(src); } - if( 0 == (srclen & 3) ) + if( srclen && (0 == (srclen & 3)) ) { if( (char)'=' == src[ srclen-1 ] ) { diff --git a/macbuild/NSPR.Debug.Prefix b/macbuild/NSPR.Debug.Prefix deleted file mode 100644 index ae6233ee..00000000 --- a/macbuild/NSPR.Debug.Prefix +++ /dev/null @@ -1 +0,0 @@ -// // NSPR.Prefix // // Global prefix file for the debug NSPR project. // // #define DEBUG 1 #include "NSPRConfig.h" \ No newline at end of file diff --git a/macbuild/NSPR.Prefix b/macbuild/NSPR.Prefix index a3947318..f9683b50 100644 --- a/macbuild/NSPR.Prefix +++ b/macbuild/NSPR.Prefix @@ -1 +1,10 @@ -// // NSPR.Prefix // // Global prefix file for the non-debug NSPR project. // // #include "NSPRConfig.h" \ No newline at end of file +// +// NSPR.Prefix +// +// Global prefix file for the non-debug NSPR project. +// +// + + +#include "MacPrefix.h" +#include "NSPRConfig.h" diff --git a/macbuild/NSPR20.toc b/macbuild/NSPR20.toc deleted file mode 100644 index aaa20253..00000000 --- a/macbuild/NSPR20.toc +++ /dev/null @@ -1,69 +0,0 @@ -# target: NSPR20Debug.shlb -mozilla/nsprpub/lib/ds/plarena.c -mozilla/nsprpub/lib/ds/plevent.c -mozilla/nsprpub/lib/ds/plhash.c -mozilla/nsprpub/lib/libc/src/base64.c -mozilla/nsprpub/lib/libc/src/plerror.c -mozilla/nsprpub/lib/libc/src/plgetopt.c -mozilla/nsprpub/lib/libc/src/strcat.c -mozilla/nsprpub/lib/libc/src/strccmp.c -mozilla/nsprpub/lib/libc/src/strchr.c -mozilla/nsprpub/lib/libc/src/strcmp.c -mozilla/nsprpub/lib/libc/src/strcpy.c -mozilla/nsprpub/lib/libc/src/strcstr.c -mozilla/nsprpub/lib/libc/src/strdup.c -mozilla/nsprpub/lib/libc/src/strlen.c -mozilla/nsprpub/lib/libc/src/strpbrk.c -mozilla/nsprpub/lib/libc/src/strstr.c -mozilla/nsprpub/pr/src/io/prdir.c -mozilla/nsprpub/pr/src/io/prfdcach.c -mozilla/nsprpub/pr/src/io/prfile.c -mozilla/nsprpub/pr/src/io/prio.c -mozilla/nsprpub/pr/src/io/priometh.c -mozilla/nsprpub/pr/src/io/prlayer.c -mozilla/nsprpub/pr/src/io/prlog.c -mozilla/nsprpub/pr/src/io/prmapopt.c -mozilla/nsprpub/pr/src/io/prmmap.c -mozilla/nsprpub/pr/src/io/prmwait.c -mozilla/nsprpub/pr/src/io/prpolevt.c -mozilla/nsprpub/pr/src/io/prprf.c -mozilla/nsprpub/pr/src/io/prscanf.c -mozilla/nsprpub/pr/src/io/prsocket.c -mozilla/nsprpub/pr/src/io/prstdio.c -mozilla/nsprpub/pr/src/linking/prlink.c -mozilla/nsprpub/pr/src/malloc/prmem.c -mozilla/nsprpub/pr/src/md/mac/macdll.c -mozilla/nsprpub/pr/src/md/mac/macio.c -mozilla/nsprpub/pr/src/md/mac/macsockotpt.c -mozilla/nsprpub/pr/src/md/mac/macthr.c -mozilla/nsprpub/pr/src/md/mac/mactime.c -mozilla/nsprpub/pr/src/md/mac/mdmac.c -mozilla/nsprpub/pr/src/md/prosdep.c -mozilla/nsprpub/pr/src/memory/prseg.c -mozilla/nsprpub/pr/src/misc/pralarm.c -mozilla/nsprpub/pr/src/misc/pratom.c -mozilla/nsprpub/pr/src/misc/prcountr.c -mozilla/nsprpub/pr/src/misc/prdtoa.c -mozilla/nsprpub/pr/src/misc/prenv.c -mozilla/nsprpub/pr/src/misc/prerror.c -mozilla/nsprpub/pr/src/misc/prinit.c -mozilla/nsprpub/pr/src/misc/prinrval.c -mozilla/nsprpub/pr/src/misc/prlog2.c -mozilla/nsprpub/pr/src/misc/prlong.c -mozilla/nsprpub/pr/src/misc/prnetdb.c -mozilla/nsprpub/pr/src/misc/prolock.c -mozilla/nsprpub/pr/src/misc/prsystem.c -mozilla/nsprpub/pr/src/misc/prthinfo.c -mozilla/nsprpub/pr/src/misc/prtime.c -mozilla/nsprpub/pr/src/misc/prtrace.c -mozilla/nsprpub/pr/src/threads/combined/prucpu.c -mozilla/nsprpub/pr/src/threads/combined/prucv.c -mozilla/nsprpub/pr/src/threads/combined/prulock.c -mozilla/nsprpub/pr/src/threads/combined/prustack.c -mozilla/nsprpub/pr/src/threads/combined/pruthr.c -mozilla/nsprpub/pr/src/threads/prcmon.c -mozilla/nsprpub/pr/src/threads/prcthr.c -mozilla/nsprpub/pr/src/threads/prdump.c -mozilla/nsprpub/pr/src/threads/prmon.c -mozilla/nsprpub/pr/src/threads/prsem.c -mozilla/nsprpub/pr/src/threads/prtpd.c diff --git a/macbuild/NSPR20PPC.mcp b/macbuild/NSPR20PPC.mcp deleted file mode 100644 index 28ec6ebb..00000000 Binary files a/macbuild/NSPR20PPC.mcp and /dev/null differ diff --git a/macbuild/NSPR20PPC.xml b/macbuild/NSPR20PPC.xml new file mode 100644 index 00000000..f8ea7994 --- /dev/null +++ b/macbuild/NSPR20PPC.xml @@ -0,0 +1,8232 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +]> + + + + + NSPR20.shlb + + + + UserSourceTrees + + + AlwaysSearchUserPathsfalse + InterpretDOSAndUnixPathsfalse + RequireFrameworkStyleIncludesfalse + UserSearchPaths + + SearchPath + Path: + PathFormatMacOS + PathRootProject + + Recursivetrue + FrameworkPathfalse + HostFlagsAll + + + SearchPath + Path:: + PathFormatMacOS + PathRootProject + + Recursivetrue + FrameworkPathfalse + HostFlagsAll + + + SearchPath + Path:::dist: + PathFormatMacOS + PathRootProject + + Recursivetrue + FrameworkPathfalse + HostFlagsAll + + + SystemSearchPaths + + SearchPath + Path:MSL: + PathFormatMacOS + PathRootCodeWarrior + + Recursivetrue + FrameworkPathfalse + HostFlagsAll + + + SearchPath + Path:MacOS Support: + PathFormatMacOS + PathRootCodeWarrior + + Recursivetrue + FrameworkPathfalse + HostFlagsMacOS + + + + + MWRuntimeSettings_WorkingDirectory + MWRuntimeSettings_CommandLine + MWRuntimeSettings_HostApplication + Path + PathFormatGeneric + PathRootAbsolute + + MWRuntimeSettings_EnvVars + + + LinkerMacOS PPC Linker + PreLinker + PostLinker + TargetnameNSPR20.shlb + OutputDirectory + Path: + PathFormatMacOS + PathRootProject + + SaveEntriesUsingRelativePathsfalse + + + FileMappings + + FileTypeAPPL + FileExtension + Compiler + EditLanguage + Precompilefalse + Launchabletrue + ResourceFiletrue + IgnoredByMakefalse + + + FileTypeAppl + FileExtension + Compiler + EditLanguage + Precompilefalse + Launchabletrue + ResourceFiletrue + IgnoredByMakefalse + + + FileTypeMMLB + FileExtension + CompilerLib Import PPC + EditLanguage + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeMPLF + FileExtension + CompilerLib Import PPC + EditLanguage + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeMWCD + FileExtension + Compiler + EditLanguage + Precompilefalse + Launchabletrue + ResourceFiletrue + IgnoredByMakefalse + + + FileTypeRSRC + FileExtension + Compiler + EditLanguage + Precompilefalse + Launchabletrue + ResourceFiletrue + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.bh + CompilerBalloon Help + EditLanguage + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.c + CompilerMW C/C++ PPC + EditLanguageC/C++ + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.c++ + CompilerMW C/C++ PPC + EditLanguageC/C++ + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.cc + CompilerMW C/C++ PPC + EditLanguageC/C++ + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.cp + CompilerMW C/C++ PPC + EditLanguageC/C++ + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.cpp + CompilerMW C/C++ PPC + EditLanguageC/C++ + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.exp + Compiler + EditLanguage + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.h + CompilerMW C/C++ PPC + EditLanguageC/C++ + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMaketrue + + + FileTypeTEXT + FileExtension.p + CompilerMW Pascal PPC + EditLanguage + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.pas + CompilerMW Pascal PPC + EditLanguage + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.pch + CompilerMW C/C++ PPC + EditLanguageC/C++ + Precompiletrue + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.pch++ + CompilerMW C/C++ PPC + EditLanguageC/C++ + Precompiletrue + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.r + CompilerRez + EditLanguageRez + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.s + CompilerPPCAsm + EditLanguage + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeXCOF + FileExtension + CompilerXCOFF Import PPC + EditLanguage + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypedocu + FileExtension + Compiler + EditLanguage + Precompilefalse + Launchabletrue + ResourceFiletrue + IgnoredByMakefalse + + + FileTypersrc + FileExtension + Compiler + EditLanguage + Precompilefalse + Launchabletrue + ResourceFiletrue + IgnoredByMakefalse + + + FileTypeshlb + FileExtension + CompilerPEF Import PPC + EditLanguage + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypestub + FileExtension + CompilerPEF Import PPC + EditLanguage + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileExtension.doc + Compiler + EditLanguage + Precompilefalse + Launchabletrue + ResourceFilefalse + IgnoredByMaketrue + + + + + CacheModDatesfalse + ActivateBrowsertrue + DumpBrowserInfofalse + CacheSubprojectstrue + UseThirdPartyDebuggerfalse + DebuggerAppPath + Path + PathFormatGeneric + PathRootAbsolute + + DebuggerCmdLineArgs + DebuggerWorkingDir + Path + PathFormatGeneric + PathRootAbsolute + + + + LogSystemMessagestrue + AutoTargetDLLsfalse + StopAtWatchpointstrue + PauseWhileRunningfalse + PauseInterval5 + PauseUIFlags0 + AltExePath + Path + PathFormatGeneric + PathRootAbsolute + + StopAtTempBPOnLaunchtrue + CacheSymbolicstrue + TempBPFunctionNamemain + TempBPType0 + + + Enabledfalse + ConnectionName + DownloadPath + LaunchRemoteAppfalse + RemoteAppPath + + + OtherExecutables + + + CustomColor1 + Red0 + Green39321 + Blue0 + + CustomColor2 + Red0 + Green32767 + Blue0 + + CustomColor3 + Red0 + Green32767 + Blue0 + + CustomColor4 + Red0 + Green32767 + Blue0 + + + + MWFrontEnd_C_cplusplus0 + MWFrontEnd_C_checkprotos0 + MWFrontEnd_C_arm0 + MWFrontEnd_C_trigraphs0 + MWFrontEnd_C_onlystdkeywords0 + MWFrontEnd_C_enumsalwaysint1 + MWFrontEnd_C_mpwpointerstyle0 + MWFrontEnd_C_prefixnameNSPR.Prefix + MWFrontEnd_C_ansistrict0 + MWFrontEnd_C_mpwcnewline0 + MWFrontEnd_C_wchar_type1 + MWFrontEnd_C_enableexceptions1 + MWFrontEnd_C_dontreusestrings0 + MWFrontEnd_C_poolstrings0 + MWFrontEnd_C_dontinline0 + MWFrontEnd_C_useRTTI0 + MWFrontEnd_C_multibyteaware0 + MWFrontEnd_C_unsignedchars0 + MWFrontEnd_C_autoinline0 + MWFrontEnd_C_booltruefalse0 + MWFrontEnd_C_direct_to_som0 + MWFrontEnd_C_som_env_check0 + MWFrontEnd_C_alwaysinline0 + MWFrontEnd_C_inlinelevel0 + MWFrontEnd_C_ecplusplus0 + MWFrontEnd_C_objective_c0 + MWFrontEnd_C_defer_codegen0 + + + MWWarning_C_warn_illpragma1 + MWWarning_C_warn_emptydecl1 + MWWarning_C_warn_possunwant1 + MWWarning_C_warn_unusedvar1 + MWWarning_C_warn_unusedarg1 + MWWarning_C_warn_extracomma1 + MWWarning_C_pedantic1 + MWWarning_C_warningerrors0 + MWWarning_C_warn_hidevirtual1 + MWWarning_C_warn_implicitconv0 + MWWarning_C_warn_notinlined0 + MWWarning_C_warn_structclass0 + + + MWFTP_Post_hostName + MWFTP_Post_username + MWFTP_Post_password0 + MWFTP_Post_remoteDir + MWFTP_Post_ftp_PathVersion1 + MWFTP_Post_ftp_PathType0 + MWFTP_Post_ftp_PathFormat0 + MWFTP_Post_ftp_tree + MWFTP_Post_uploadDir + MWFTP_Post_ftp_port21 + MWFTP_Post_SendBin1 + MWFTP_Post_ShouldLog1 + + + MWCommandLine_Java_clsName + MWCommandLine_Java_args + + + MWVJavaDebugging_Protocol1 + MWVJavaDebugging_JDKVersion1 + MWVJavaDebugging_TimeOut10 + MWVJavaDebugging_SupportSlowDevicesfalse + + + MWJava_Language_optimizefalse + MWJava_Language_warnDeprecatedfalse + MWJava_Language_emitMapfalse + MWJava_Language_strictFileNamesfalse + MWJava_Language_strictFileHierarchyfalse + MWJava_Language_1_1_Compatiblefalse + MWJava_Language_emitHeaders0 + MWJava_Language_headerTypeJNINativeHeaders + MWJava_Language_packageFilter + MWJava_Language_genCommentstrue + MWJava_Language_genHeadersfalse + + + MWJava_MRJAppBuilder_outFileMRJApplication + MWJava_MRJAppBuilder_mergefalse + MWJava_MRJAppBuilder_quitMenutrue + MWJava_MRJAppBuilder_growfalse + MWJava_MRJAppBuilder_stdoutTypeConsole + MWJava_MRJAppBuilder_stderrTypeConsole + MWJava_MRJAppBuilder_stdinTypeConsole + MWJava_MRJAppBuilder_appIconPVersion0 + MWJava_MRJAppBuilder_appIconPType0 + MWJava_MRJAppBuilder_appIconPFormat0 + MWJava_MRJAppBuilder_appIconPTree + MWJava_MRJAppBuilder_appIconFile + MWJava_MRJAppBuilder_splashScreenPVersion0 + MWJava_MRJAppBuilder_splashScreenPType0 + MWJava_MRJAppBuilder_splashScreenPFormat0 + MWJava_MRJAppBuilder_splashScreenPTree + MWJava_MRJAppBuilder_splashScreenPICTFile + MWJava_MRJAppBuilder_aboutName + MWJava_MRJAppBuilder_stdoutPVersion0 + MWJava_MRJAppBuilder_stdoutPType0 + MWJava_MRJAppBuilder_stdoutPFormat0 + MWJava_MRJAppBuilder_stdoutPTree + MWJava_MRJAppBuilder_stdoutFile + MWJava_MRJAppBuilder_stdoutAppendfalse + MWJava_MRJAppBuilder_stderrPType0 + MWJava_MRJAppBuilder_stderrPFormat0 + MWJava_MRJAppBuilder_stderrPTree + MWJava_MRJAppBuilder_stderrFile + MWJava_MRJAppBuilder_stderrAppendfalse + MWJava_MRJAppBuilder_stdinPType0 + MWJava_MRJAppBuilder_stdinPFormat0 + MWJava_MRJAppBuilder_stdinPTree + MWJava_MRJAppBuilder_stdinFile + + + MWJava_Output_outputtypeJarFile + MWJava_Output_outfileJavaClasses.jar + MWJava_Output_ftype1514754080 + MWJava_Output_fcreator1297570384 + MWJava_Output_compress0 + MWJava_Output_genManifest0 + MWJava_Output_trunctypeFront + MWJava_Output_deleteClasses0 + MWJava_Output_consoleApp1 + + + MWJava_Proj_projtypeApplet + MWJava_Proj_mainClassName + MWJava_Proj_HTMLAppCreator1145457748 + MWJava_Proj_HTMLAppNameApple Applet Runner + MWJava_Proj_PathVersion1 + MWJava_Proj_PathType0 + MWJava_Proj_PathFormat0 + MWJava_Proj_tree + MWJava_Proj_HTMLAppWin32NameInternet Explorer + MWJava_Proj_compress0 + MWJava_Proj_useVM1 + MWJava_Proj_vmarguments + MWJava_Proj_vmName + MWJava_Proj_simPropFile + + + MWJavaDoc_Proj_Version1 + MWJavaDoc_Proj_Depricated1 + MWJavaDoc_Proj_Author1 + MWJavaDoc_Proj_Index1 + MWJavaDoc_Proj_Tree1 + MWJavaDoc_Proj_SunResolveToSame0 + MWJavaDoc_Proj_Shortnames1 + MWJavaDoc_Proj_Folder0 + MWJavaDoc_Proj_GenerateAPILinks0 + MWJavaDoc_Proj_scopePublic + MWJavaDoc_Proj_fcreator1297303877 + MWJavaDoc_Proj_encodingName + MWJavaDoc_Proj_decodingName + MWJavaDoc_Proj_javaPackagePathhttp://java.sun.com/products/jdk/1.1/docs/api/ + + + MWMerge_MacOS_projectTypeApplication + MWMerge_MacOS_outputNameMerge Out + MWMerge_MacOS_outputCreator???? + MWMerge_MacOS_outputTypeAPPL + MWMerge_MacOS_suppressWarning0 + MWMerge_MacOS_copyFragments1 + MWMerge_MacOS_copyResources1 + MWMerge_MacOS_flattenResource0 + MWMerge_MacOS_flatFileNamea.rsrc + MWMerge_MacOS_flatFileOutputPath + Path: + PathFormatMacOS + PathRootProject + + MWMerge_MacOS_skipResources + DLGX + ckid + Proj + WSPC + + + + FileLockedfalse + ResourcesMapIsReadOnlyfalse + PrinterDriverIsMultiFinderCompatiblefalse + Invisiblefalse + HasBundlefalse + NameLockedfalse + Stationeryfalse + HasCustomIconfalse + Sharedfalse + HasBeenInitedfalse + Label0 + Comments + + + MWMacOSPackager_UsePackager0 + MWMacOSPackager_FolderToPackage + Path: + PathFormatMacOS + PathRootProject + + MWMacOSPackager_CreateClassicAlias0 + MWMacOSPackager_ClassicAliasMethodUseTargetOutput + MWMacOSPackager_ClassicAliasPath + Path: + PathFormatMacOS + PathRootProject + + MWMacOSPackager_CreatePkgInfo0 + MWMacOSPackager_PkgCreatorType???? + MWMacOSPackager_PkgFileTypeAPPL + + + MWCodeGen_PPC_structalignmentPPC + MWCodeGen_PPC_tracebacktablesNone + MWCodeGen_PPC_processorGeneric + MWCodeGen_PPC_readonlystrings1 + MWCodeGen_PPC_tocdata1 + MWCodeGen_PPC_profiler0 + MWCodeGen_PPC_fpcontract1 + MWCodeGen_PPC_schedule0 + MWCodeGen_PPC_peephole0 + MWCodeGen_PPC_processorspecific0 + MWCodeGen_PPC_altivec0 + MWCodeGen_PPC_vectortocdata0 + MWCodeGen_PPC_vrsave0 + + + MWCodeGen_MachO_structalignmentPPC + MWCodeGen_MachO_tracebacktablesNone + MWCodeGen_MachO_processorGeneric + MWCodeGen_MachO_readonlystrings0 + MWCodeGen_MachO_profiler0 + MWCodeGen_MachO_fpcontract1 + MWCodeGen_MachO_schedule0 + MWCodeGen_MachO_peephole1 + MWCodeGen_MachO_processorspecific0 + MWCodeGen_MachO_altivec0 + MWCodeGen_MachO_vrsave1 + MWCodeGen_MachO_common0 + MWCodeGen_MachO_implicit_templates1 + + + MWDisassembler_PPC_showcode1 + MWDisassembler_PPC_extended1 + MWDisassembler_PPC_mix0 + MWDisassembler_PPC_nohex0 + MWDisassembler_PPC_showdata1 + MWDisassembler_PPC_showexceptions1 + MWDisassembler_PPC_showsym0 + MWDisassembler_PPC_shownames1 + + + GlobalOptimizer_PPC_optimizationlevelLevel0 + GlobalOptimizer_PPC_optforSpeed + + + MWLinker_PPC_linksym1 + MWLinker_PPC_symfullpath1 + MWLinker_PPC_linkmap0 + MWLinker_PPC_nolinkwarnings0 + MWLinker_PPC_dontdeadstripinitcode0 + MWLinker_PPC_permitmultdefs0 + MWLinker_PPC_linkmodeFast + MWLinker_PPC_initname__NSInitialize + MWLinker_PPC_mainname + MWLinker_PPC_termnameCleanupTermProc + + + MWLinker_MachO_exportsNone + MWLinker_MachO_mainnamestart + MWLinker_MachO_currentversion0 + MWLinker_MachO_compatibleversion0 + MWLinker_MachO_symfullpath0 + MWLinker_MachO_supresswarnings0 + MWLinker_MachO_multisymerror0 + MWLinker_MachO_prebind1 + MWLinker_MachO_deadstrip1 + MWLinker_MachO_objectivecsemantics0 + MWLinker_MachO_whichfileloaded0 + MWLinker_MachO_whyfileloaded0 + MWLinker_MachO_readonlyrelocsErrors + MWLinker_MachO_undefinedsymbolsErrors + MWLinker_MachO_twolevelnamespace1 + MWLinker_MachO_stripdebugsymbols0 + + + MWProject_MachO_typeExecutable + MWProject_MachO_outfilea.exe + MWProject_MachO_filecreator???? + MWProject_MachO_filetypeMEXE + MWProject_MachO_stacksize64 + MWProject_MachO_stackaddress0 + MWProject_MachO_flatrsrc1 + MWProject_MachO_flatrsrcfilenamea.rsrc + MWProject_MachO_flatrsrcoutputdir + Path: + PathFormatMacOS + PathRootProject + + MWProject_MachO_installpath./ + + + MWPEF_exportsPragma + MWPEF_libfolder0 + MWPEF_sortcodeNone + MWPEF_expandbss0 + MWPEF_sharedata0 + MWPEF_olddefversion400 + MWPEF_oldimpversion400 + MWPEF_currentversion401 + MWPEF_fragmentnameNSPR20 + MWPEF_collapsereloads0 + + + MWProject_PPC_typeSharedLibrary + MWProject_PPC_outfileNSPR20.shlb + MWProject_PPC_filecreatorMOZZ + MWProject_PPC_filetypeshlb + MWProject_PPC_size0 + MWProject_PPC_minsize0 + MWProject_PPC_stacksize0 + MWProject_PPC_flags0 + MWProject_PPC_symfilename + MWProject_PPC_rsrcname + MWProject_PPC_rsrcheaderNative + MWProject_PPC_rsrctype???? + MWProject_PPC_rsrcid0 + MWProject_PPC_rsrcflags0 + MWProject_PPC_rsrcstore0 + MWProject_PPC_rsrcmerge0 + MWProject_PPC_flatrsrc0 + MWProject_PPC_flatrsrcoutputdir + Path: + PathFormatMacOS + PathRootProject + + MWProject_PPC_flatrsrcfilename + + + MWAssembler_PPC_auxheader0 + MWAssembler_PPC_symmodeMac + MWAssembler_PPC_dialectPPC + MWAssembler_PPC_prefixfile + MWAssembler_PPC_typecheck0 + MWAssembler_PPC_warnings0 + MWAssembler_PPC_casesensitive0 + + + MWRez_Language_maxwidth80 + MWRez_Language_scriptRoman + MWRez_Language_alignmentAlign1 + MWRez_Language_filtermodeFilterSkip + MWRez_Language_suppresswarnings0 + MWRez_Language_escapecontrolchars1 + MWRez_Language_prefixname + MWRez_Language_filteredtypes'CODE' 'DATA' 'PICT' + + + MWWinRC_prefixname + + + MWCodeGen_X86_processorGeneric + MWCodeGen_X86_alignmentbytes8 + MWCodeGen_X86_exceptionsZeroOverhead + MWCodeGen_X86_extinst_mmx0 + MWCodeGen_X86_extinst_3dnow0 + MWCodeGen_X86_use_mmx_3dnow_convention0 + MWCodeGen_X86_machinecodelisting0 + MWCodeGen_X86_intrinsics0 + MWCodeGen_X86_syminfo0 + MWCodeGen_X86_codeviewinfo1 + MWCodeGen_X86_extinst_cmov_fcomi0 + MWCodeGen_X86_extinst_sse0 + + + PDisasmX86_showHeaderstrue + PDisasmX86_showSymTabtrue + PDisasmX86_showCodetrue + PDisasmX86_showSourcefalse + PDisasmX86_showHextrue + PDisasmX86_showRelocationtrue + PDisasmX86_showCommentsfalse + PDisasmX86_showDebugfalse + PDisasmX86_showExceptionsfalse + PDisasmX86_showDatatrue + PDisasmX86_showRawfalse + PDisasmX86_verbosefalse + + + MWDebugger_X86_Exceptions + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + GlobalOptimizer_X86_optimizationlevelLevel0 + GlobalOptimizer_X86_optforSpeed + + + MWLinker_X86_entrypointusageDefault + MWLinker_X86_entrypoint + MWLinker_X86_subsystemWinGUI + MWLinker_X86_subsysmajorid4 + MWLinker_X86_subsysminorid0 + MWLinker_X86_usrmajorid0 + MWLinker_X86_usrminorid0 + MWLinker_X86_commandfile + MWLinker_X86_generatemap0 + MWLinker_X86_linksym0 + MWLinker_X86_linkCV1 + + + MWProject_X86_typeApplication + MWProject_X86_outfilenoname.exe + MWProject_X86_baseaddress4194304 + MWProject_X86_maxstacksize1024 + MWProject_X86_minstacksize4 + MWProject_X86_size1024 + MWProject_X86_minsize4 + MWProject_X86_importlib + xpidl Settings + 0001000101000000000000000000000000000000000000000000000000000000 + 0000000000000000 + + + + + Name + plarena.c + MacOS + Text + Debug + + + Name + plhash.c + MacOS + Text + Debug + + + Name + plerror.c + MacOS + Text + Debug + + + Name + plgetopt.c + MacOS + Text + Debug + + + Name + strcat.c + MacOS + Text + Debug + + + Name + strccmp.c + MacOS + Text + Debug + + + Name + strchr.c + MacOS + Text + Debug + + + Name + strcmp.c + MacOS + Text + Debug + + + Name + strcpy.c + MacOS + Text + Debug + + + Name + strcstr.c + MacOS + Text + Debug + + + Name + strdup.c + MacOS + Text + Debug + + + Name + strlen.c + MacOS + Text + Debug + + + Name + strpbrk.c + MacOS + Text + Debug + + + Name + strstr.c + MacOS + Text + Debug + + + Name + pralarm.c + MacOS + Text + Debug + + + Name + pratom.c + MacOS + Text + Debug + + + Name + prdtoa.c + MacOS + Text + Debug + + + Name + prenv.c + MacOS + Text + Debug + + + Name + prerror.c + MacOS + Text + Debug + + + Name + prinit.c + MacOS + Text + Debug + + + Name + prinrval.c + MacOS + Text + Debug + + + Name + prlog2.c + MacOS + Text + Debug + + + Name + prlong.c + MacOS + Text + Debug + + + Name + prnetdb.c + MacOS + Text + Debug + + + Name + prsystem.c + MacOS + Text + Debug + + + Name + prtime.c + MacOS + Text + Debug + + + Name + prdir.c + MacOS + Text + Debug + + + Name + prfile.c + MacOS + Text + Debug + + + Name + prio.c + MacOS + Text + Debug + + + Name + prlog.c + MacOS + Text + Debug + + + Name + prmapopt.c + MacOS + Text + Debug + + + Name + prprf.c + MacOS + Text + Debug + + + Name + prsocket.c + MacOS + Text + Debug + + + Name + prstdio.c + MacOS + Text + Debug + + + Name + prlink.c + MacOS + Text + Debug + + + Name + prmem.c + MacOS + Text + Debug + + + Name + prseg.c + MacOS + Text + Debug + + + Name + prcmon.c + MacOS + Text + Debug + + + Name + prcthr.c + MacOS + Text + Debug + + + Name + prdump.c + MacOS + Text + Debug + + + Name + prmon.c + MacOS + Text + Debug + + + Name + prsem.c + MacOS + Text + Debug + + + Name + prtpd.c + MacOS + Text + Debug + + + Name + prucpu.c + MacOS + Text + Debug + + + Name + prucv.c + MacOS + Text + Debug + + + Name + prulock.c + MacOS + Text + Debug + + + Name + prustack.c + MacOS + Text + Debug + + + Name + pruthr.c + MacOS + Text + Debug + + + Name + prosdep.c + MacOS + Text + Debug + + + Name + macdll.c + MacOS + Text + Debug + + + Name + macio.c + MacOS + Text + Debug + + + Name + macthr.c + MacOS + Text + Debug + + + Name + mactime.c + MacOS + Text + Debug + + + Name + mdmac.c + MacOS + Text + Debug + + + Name + priometh.c + MacOS + Text + Debug + + + Name + prthinfo.c + MacOS + Text + Debug + + + Name + prlayer.c + MacOS + Text + Debug + + + Name + prscanf.c + MacOS + Text + Debug + + + Name + NSStdLibStubs + MacOS + Library + Debug + + + Name + macsockotpt.c + MacOS + Text + Debug + + + Name + NSRuntime.shlb + MacOS + Library + + + + Name + base64.c + MacOS + Text + Debug + + + Name + prfdcach.c + MacOS + Text + Debug + + + Name + prpolevt.c + MacOS + Text + Debug + + + Name + prmmap.c + MacOS + Text + Debug + + + Name + prmwait.c + MacOS + Text + Debug + + + Name + prcountr.c + MacOS + Text + Debug + + + Name + prolock.c + MacOS + Text + Debug + + + Name + prtrace.c + MacOS + Text + Debug + + + Name + InterfacesStubs + MacOS + Library + + + + Name + prerr.c + MacOS + Text + Debug + + + Name + prerrortable.c + MacOS + Text + Debug + + + Name + prrwlock.c + MacOS + Text + Debug + + + Name + NSLibraryStartup.o + MacOS + Library + Debug + + + Name + prshm.c + MacOS + Text + Debug + + + Name + prshma.c + MacOS + Text + Debug + + + Name + pripc.c + MacOS + Text + Debug + + + Name + pripcsem.c + MacOS + Text + Debug + + + Name + prrng.c + MacOS + Text + Debug + + + Name + macrng.c + MacOS + Text + Debug + + + Name + prgcleak.c + MacOS + Text + Debug + + + Name + pripv6.c + MacOS + Text + Debug + + + Name + OpenTransportAppPPC.o + MacOS + Library + Debug + + + Name + OpenTptInetPPC.o + MacOS + Library + Debug + + + Name + prvrsion.c + MacOS + Text + Debug + + + Name + mdcriticalregion.c + MacOS + Text + Debug + + + Name + strtok.c + MacOS + Text + Debug + + + + + Name + NSLibraryStartup.o + MacOS + + + Name + InterfacesStubs + MacOS + + + Name + plarena.c + MacOS + + + Name + plhash.c + MacOS + + + Name + plerror.c + MacOS + + + Name + plgetopt.c + MacOS + + + Name + strcat.c + MacOS + + + Name + strccmp.c + MacOS + + + Name + strchr.c + MacOS + + + Name + strcmp.c + MacOS + + + Name + strcpy.c + MacOS + + + Name + strcstr.c + MacOS + + + Name + strdup.c + MacOS + + + Name + strlen.c + MacOS + + + Name + strpbrk.c + MacOS + + + Name + strstr.c + MacOS + + + Name + strtok.c + MacOS + + + Name + pralarm.c + MacOS + + + Name + pratom.c + MacOS + + + Name + prdtoa.c + MacOS + + + Name + prenv.c + MacOS + + + Name + prerror.c + MacOS + + + Name + prinit.c + MacOS + + + Name + prinrval.c + MacOS + + + Name + prlog2.c + MacOS + + + Name + prlong.c + MacOS + + + Name + prnetdb.c + MacOS + + + Name + prsystem.c + MacOS + + + Name + prtime.c + MacOS + + + Name + prdir.c + MacOS + + + Name + prfile.c + MacOS + + + Name + prio.c + MacOS + + + Name + prlog.c + MacOS + + + Name + prmapopt.c + MacOS + + + Name + prprf.c + MacOS + + + Name + prsocket.c + MacOS + + + Name + prstdio.c + MacOS + + + Name + prlink.c + MacOS + + + Name + prmem.c + MacOS + + + Name + prseg.c + MacOS + + + Name + prcmon.c + MacOS + + + Name + prcthr.c + MacOS + + + Name + prdump.c + MacOS + + + Name + prlayer.c + MacOS + + + Name + prscanf.c + MacOS + + + Name + priometh.c + MacOS + + + Name + prmon.c + MacOS + + + Name + prsem.c + MacOS + + + Name + prthinfo.c + MacOS + + + Name + prtpd.c + MacOS + + + Name + prucpu.c + MacOS + + + Name + prucv.c + MacOS + + + Name + prulock.c + MacOS + + + Name + prustack.c + MacOS + + + Name + pruthr.c + MacOS + + + Name + prosdep.c + MacOS + + + Name + macdll.c + MacOS + + + Name + macio.c + MacOS + + + Name + macthr.c + MacOS + + + Name + mactime.c + MacOS + + + Name + mdmac.c + MacOS + + + Name + macsockotpt.c + MacOS + + + Name + NSRuntime.shlb + MacOS + + + Name + NSStdLibStubs + MacOS + + + Name + base64.c + MacOS + + + Name + prfdcach.c + MacOS + + + Name + prpolevt.c + MacOS + + + Name + prmmap.c + MacOS + + + Name + prmwait.c + MacOS + + + Name + prcountr.c + MacOS + + + Name + prolock.c + MacOS + + + Name + prtrace.c + MacOS + + + Name + prerr.c + MacOS + + + Name + prerrortable.c + MacOS + + + Name + prrwlock.c + MacOS + + + Name + prshm.c + MacOS + + + Name + prshma.c + MacOS + + + Name + pripc.c + MacOS + + + Name + pripcsem.c + MacOS + + + Name + prrng.c + MacOS + + + Name + macrng.c + MacOS + + + Name + prgcleak.c + MacOS + + + Name + pripv6.c + MacOS + + + Name + OpenTransportAppPPC.o + MacOS + + + Name + OpenTptInetPPC.o + MacOS + + + Name + prvrsion.c + MacOS + + + Name + mdcriticalregion.c + MacOS + + + + + NSPR20Debug.shlb + + + + UserSourceTrees + + + AlwaysSearchUserPathsfalse + InterpretDOSAndUnixPathsfalse + RequireFrameworkStyleIncludesfalse + UserSearchPaths + + SearchPath + Path: + PathFormatMacOS + PathRootProject + + Recursivetrue + FrameworkPathfalse + HostFlagsAll + + + SearchPath + Path:: + PathFormatMacOS + PathRootProject + + Recursivetrue + FrameworkPathfalse + HostFlagsAll + + + SearchPath + Path:::dist: + PathFormatMacOS + PathRootProject + + Recursivetrue + FrameworkPathfalse + HostFlagsAll + + + SystemSearchPaths + + SearchPath + Path:MSL: + PathFormatMacOS + PathRootCodeWarrior + + Recursivetrue + FrameworkPathfalse + HostFlagsAll + + + SearchPath + Path:MacOS Support: + PathFormatMacOS + PathRootCodeWarrior + + Recursivetrue + FrameworkPathfalse + HostFlagsMacOS + + + + + MWRuntimeSettings_WorkingDirectory + MWRuntimeSettings_CommandLine + MWRuntimeSettings_HostApplication + Path + PathFormatGeneric + PathRootAbsolute + + MWRuntimeSettings_EnvVars + + + LinkerMacOS PPC Linker + PreLinker + PostLinker + TargetnameNSPR20Debug.shlb + OutputDirectory + Path: + PathFormatMacOS + PathRootProject + + SaveEntriesUsingRelativePathsfalse + + + FileMappings + + FileTypeAPPL + FileExtension + Compiler + EditLanguage + Precompilefalse + Launchabletrue + ResourceFiletrue + IgnoredByMakefalse + + + FileTypeAppl + FileExtension + Compiler + EditLanguage + Precompilefalse + Launchabletrue + ResourceFiletrue + IgnoredByMakefalse + + + FileTypeMMLB + FileExtension + CompilerLib Import PPC + EditLanguage + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeMPLF + FileExtension + CompilerLib Import PPC + EditLanguage + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeMWCD + FileExtension + Compiler + EditLanguage + Precompilefalse + Launchabletrue + ResourceFiletrue + IgnoredByMakefalse + + + FileTypeRSRC + FileExtension + Compiler + EditLanguage + Precompilefalse + Launchabletrue + ResourceFiletrue + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.bh + CompilerBalloon Help + EditLanguage + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.c + CompilerMW C/C++ PPC + EditLanguageC/C++ + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.c++ + CompilerMW C/C++ PPC + EditLanguageC/C++ + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.cc + CompilerMW C/C++ PPC + EditLanguageC/C++ + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.cp + CompilerMW C/C++ PPC + EditLanguageC/C++ + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.cpp + CompilerMW C/C++ PPC + EditLanguageC/C++ + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.exp + Compiler + EditLanguage + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.h + CompilerMW C/C++ PPC + EditLanguageC/C++ + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMaketrue + + + FileTypeTEXT + FileExtension.p + CompilerMW Pascal PPC + EditLanguage + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.pas + CompilerMW Pascal PPC + EditLanguage + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.pch + CompilerMW C/C++ PPC + EditLanguageC/C++ + Precompiletrue + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.pch++ + CompilerMW C/C++ PPC + EditLanguageC/C++ + Precompiletrue + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.r + CompilerRez + EditLanguageRez + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.s + CompilerPPCAsm + EditLanguage + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeXCOF + FileExtension + CompilerXCOFF Import PPC + EditLanguage + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypedocu + FileExtension + Compiler + EditLanguage + Precompilefalse + Launchabletrue + ResourceFiletrue + IgnoredByMakefalse + + + FileTypersrc + FileExtension + Compiler + EditLanguage + Precompilefalse + Launchabletrue + ResourceFiletrue + IgnoredByMakefalse + + + FileTypeshlb + FileExtension + CompilerPEF Import PPC + EditLanguage + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypestub + FileExtension + CompilerPEF Import PPC + EditLanguage + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileExtension.doc + Compiler + EditLanguage + Precompilefalse + Launchabletrue + ResourceFilefalse + IgnoredByMaketrue + + + + + CacheModDatesfalse + ActivateBrowsertrue + DumpBrowserInfofalse + CacheSubprojectstrue + UseThirdPartyDebuggerfalse + DebuggerAppPath + Path + PathFormatGeneric + PathRootAbsolute + + DebuggerCmdLineArgs + DebuggerWorkingDir + Path + PathFormatGeneric + PathRootAbsolute + + + + LogSystemMessagestrue + AutoTargetDLLsfalse + StopAtWatchpointstrue + PauseWhileRunningfalse + PauseInterval5 + PauseUIFlags0 + AltExePath + Path + PathFormatGeneric + PathRootAbsolute + + StopAtTempBPOnLaunchtrue + CacheSymbolicstrue + TempBPFunctionNamemain + TempBPType0 + + + Enabledfalse + ConnectionName + DownloadPath + LaunchRemoteAppfalse + RemoteAppPath + + + OtherExecutables + + + CustomColor1 + Red0 + Green39321 + Blue0 + + CustomColor2 + Red0 + Green32767 + Blue0 + + CustomColor3 + Red0 + Green32767 + Blue0 + + CustomColor4 + Red0 + Green32767 + Blue0 + + + + MWFrontEnd_C_cplusplus0 + MWFrontEnd_C_checkprotos0 + MWFrontEnd_C_arm0 + MWFrontEnd_C_trigraphs0 + MWFrontEnd_C_onlystdkeywords0 + MWFrontEnd_C_enumsalwaysint1 + MWFrontEnd_C_mpwpointerstyle0 + MWFrontEnd_C_prefixnameNSPRDebug.Prefix + MWFrontEnd_C_ansistrict0 + MWFrontEnd_C_mpwcnewline0 + MWFrontEnd_C_wchar_type1 + MWFrontEnd_C_enableexceptions1 + MWFrontEnd_C_dontreusestrings0 + MWFrontEnd_C_poolstrings0 + MWFrontEnd_C_dontinline0 + MWFrontEnd_C_useRTTI0 + MWFrontEnd_C_multibyteaware0 + MWFrontEnd_C_unsignedchars0 + MWFrontEnd_C_autoinline0 + MWFrontEnd_C_booltruefalse0 + MWFrontEnd_C_direct_to_som0 + MWFrontEnd_C_som_env_check0 + MWFrontEnd_C_alwaysinline0 + MWFrontEnd_C_inlinelevel0 + MWFrontEnd_C_ecplusplus0 + MWFrontEnd_C_objective_c0 + MWFrontEnd_C_defer_codegen0 + + + MWWarning_C_warn_illpragma1 + MWWarning_C_warn_emptydecl1 + MWWarning_C_warn_possunwant1 + MWWarning_C_warn_unusedvar1 + MWWarning_C_warn_unusedarg1 + MWWarning_C_warn_extracomma1 + MWWarning_C_pedantic1 + MWWarning_C_warningerrors0 + MWWarning_C_warn_hidevirtual1 + MWWarning_C_warn_implicitconv0 + MWWarning_C_warn_notinlined0 + MWWarning_C_warn_structclass0 + + + MWFTP_Post_hostName + MWFTP_Post_username + MWFTP_Post_password0 + MWFTP_Post_remoteDir + MWFTP_Post_ftp_PathVersion1 + MWFTP_Post_ftp_PathType0 + MWFTP_Post_ftp_PathFormat0 + MWFTP_Post_ftp_tree + MWFTP_Post_uploadDir + MWFTP_Post_ftp_port21 + MWFTP_Post_SendBin1 + MWFTP_Post_ShouldLog1 + + + MWCommandLine_Java_clsName + MWCommandLine_Java_args + + + MWVJavaDebugging_Protocol1 + MWVJavaDebugging_JDKVersion1 + MWVJavaDebugging_TimeOut10 + MWVJavaDebugging_SupportSlowDevicesfalse + + + MWJava_Language_optimizefalse + MWJava_Language_warnDeprecatedfalse + MWJava_Language_emitMapfalse + MWJava_Language_strictFileNamesfalse + MWJava_Language_strictFileHierarchyfalse + MWJava_Language_1_1_Compatiblefalse + MWJava_Language_emitHeaders0 + MWJava_Language_headerTypeJNINativeHeaders + MWJava_Language_packageFilter + MWJava_Language_genCommentstrue + MWJava_Language_genHeadersfalse + + + MWJava_MRJAppBuilder_outFileMRJApplication + MWJava_MRJAppBuilder_mergefalse + MWJava_MRJAppBuilder_quitMenutrue + MWJava_MRJAppBuilder_growfalse + MWJava_MRJAppBuilder_stdoutTypeConsole + MWJava_MRJAppBuilder_stderrTypeConsole + MWJava_MRJAppBuilder_stdinTypeConsole + MWJava_MRJAppBuilder_appIconPVersion0 + MWJava_MRJAppBuilder_appIconPType0 + MWJava_MRJAppBuilder_appIconPFormat0 + MWJava_MRJAppBuilder_appIconPTree + MWJava_MRJAppBuilder_appIconFile + MWJava_MRJAppBuilder_splashScreenPVersion0 + MWJava_MRJAppBuilder_splashScreenPType0 + MWJava_MRJAppBuilder_splashScreenPFormat0 + MWJava_MRJAppBuilder_splashScreenPTree + MWJava_MRJAppBuilder_splashScreenPICTFile + MWJava_MRJAppBuilder_aboutName + MWJava_MRJAppBuilder_stdoutPVersion0 + MWJava_MRJAppBuilder_stdoutPType0 + MWJava_MRJAppBuilder_stdoutPFormat0 + MWJava_MRJAppBuilder_stdoutPTree + MWJava_MRJAppBuilder_stdoutFile + MWJava_MRJAppBuilder_stdoutAppendfalse + MWJava_MRJAppBuilder_stderrPType0 + MWJava_MRJAppBuilder_stderrPFormat0 + MWJava_MRJAppBuilder_stderrPTree + MWJava_MRJAppBuilder_stderrFile + MWJava_MRJAppBuilder_stderrAppendfalse + MWJava_MRJAppBuilder_stdinPType0 + MWJava_MRJAppBuilder_stdinPFormat0 + MWJava_MRJAppBuilder_stdinPTree + MWJava_MRJAppBuilder_stdinFile + + + MWJava_Output_outputtypeJarFile + MWJava_Output_outfileJavaClasses.jar + MWJava_Output_ftype1514754080 + MWJava_Output_fcreator1297570384 + MWJava_Output_compress0 + MWJava_Output_genManifest0 + MWJava_Output_trunctypeFront + MWJava_Output_deleteClasses0 + MWJava_Output_consoleApp1 + + + MWJava_Proj_projtypeApplet + MWJava_Proj_mainClassName + MWJava_Proj_HTMLAppCreator1145457748 + MWJava_Proj_HTMLAppNameApple Applet Runner + MWJava_Proj_PathVersion1 + MWJava_Proj_PathType0 + MWJava_Proj_PathFormat0 + MWJava_Proj_tree + MWJava_Proj_HTMLAppWin32NameInternet Explorer + MWJava_Proj_compress0 + MWJava_Proj_useVM1 + MWJava_Proj_vmarguments + MWJava_Proj_vmName + MWJava_Proj_simPropFile + + + MWJavaDoc_Proj_Version1 + MWJavaDoc_Proj_Depricated1 + MWJavaDoc_Proj_Author1 + MWJavaDoc_Proj_Index1 + MWJavaDoc_Proj_Tree1 + MWJavaDoc_Proj_SunResolveToSame0 + MWJavaDoc_Proj_Shortnames1 + MWJavaDoc_Proj_Folder0 + MWJavaDoc_Proj_GenerateAPILinks0 + MWJavaDoc_Proj_scopePublic + MWJavaDoc_Proj_fcreator1297303877 + MWJavaDoc_Proj_encodingName + MWJavaDoc_Proj_decodingName + MWJavaDoc_Proj_javaPackagePathhttp://java.sun.com/products/jdk/1.1/docs/api/ + + + MWMerge_MacOS_projectTypeApplication + MWMerge_MacOS_outputNameMerge Out + MWMerge_MacOS_outputCreator???? + MWMerge_MacOS_outputTypeAPPL + MWMerge_MacOS_suppressWarning0 + MWMerge_MacOS_copyFragments1 + MWMerge_MacOS_copyResources1 + MWMerge_MacOS_flattenResource0 + MWMerge_MacOS_flatFileNamea.rsrc + MWMerge_MacOS_flatFileOutputPath + Path: + PathFormatMacOS + PathRootProject + + MWMerge_MacOS_skipResources + DLGX + ckid + Proj + WSPC + + + + FileLockedfalse + ResourcesMapIsReadOnlyfalse + PrinterDriverIsMultiFinderCompatiblefalse + Invisiblefalse + HasBundlefalse + NameLockedfalse + Stationeryfalse + HasCustomIconfalse + Sharedfalse + HasBeenInitedfalse + Label0 + Comments + + + MWMacOSPackager_UsePackager0 + MWMacOSPackager_FolderToPackage + Path: + PathFormatMacOS + PathRootProject + + MWMacOSPackager_CreateClassicAlias0 + MWMacOSPackager_ClassicAliasMethodUseTargetOutput + MWMacOSPackager_ClassicAliasPath + Path: + PathFormatMacOS + PathRootProject + + MWMacOSPackager_CreatePkgInfo0 + MWMacOSPackager_PkgCreatorType???? + MWMacOSPackager_PkgFileTypeAPPL + + + MWCodeGen_PPC_structalignmentPPC + MWCodeGen_PPC_tracebacktablesInline + MWCodeGen_PPC_processorGeneric + MWCodeGen_PPC_readonlystrings1 + MWCodeGen_PPC_tocdata1 + MWCodeGen_PPC_profiler0 + MWCodeGen_PPC_fpcontract1 + MWCodeGen_PPC_schedule0 + MWCodeGen_PPC_peephole0 + MWCodeGen_PPC_processorspecific0 + MWCodeGen_PPC_altivec0 + MWCodeGen_PPC_vectortocdata0 + MWCodeGen_PPC_vrsave0 + + + MWCodeGen_MachO_structalignmentPPC + MWCodeGen_MachO_tracebacktablesNone + MWCodeGen_MachO_processorGeneric + MWCodeGen_MachO_readonlystrings0 + MWCodeGen_MachO_profiler0 + MWCodeGen_MachO_fpcontract1 + MWCodeGen_MachO_schedule0 + MWCodeGen_MachO_peephole1 + MWCodeGen_MachO_processorspecific0 + MWCodeGen_MachO_altivec0 + MWCodeGen_MachO_vrsave1 + MWCodeGen_MachO_common0 + MWCodeGen_MachO_implicit_templates1 + + + MWDisassembler_PPC_showcode1 + MWDisassembler_PPC_extended1 + MWDisassembler_PPC_mix0 + MWDisassembler_PPC_nohex0 + MWDisassembler_PPC_showdata1 + MWDisassembler_PPC_showexceptions1 + MWDisassembler_PPC_showsym0 + MWDisassembler_PPC_shownames1 + + + GlobalOptimizer_PPC_optimizationlevelLevel0 + GlobalOptimizer_PPC_optforSpeed + + + MWLinker_PPC_linksym1 + MWLinker_PPC_symfullpath1 + MWLinker_PPC_linkmap0 + MWLinker_PPC_nolinkwarnings0 + MWLinker_PPC_dontdeadstripinitcode0 + MWLinker_PPC_permitmultdefs0 + MWLinker_PPC_linkmodeFast + MWLinker_PPC_initname__NSInitialize + MWLinker_PPC_mainname + MWLinker_PPC_termnameCleanupTermProc + + + MWLinker_MachO_exportsNone + MWLinker_MachO_mainnamestart + MWLinker_MachO_currentversion0 + MWLinker_MachO_compatibleversion0 + MWLinker_MachO_symfullpath0 + MWLinker_MachO_supresswarnings0 + MWLinker_MachO_multisymerror0 + MWLinker_MachO_prebind1 + MWLinker_MachO_deadstrip1 + MWLinker_MachO_objectivecsemantics0 + MWLinker_MachO_whichfileloaded0 + MWLinker_MachO_whyfileloaded0 + MWLinker_MachO_readonlyrelocsErrors + MWLinker_MachO_undefinedsymbolsErrors + MWLinker_MachO_twolevelnamespace1 + MWLinker_MachO_stripdebugsymbols0 + + + MWProject_MachO_typeExecutable + MWProject_MachO_outfilea.exe + MWProject_MachO_filecreator???? + MWProject_MachO_filetypeMEXE + MWProject_MachO_stacksize64 + MWProject_MachO_stackaddress0 + MWProject_MachO_flatrsrc1 + MWProject_MachO_flatrsrcfilenamea.rsrc + MWProject_MachO_flatrsrcoutputdir + Path: + PathFormatMacOS + PathRootProject + + MWProject_MachO_installpath./ + + + MWPEF_exportsPragma + MWPEF_libfolder0 + MWPEF_sortcodeNone + MWPEF_expandbss0 + MWPEF_sharedata0 + MWPEF_olddefversion400 + MWPEF_oldimpversion400 + MWPEF_currentversion401 + MWPEF_fragmentnameNSPR20 + MWPEF_collapsereloads0 + + + MWProject_PPC_typeSharedLibrary + MWProject_PPC_outfileNSPR20Debug.shlb + MWProject_PPC_filecreatorMOZZ + MWProject_PPC_filetypeshlb + MWProject_PPC_size0 + MWProject_PPC_minsize0 + MWProject_PPC_stacksize0 + MWProject_PPC_flags0 + MWProject_PPC_symfilename + MWProject_PPC_rsrcname + MWProject_PPC_rsrcheaderNative + MWProject_PPC_rsrctype???? + MWProject_PPC_rsrcid0 + MWProject_PPC_rsrcflags0 + MWProject_PPC_rsrcstore0 + MWProject_PPC_rsrcmerge0 + MWProject_PPC_flatrsrc0 + MWProject_PPC_flatrsrcoutputdir + Path: + PathFormatMacOS + PathRootProject + + MWProject_PPC_flatrsrcfilename + + + MWAssembler_PPC_auxheader0 + MWAssembler_PPC_symmodeMac + MWAssembler_PPC_dialectPPC + MWAssembler_PPC_prefixfile + MWAssembler_PPC_typecheck0 + MWAssembler_PPC_warnings0 + MWAssembler_PPC_casesensitive0 + + + MWRez_Language_maxwidth80 + MWRez_Language_scriptRoman + MWRez_Language_alignmentAlign1 + MWRez_Language_filtermodeFilterSkip + MWRez_Language_suppresswarnings0 + MWRez_Language_escapecontrolchars1 + MWRez_Language_prefixname + MWRez_Language_filteredtypes'CODE' 'DATA' 'PICT' + + + MWWinRC_prefixname + + + MWCodeGen_X86_processorGeneric + MWCodeGen_X86_alignmentbytes8 + MWCodeGen_X86_exceptionsZeroOverhead + MWCodeGen_X86_extinst_mmx0 + MWCodeGen_X86_extinst_3dnow0 + MWCodeGen_X86_use_mmx_3dnow_convention0 + MWCodeGen_X86_machinecodelisting0 + MWCodeGen_X86_intrinsics0 + MWCodeGen_X86_syminfo0 + MWCodeGen_X86_codeviewinfo1 + MWCodeGen_X86_extinst_cmov_fcomi0 + MWCodeGen_X86_extinst_sse0 + + + PDisasmX86_showHeaderstrue + PDisasmX86_showSymTabtrue + PDisasmX86_showCodetrue + PDisasmX86_showSourcefalse + PDisasmX86_showHextrue + PDisasmX86_showRelocationtrue + PDisasmX86_showCommentsfalse + PDisasmX86_showDebugfalse + PDisasmX86_showExceptionsfalse + PDisasmX86_showDatatrue + PDisasmX86_showRawfalse + PDisasmX86_verbosefalse + + + MWDebugger_X86_Exceptions + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + GlobalOptimizer_X86_optimizationlevelLevel0 + GlobalOptimizer_X86_optforSpeed + + + MWLinker_X86_entrypointusageDefault + MWLinker_X86_entrypoint + MWLinker_X86_subsystemWinGUI + MWLinker_X86_subsysmajorid4 + MWLinker_X86_subsysminorid0 + MWLinker_X86_usrmajorid0 + MWLinker_X86_usrminorid0 + MWLinker_X86_commandfile + MWLinker_X86_generatemap0 + MWLinker_X86_linksym0 + MWLinker_X86_linkCV1 + + + MWProject_X86_typeApplication + MWProject_X86_outfilenoname.exe + MWProject_X86_baseaddress4194304 + MWProject_X86_maxstacksize1024 + MWProject_X86_minstacksize4 + MWProject_X86_size1024 + MWProject_X86_minsize4 + MWProject_X86_importlib + xpidl Settings + 0001000101000000000000000000000000000000000000000000000000000000 + 0000000000000000 + + + + + Name + plarena.c + MacOS + Text + Debug + + + Name + plhash.c + MacOS + Text + Debug + + + Name + plerror.c + MacOS + Text + Debug + + + Name + plgetopt.c + MacOS + Text + Debug + + + Name + strcat.c + MacOS + Text + Debug + + + Name + strccmp.c + MacOS + Text + Debug + + + Name + strchr.c + MacOS + Text + Debug + + + Name + strcmp.c + MacOS + Text + Debug + + + Name + strcpy.c + MacOS + Text + Debug + + + Name + strcstr.c + MacOS + Text + Debug + + + Name + strdup.c + MacOS + Text + Debug + + + Name + strlen.c + MacOS + Text + Debug + + + Name + strpbrk.c + MacOS + Text + Debug + + + Name + strstr.c + MacOS + Text + Debug + + + Name + pralarm.c + MacOS + Text + Debug + + + Name + pratom.c + MacOS + Text + Debug + + + Name + prdtoa.c + MacOS + Text + Debug + + + Name + prenv.c + MacOS + Text + Debug + + + Name + prerror.c + MacOS + Text + Debug + + + Name + prinit.c + MacOS + Text + Debug + + + Name + prinrval.c + MacOS + Text + Debug + + + Name + prlog2.c + MacOS + Text + Debug + + + Name + prlong.c + MacOS + Text + Debug + + + Name + prnetdb.c + MacOS + Text + Debug + + + Name + prsystem.c + MacOS + Text + Debug + + + Name + prtime.c + MacOS + Text + Debug + + + Name + prdir.c + MacOS + Text + Debug + + + Name + prfile.c + MacOS + Text + Debug + + + Name + prio.c + MacOS + Text + Debug + + + Name + prlog.c + MacOS + Text + Debug + + + Name + prmapopt.c + MacOS + Text + Debug + + + Name + prprf.c + MacOS + Text + Debug + + + Name + prsocket.c + MacOS + Text + Debug + + + Name + prstdio.c + MacOS + Text + Debug + + + Name + prlink.c + MacOS + Text + Debug + + + Name + prmem.c + MacOS + Text + Debug + + + Name + prseg.c + MacOS + Text + Debug + + + Name + prcmon.c + MacOS + Text + Debug + + + Name + prcthr.c + MacOS + Text + Debug + + + Name + prdump.c + MacOS + Text + Debug + + + Name + prmon.c + MacOS + Text + Debug + + + Name + prsem.c + MacOS + Text + Debug + + + Name + prtpd.c + MacOS + Text + Debug + + + Name + prucpu.c + MacOS + Text + Debug + + + Name + prucv.c + MacOS + Text + Debug + + + Name + prulock.c + MacOS + Text + Debug + + + Name + prustack.c + MacOS + Text + Debug + + + Name + pruthr.c + MacOS + Text + Debug + + + Name + prosdep.c + MacOS + Text + Debug + + + Name + macdll.c + MacOS + Text + Debug + + + Name + macio.c + MacOS + Text + Debug + + + Name + macthr.c + MacOS + Text + Debug + + + Name + mactime.c + MacOS + Text + Debug + + + Name + mdmac.c + MacOS + Text + Debug + + + Name + priometh.c + MacOS + Text + Debug + + + Name + prthinfo.c + MacOS + Text + Debug + + + Name + prlayer.c + MacOS + Text + Debug + + + Name + prscanf.c + MacOS + Text + Debug + + + Name + NSStdLibStubs + MacOS + Library + Debug + + + Name + macsockotpt.c + MacOS + Text + Debug + + + Name + NSRuntimeDebug.shlb + MacOS + Library + Debug + + + Name + base64.c + MacOS + Text + Debug + + + Name + prfdcach.c + MacOS + Text + Debug + + + Name + prpolevt.c + MacOS + Text + Debug + + + Name + prmmap.c + MacOS + Text + Debug + + + Name + prmwait.c + MacOS + Text + Debug + + + Name + prcountr.c + MacOS + Text + Debug + + + Name + prolock.c + MacOS + Text + Debug + + + Name + prtrace.c + MacOS + Text + Debug + + + Name + InterfacesStubs + MacOS + Library + Debug + + + Name + prerr.c + MacOS + Text + Debug + + + Name + prerrortable.c + MacOS + Text + Debug + + + Name + prrwlock.c + MacOS + Text + Debug + + + Name + NSLibraryStartup.o + MacOS + Library + Debug + + + Name + prshm.c + MacOS + Text + Debug + + + Name + prshma.c + MacOS + Text + Debug + + + Name + pripc.c + MacOS + Text + Debug + + + Name + pripcsem.c + MacOS + Text + Debug + + + Name + prrng.c + MacOS + Text + Debug + + + Name + macrng.c + MacOS + Text + Debug + + + Name + prgcleak.c + MacOS + Text + Debug + + + Name + pripv6.c + MacOS + Text + Debug + + + Name + OpenTransportAppPPC.o + MacOS + Library + Debug + + + Name + OpenTptInetPPC.o + MacOS + Library + Debug + + + Name + prvrsion.c + MacOS + Text + Debug + + + Name + mdcriticalregion.c + MacOS + Text + Debug + + + Name + strtok.c + MacOS + Text + Debug + + + + + Name + NSLibraryStartup.o + MacOS + + + Name + InterfacesStubs + MacOS + + + Name + plarena.c + MacOS + + + Name + plhash.c + MacOS + + + Name + plerror.c + MacOS + + + Name + plgetopt.c + MacOS + + + Name + strcat.c + MacOS + + + Name + strccmp.c + MacOS + + + Name + strchr.c + MacOS + + + Name + strcmp.c + MacOS + + + Name + strcpy.c + MacOS + + + Name + strcstr.c + MacOS + + + Name + strdup.c + MacOS + + + Name + strlen.c + MacOS + + + Name + strpbrk.c + MacOS + + + Name + strstr.c + MacOS + + + Name + strtok.c + MacOS + + + Name + pralarm.c + MacOS + + + Name + pratom.c + MacOS + + + Name + prdtoa.c + MacOS + + + Name + prenv.c + MacOS + + + Name + prerror.c + MacOS + + + Name + prinit.c + MacOS + + + Name + prinrval.c + MacOS + + + Name + prlog2.c + MacOS + + + Name + prlong.c + MacOS + + + Name + prnetdb.c + MacOS + + + Name + prsystem.c + MacOS + + + Name + prtime.c + MacOS + + + Name + prdir.c + MacOS + + + Name + prfile.c + MacOS + + + Name + prio.c + MacOS + + + Name + prlog.c + MacOS + + + Name + prmapopt.c + MacOS + + + Name + prprf.c + MacOS + + + Name + prsocket.c + MacOS + + + Name + prstdio.c + MacOS + + + Name + prlink.c + MacOS + + + Name + prmem.c + MacOS + + + Name + prseg.c + MacOS + + + Name + prlayer.c + MacOS + + + Name + prscanf.c + MacOS + + + Name + prcmon.c + MacOS + + + Name + prcthr.c + MacOS + + + Name + prdump.c + MacOS + + + Name + priometh.c + MacOS + + + Name + prmon.c + MacOS + + + Name + prsem.c + MacOS + + + Name + prthinfo.c + MacOS + + + Name + prtpd.c + MacOS + + + Name + prucpu.c + MacOS + + + Name + prucv.c + MacOS + + + Name + prulock.c + MacOS + + + Name + prustack.c + MacOS + + + Name + pruthr.c + MacOS + + + Name + prosdep.c + MacOS + + + Name + macdll.c + MacOS + + + Name + macio.c + MacOS + + + Name + macthr.c + MacOS + + + Name + mactime.c + MacOS + + + Name + mdmac.c + MacOS + + + Name + macsockotpt.c + MacOS + + + Name + NSRuntimeDebug.shlb + MacOS + + + Name + NSStdLibStubs + MacOS + + + Name + base64.c + MacOS + + + Name + prfdcach.c + MacOS + + + Name + prpolevt.c + MacOS + + + Name + prmmap.c + MacOS + + + Name + prmwait.c + MacOS + + + Name + prcountr.c + MacOS + + + Name + prolock.c + MacOS + + + Name + prtrace.c + MacOS + + + Name + prerr.c + MacOS + + + Name + prerrortable.c + MacOS + + + Name + prrwlock.c + MacOS + + + Name + prshm.c + MacOS + + + Name + prshma.c + MacOS + + + Name + pripc.c + MacOS + + + Name + pripcsem.c + MacOS + + + Name + prrng.c + MacOS + + + Name + macrng.c + MacOS + + + Name + prgcleak.c + MacOS + + + Name + pripv6.c + MacOS + + + Name + OpenTransportAppPPC.o + MacOS + + + Name + OpenTptInetPPC.o + MacOS + + + Name + prvrsion.c + MacOS + + + Name + mdcriticalregion.c + MacOS + + + + + NSPR20Carbon.shlb + + + + UserSourceTrees + + + AlwaysSearchUserPathsfalse + InterpretDOSAndUnixPathsfalse + RequireFrameworkStyleIncludesfalse + UserSearchPaths + + SearchPath + Path: + PathFormatMacOS + PathRootProject + + Recursivetrue + FrameworkPathfalse + HostFlagsAll + + + SearchPath + Path:: + PathFormatMacOS + PathRootProject + + Recursivetrue + FrameworkPathfalse + HostFlagsAll + + + SearchPath + Path:::dist: + PathFormatMacOS + PathRootProject + + Recursivetrue + FrameworkPathfalse + HostFlagsAll + + + SystemSearchPaths + + SearchPath + Path:MSL: + PathFormatMacOS + PathRootCodeWarrior + + Recursivetrue + FrameworkPathfalse + HostFlagsAll + + + SearchPath + Path:MacOS Support: + PathFormatMacOS + PathRootCodeWarrior + + Recursivetrue + FrameworkPathfalse + HostFlagsMacOS + + + + + MWRuntimeSettings_WorkingDirectory + MWRuntimeSettings_CommandLine + MWRuntimeSettings_HostApplication + Path + PathFormatGeneric + PathRootAbsolute + + MWRuntimeSettings_EnvVars + + + LinkerMacOS PPC Linker + PreLinker + PostLinker + TargetnameNSPR20Carbon.shlb + OutputDirectory + Path: + PathFormatMacOS + PathRootProject + + SaveEntriesUsingRelativePathsfalse + + + FileMappings + + FileTypeAPPL + FileExtension + Compiler + EditLanguage + Precompilefalse + Launchabletrue + ResourceFiletrue + IgnoredByMakefalse + + + FileTypeAppl + FileExtension + Compiler + EditLanguage + Precompilefalse + Launchabletrue + ResourceFiletrue + IgnoredByMakefalse + + + FileTypeMMLB + FileExtension + CompilerLib Import PPC + EditLanguage + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeMPLF + FileExtension + CompilerLib Import PPC + EditLanguage + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeMWCD + FileExtension + Compiler + EditLanguage + Precompilefalse + Launchabletrue + ResourceFiletrue + IgnoredByMakefalse + + + FileTypeRSRC + FileExtension + Compiler + EditLanguage + Precompilefalse + Launchabletrue + ResourceFiletrue + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.bh + CompilerBalloon Help + EditLanguage + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.c + CompilerMW C/C++ PPC + EditLanguageC/C++ + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.c++ + CompilerMW C/C++ PPC + EditLanguageC/C++ + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.cc + CompilerMW C/C++ PPC + EditLanguageC/C++ + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.cp + CompilerMW C/C++ PPC + EditLanguageC/C++ + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.cpp + CompilerMW C/C++ PPC + EditLanguageC/C++ + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.exp + Compiler + EditLanguage + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.h + CompilerMW C/C++ PPC + EditLanguageC/C++ + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMaketrue + + + FileTypeTEXT + FileExtension.p + CompilerMW Pascal PPC + EditLanguage + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.pas + CompilerMW Pascal PPC + EditLanguage + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.pch + CompilerMW C/C++ PPC + EditLanguageC/C++ + Precompiletrue + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.pch++ + CompilerMW C/C++ PPC + EditLanguageC/C++ + Precompiletrue + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.r + CompilerRez + EditLanguageRez + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.s + CompilerPPCAsm + EditLanguage + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeXCOF + FileExtension + CompilerXCOFF Import PPC + EditLanguage + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypedocu + FileExtension + Compiler + EditLanguage + Precompilefalse + Launchabletrue + ResourceFiletrue + IgnoredByMakefalse + + + FileTypersrc + FileExtension + Compiler + EditLanguage + Precompilefalse + Launchabletrue + ResourceFiletrue + IgnoredByMakefalse + + + FileTypeshlb + FileExtension + CompilerPEF Import PPC + EditLanguage + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypestub + FileExtension + CompilerPEF Import PPC + EditLanguage + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileExtension.doc + Compiler + EditLanguage + Precompilefalse + Launchabletrue + ResourceFilefalse + IgnoredByMaketrue + + + + + CacheModDatesfalse + ActivateBrowsertrue + DumpBrowserInfofalse + CacheSubprojectstrue + UseThirdPartyDebuggerfalse + DebuggerAppPath + Path + PathFormatGeneric + PathRootAbsolute + + DebuggerCmdLineArgs + DebuggerWorkingDir + Path + PathFormatGeneric + PathRootAbsolute + + + + LogSystemMessagestrue + AutoTargetDLLsfalse + StopAtWatchpointstrue + PauseWhileRunningfalse + PauseInterval5 + PauseUIFlags0 + AltExePath + Path + PathFormatGeneric + PathRootAbsolute + + StopAtTempBPOnLaunchtrue + CacheSymbolicstrue + TempBPFunctionNamemain + TempBPType0 + + + Enabledfalse + ConnectionName + DownloadPath + LaunchRemoteAppfalse + RemoteAppPath + + + OtherExecutables + + + CustomColor1 + Red0 + Green39321 + Blue0 + + CustomColor2 + Red0 + Green32767 + Blue0 + + CustomColor3 + Red0 + Green32767 + Blue0 + + CustomColor4 + Red0 + Green32767 + Blue0 + + + + MWFrontEnd_C_cplusplus0 + MWFrontEnd_C_checkprotos0 + MWFrontEnd_C_arm0 + MWFrontEnd_C_trigraphs0 + MWFrontEnd_C_onlystdkeywords0 + MWFrontEnd_C_enumsalwaysint1 + MWFrontEnd_C_mpwpointerstyle0 + MWFrontEnd_C_prefixnameNSPRCarbon.Prefix + MWFrontEnd_C_ansistrict0 + MWFrontEnd_C_mpwcnewline0 + MWFrontEnd_C_wchar_type1 + MWFrontEnd_C_enableexceptions1 + MWFrontEnd_C_dontreusestrings0 + MWFrontEnd_C_poolstrings0 + MWFrontEnd_C_dontinline0 + MWFrontEnd_C_useRTTI0 + MWFrontEnd_C_multibyteaware0 + MWFrontEnd_C_unsignedchars0 + MWFrontEnd_C_autoinline0 + MWFrontEnd_C_booltruefalse0 + MWFrontEnd_C_direct_to_som0 + MWFrontEnd_C_som_env_check0 + MWFrontEnd_C_alwaysinline0 + MWFrontEnd_C_inlinelevel0 + MWFrontEnd_C_ecplusplus0 + MWFrontEnd_C_objective_c0 + MWFrontEnd_C_defer_codegen0 + + + MWWarning_C_warn_illpragma1 + MWWarning_C_warn_emptydecl1 + MWWarning_C_warn_possunwant1 + MWWarning_C_warn_unusedvar1 + MWWarning_C_warn_unusedarg1 + MWWarning_C_warn_extracomma1 + MWWarning_C_pedantic1 + MWWarning_C_warningerrors0 + MWWarning_C_warn_hidevirtual1 + MWWarning_C_warn_implicitconv0 + MWWarning_C_warn_notinlined0 + MWWarning_C_warn_structclass0 + + + MWFTP_Post_hostName + MWFTP_Post_username + MWFTP_Post_password0 + MWFTP_Post_remoteDir + MWFTP_Post_ftp_PathVersion1 + MWFTP_Post_ftp_PathType0 + MWFTP_Post_ftp_PathFormat0 + MWFTP_Post_ftp_tree + MWFTP_Post_uploadDir + MWFTP_Post_ftp_port21 + MWFTP_Post_SendBin1 + MWFTP_Post_ShouldLog1 + + + MWCommandLine_Java_clsName + MWCommandLine_Java_args + + + MWVJavaDebugging_Protocol1 + MWVJavaDebugging_JDKVersion1 + MWVJavaDebugging_TimeOut10 + MWVJavaDebugging_SupportSlowDevicesfalse + + + MWJava_Language_optimizefalse + MWJava_Language_warnDeprecatedfalse + MWJava_Language_emitMapfalse + MWJava_Language_strictFileNamesfalse + MWJava_Language_strictFileHierarchyfalse + MWJava_Language_1_1_Compatiblefalse + MWJava_Language_emitHeaders0 + MWJava_Language_headerTypeJNINativeHeaders + MWJava_Language_packageFilter + MWJava_Language_genCommentstrue + MWJava_Language_genHeadersfalse + + + MWJava_MRJAppBuilder_outFileMRJApplication + MWJava_MRJAppBuilder_mergefalse + MWJava_MRJAppBuilder_quitMenutrue + MWJava_MRJAppBuilder_growfalse + MWJava_MRJAppBuilder_stdoutTypeConsole + MWJava_MRJAppBuilder_stderrTypeConsole + MWJava_MRJAppBuilder_stdinTypeConsole + MWJava_MRJAppBuilder_appIconPVersion0 + MWJava_MRJAppBuilder_appIconPType0 + MWJava_MRJAppBuilder_appIconPFormat0 + MWJava_MRJAppBuilder_appIconPTree + MWJava_MRJAppBuilder_appIconFile + MWJava_MRJAppBuilder_splashScreenPVersion0 + MWJava_MRJAppBuilder_splashScreenPType0 + MWJava_MRJAppBuilder_splashScreenPFormat0 + MWJava_MRJAppBuilder_splashScreenPTree + MWJava_MRJAppBuilder_splashScreenPICTFile + MWJava_MRJAppBuilder_aboutName + MWJava_MRJAppBuilder_stdoutPVersion0 + MWJava_MRJAppBuilder_stdoutPType0 + MWJava_MRJAppBuilder_stdoutPFormat0 + MWJava_MRJAppBuilder_stdoutPTree + MWJava_MRJAppBuilder_stdoutFile + MWJava_MRJAppBuilder_stdoutAppendfalse + MWJava_MRJAppBuilder_stderrPType0 + MWJava_MRJAppBuilder_stderrPFormat0 + MWJava_MRJAppBuilder_stderrPTree + MWJava_MRJAppBuilder_stderrFile + MWJava_MRJAppBuilder_stderrAppendfalse + MWJava_MRJAppBuilder_stdinPType0 + MWJava_MRJAppBuilder_stdinPFormat0 + MWJava_MRJAppBuilder_stdinPTree + MWJava_MRJAppBuilder_stdinFile + + + MWJava_Output_outputtypeJarFile + MWJava_Output_outfileJavaClasses.jar + MWJava_Output_ftype1514754080 + MWJava_Output_fcreator1297570384 + MWJava_Output_compress0 + MWJava_Output_genManifest0 + MWJava_Output_trunctypeFront + MWJava_Output_deleteClasses0 + MWJava_Output_consoleApp1 + + + MWJava_Proj_projtypeApplet + MWJava_Proj_mainClassName + MWJava_Proj_HTMLAppCreator1145457748 + MWJava_Proj_HTMLAppNameApple Applet Runner + MWJava_Proj_PathVersion1 + MWJava_Proj_PathType0 + MWJava_Proj_PathFormat0 + MWJava_Proj_tree + MWJava_Proj_HTMLAppWin32NameInternet Explorer + MWJava_Proj_compress0 + MWJava_Proj_useVM1 + MWJava_Proj_vmarguments + MWJava_Proj_vmName + MWJava_Proj_simPropFile + + + MWJavaDoc_Proj_Version1 + MWJavaDoc_Proj_Depricated1 + MWJavaDoc_Proj_Author1 + MWJavaDoc_Proj_Index1 + MWJavaDoc_Proj_Tree1 + MWJavaDoc_Proj_SunResolveToSame0 + MWJavaDoc_Proj_Shortnames1 + MWJavaDoc_Proj_Folder0 + MWJavaDoc_Proj_GenerateAPILinks0 + MWJavaDoc_Proj_scopePublic + MWJavaDoc_Proj_fcreator1297303877 + MWJavaDoc_Proj_encodingName + MWJavaDoc_Proj_decodingName + MWJavaDoc_Proj_javaPackagePathhttp://java.sun.com/products/jdk/1.1/docs/api/ + + + MWMerge_MacOS_projectTypeApplication + MWMerge_MacOS_outputNameMerge Out + MWMerge_MacOS_outputCreator???? + MWMerge_MacOS_outputTypeAPPL + MWMerge_MacOS_suppressWarning0 + MWMerge_MacOS_copyFragments1 + MWMerge_MacOS_copyResources1 + MWMerge_MacOS_flattenResource0 + MWMerge_MacOS_flatFileNamea.rsrc + MWMerge_MacOS_flatFileOutputPath + Path: + PathFormatMacOS + PathRootProject + + MWMerge_MacOS_skipResources + DLGX + ckid + Proj + WSPC + + + + FileLockedfalse + ResourcesMapIsReadOnlyfalse + PrinterDriverIsMultiFinderCompatiblefalse + Invisiblefalse + HasBundlefalse + NameLockedfalse + Stationeryfalse + HasCustomIconfalse + Sharedfalse + HasBeenInitedfalse + Label0 + Comments + + + MWMacOSPackager_UsePackager0 + MWMacOSPackager_FolderToPackage + Path: + PathFormatMacOS + PathRootProject + + MWMacOSPackager_CreateClassicAlias0 + MWMacOSPackager_ClassicAliasMethodUseTargetOutput + MWMacOSPackager_ClassicAliasPath + Path: + PathFormatMacOS + PathRootProject + + MWMacOSPackager_CreatePkgInfo0 + MWMacOSPackager_PkgCreatorType???? + MWMacOSPackager_PkgFileTypeAPPL + + + MWCodeGen_PPC_structalignmentPPC + MWCodeGen_PPC_tracebacktablesNone + MWCodeGen_PPC_processorGeneric + MWCodeGen_PPC_readonlystrings1 + MWCodeGen_PPC_tocdata1 + MWCodeGen_PPC_profiler0 + MWCodeGen_PPC_fpcontract1 + MWCodeGen_PPC_schedule0 + MWCodeGen_PPC_peephole0 + MWCodeGen_PPC_processorspecific0 + MWCodeGen_PPC_altivec0 + MWCodeGen_PPC_vectortocdata0 + MWCodeGen_PPC_vrsave0 + + + MWCodeGen_MachO_structalignmentPPC + MWCodeGen_MachO_tracebacktablesNone + MWCodeGen_MachO_processorGeneric + MWCodeGen_MachO_readonlystrings0 + MWCodeGen_MachO_profiler0 + MWCodeGen_MachO_fpcontract1 + MWCodeGen_MachO_schedule0 + MWCodeGen_MachO_peephole1 + MWCodeGen_MachO_processorspecific0 + MWCodeGen_MachO_altivec0 + MWCodeGen_MachO_vrsave1 + MWCodeGen_MachO_common0 + MWCodeGen_MachO_implicit_templates1 + + + MWDisassembler_PPC_showcode1 + MWDisassembler_PPC_extended1 + MWDisassembler_PPC_mix0 + MWDisassembler_PPC_nohex0 + MWDisassembler_PPC_showdata1 + MWDisassembler_PPC_showexceptions1 + MWDisassembler_PPC_showsym0 + MWDisassembler_PPC_shownames1 + + + GlobalOptimizer_PPC_optimizationlevelLevel0 + GlobalOptimizer_PPC_optforSpeed + + + MWLinker_PPC_linksym1 + MWLinker_PPC_symfullpath1 + MWLinker_PPC_linkmap0 + MWLinker_PPC_nolinkwarnings0 + MWLinker_PPC_dontdeadstripinitcode0 + MWLinker_PPC_permitmultdefs0 + MWLinker_PPC_linkmodeFast + MWLinker_PPC_initname__NSInitialize + MWLinker_PPC_mainname + MWLinker_PPC_termnameCleanupTermProc + + + MWLinker_MachO_exportsNone + MWLinker_MachO_mainnamestart + MWLinker_MachO_currentversion0 + MWLinker_MachO_compatibleversion0 + MWLinker_MachO_symfullpath0 + MWLinker_MachO_supresswarnings0 + MWLinker_MachO_multisymerror0 + MWLinker_MachO_prebind1 + MWLinker_MachO_deadstrip1 + MWLinker_MachO_objectivecsemantics0 + MWLinker_MachO_whichfileloaded0 + MWLinker_MachO_whyfileloaded0 + MWLinker_MachO_readonlyrelocsErrors + MWLinker_MachO_undefinedsymbolsErrors + MWLinker_MachO_twolevelnamespace1 + MWLinker_MachO_stripdebugsymbols0 + + + MWProject_MachO_typeExecutable + MWProject_MachO_outfilea.exe + MWProject_MachO_filecreator???? + MWProject_MachO_filetypeMEXE + MWProject_MachO_stacksize64 + MWProject_MachO_stackaddress0 + MWProject_MachO_flatrsrc1 + MWProject_MachO_flatrsrcfilenamea.rsrc + MWProject_MachO_flatrsrcoutputdir + Path: + PathFormatMacOS + PathRootProject + + MWProject_MachO_installpath./ + + + MWPEF_exportsPragma + MWPEF_libfolder0 + MWPEF_sortcodeNone + MWPEF_expandbss0 + MWPEF_sharedata0 + MWPEF_olddefversion400 + MWPEF_oldimpversion400 + MWPEF_currentversion401 + MWPEF_fragmentnameNSPR20 + MWPEF_collapsereloads0 + + + MWProject_PPC_typeSharedLibrary + MWProject_PPC_outfileNSPR20.shlb + MWProject_PPC_filecreatorMOZZ + MWProject_PPC_filetypeshlb + MWProject_PPC_size0 + MWProject_PPC_minsize0 + MWProject_PPC_stacksize0 + MWProject_PPC_flags0 + MWProject_PPC_symfilename + MWProject_PPC_rsrcname + MWProject_PPC_rsrcheaderNative + MWProject_PPC_rsrctype???? + MWProject_PPC_rsrcid0 + MWProject_PPC_rsrcflags0 + MWProject_PPC_rsrcstore0 + MWProject_PPC_rsrcmerge0 + MWProject_PPC_flatrsrc0 + MWProject_PPC_flatrsrcoutputdir + Path: + PathFormatMacOS + PathRootProject + + MWProject_PPC_flatrsrcfilename + + + MWAssembler_PPC_auxheader0 + MWAssembler_PPC_symmodeMac + MWAssembler_PPC_dialectPPC + MWAssembler_PPC_prefixfile + MWAssembler_PPC_typecheck0 + MWAssembler_PPC_warnings0 + MWAssembler_PPC_casesensitive0 + + + MWRez_Language_maxwidth80 + MWRez_Language_scriptRoman + MWRez_Language_alignmentAlign1 + MWRez_Language_filtermodeFilterSkip + MWRez_Language_suppresswarnings0 + MWRez_Language_escapecontrolchars1 + MWRez_Language_prefixname + MWRez_Language_filteredtypes'CODE' 'DATA' 'PICT' + + + MWWinRC_prefixname + + + MWCodeGen_X86_processorGeneric + MWCodeGen_X86_alignmentbytes8 + MWCodeGen_X86_exceptionsZeroOverhead + MWCodeGen_X86_extinst_mmx0 + MWCodeGen_X86_extinst_3dnow0 + MWCodeGen_X86_use_mmx_3dnow_convention0 + MWCodeGen_X86_machinecodelisting0 + MWCodeGen_X86_intrinsics0 + MWCodeGen_X86_syminfo0 + MWCodeGen_X86_codeviewinfo1 + MWCodeGen_X86_extinst_cmov_fcomi0 + MWCodeGen_X86_extinst_sse0 + + + PDisasmX86_showHeaderstrue + PDisasmX86_showSymTabtrue + PDisasmX86_showCodetrue + PDisasmX86_showSourcefalse + PDisasmX86_showHextrue + PDisasmX86_showRelocationtrue + PDisasmX86_showCommentsfalse + PDisasmX86_showDebugfalse + PDisasmX86_showExceptionsfalse + PDisasmX86_showDatatrue + PDisasmX86_showRawfalse + PDisasmX86_verbosefalse + + + MWDebugger_X86_Exceptions + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + GlobalOptimizer_X86_optimizationlevelLevel0 + GlobalOptimizer_X86_optforSpeed + + + MWLinker_X86_entrypointusageDefault + MWLinker_X86_entrypoint + MWLinker_X86_subsystemWinGUI + MWLinker_X86_subsysmajorid4 + MWLinker_X86_subsysminorid0 + MWLinker_X86_usrmajorid0 + MWLinker_X86_usrminorid0 + MWLinker_X86_commandfile + MWLinker_X86_generatemap0 + MWLinker_X86_linksym0 + MWLinker_X86_linkCV1 + + + MWProject_X86_typeApplication + MWProject_X86_outfilenoname.exe + MWProject_X86_baseaddress4194304 + MWProject_X86_maxstacksize1024 + MWProject_X86_minstacksize4 + MWProject_X86_size1024 + MWProject_X86_minsize4 + MWProject_X86_importlib + xpidl Settings + 0001000101000000000000000000000000000000000000000000000000000000 + 0000000000000000 + + + + + Name + plarena.c + MacOS + Text + Debug + + + Name + plhash.c + MacOS + Text + Debug + + + Name + plerror.c + MacOS + Text + Debug + + + Name + plgetopt.c + MacOS + Text + Debug + + + Name + strcat.c + MacOS + Text + Debug + + + Name + strccmp.c + MacOS + Text + Debug + + + Name + strchr.c + MacOS + Text + Debug + + + Name + strcmp.c + MacOS + Text + Debug + + + Name + strcpy.c + MacOS + Text + Debug + + + Name + strcstr.c + MacOS + Text + Debug + + + Name + strdup.c + MacOS + Text + Debug + + + Name + strlen.c + MacOS + Text + Debug + + + Name + strpbrk.c + MacOS + Text + Debug + + + Name + strstr.c + MacOS + Text + Debug + + + Name + pralarm.c + MacOS + Text + Debug + + + Name + pratom.c + MacOS + Text + Debug + + + Name + prdtoa.c + MacOS + Text + Debug + + + Name + prenv.c + MacOS + Text + Debug + + + Name + prerror.c + MacOS + Text + Debug + + + Name + prinit.c + MacOS + Text + Debug + + + Name + prinrval.c + MacOS + Text + Debug + + + Name + prlog2.c + MacOS + Text + Debug + + + Name + prlong.c + MacOS + Text + Debug + + + Name + prnetdb.c + MacOS + Text + Debug + + + Name + prsystem.c + MacOS + Text + Debug + + + Name + prtime.c + MacOS + Text + Debug + + + Name + prdir.c + MacOS + Text + Debug + + + Name + prfile.c + MacOS + Text + Debug + + + Name + prio.c + MacOS + Text + Debug + + + Name + prlog.c + MacOS + Text + Debug + + + Name + prmapopt.c + MacOS + Text + Debug + + + Name + prprf.c + MacOS + Text + Debug + + + Name + prsocket.c + MacOS + Text + Debug + + + Name + prstdio.c + MacOS + Text + Debug + + + Name + prlink.c + MacOS + Text + Debug + + + Name + prmem.c + MacOS + Text + Debug + + + Name + prseg.c + MacOS + Text + Debug + + + Name + prcmon.c + MacOS + Text + Debug + + + Name + prcthr.c + MacOS + Text + Debug + + + Name + prdump.c + MacOS + Text + Debug + + + Name + prmon.c + MacOS + Text + Debug + + + Name + prsem.c + MacOS + Text + Debug + + + Name + prtpd.c + MacOS + Text + Debug + + + Name + prucpu.c + MacOS + Text + Debug + + + Name + prucv.c + MacOS + Text + Debug + + + Name + prulock.c + MacOS + Text + Debug + + + Name + prustack.c + MacOS + Text + Debug + + + Name + pruthr.c + MacOS + Text + Debug + + + Name + prosdep.c + MacOS + Text + Debug + + + Name + macdll.c + MacOS + Text + Debug + + + Name + macio.c + MacOS + Text + Debug + + + Name + macthr.c + MacOS + Text + Debug + + + Name + mactime.c + MacOS + Text + Debug + + + Name + mdmac.c + MacOS + Text + Debug + + + Name + priometh.c + MacOS + Text + Debug + + + Name + prthinfo.c + MacOS + Text + Debug + + + Name + prlayer.c + MacOS + Text + Debug + + + Name + prscanf.c + MacOS + Text + Debug + + + Name + NSStdLibStubs + MacOS + Library + Debug + + + Name + macsockotpt.c + MacOS + Text + Debug + + + Name + NSRuntime.shlb + MacOS + Library + + + + Name + base64.c + MacOS + Text + Debug + + + Name + prfdcach.c + MacOS + Text + Debug + + + Name + prpolevt.c + MacOS + Text + Debug + + + Name + prmmap.c + MacOS + Text + Debug + + + Name + prmwait.c + MacOS + Text + Debug + + + Name + prcountr.c + MacOS + Text + Debug + + + Name + prolock.c + MacOS + Text + Debug + + + Name + prtrace.c + MacOS + Text + Debug + + + Name + InterfacesStubs + MacOS + Library + + + + Name + prerr.c + MacOS + Text + Debug + + + Name + prerrortable.c + MacOS + Text + Debug + + + Name + prrwlock.c + MacOS + Text + Debug + + + Name + NSLibraryStartup.o + MacOS + Library + Debug + + + Name + prshm.c + MacOS + Text + Debug + + + Name + prshma.c + MacOS + Text + Debug + + + Name + pripc.c + MacOS + Text + Debug + + + Name + pripcsem.c + MacOS + Text + Debug + + + Name + prrng.c + MacOS + Text + Debug + + + Name + macrng.c + MacOS + Text + Debug + + + Name + prgcleak.c + MacOS + Text + Debug + + + Name + pripv6.c + MacOS + Text + Debug + + + Name + prvrsion.c + MacOS + Text + Debug + + + Name + mdcriticalregion.c + MacOS + Text + Debug + + + Name + strtok.c + MacOS + Text + Debug + + + + + Name + NSLibraryStartup.o + MacOS + + + Name + InterfacesStubs + MacOS + + + Name + plarena.c + MacOS + + + Name + plhash.c + MacOS + + + Name + plerror.c + MacOS + + + Name + plgetopt.c + MacOS + + + Name + strcat.c + MacOS + + + Name + strccmp.c + MacOS + + + Name + strchr.c + MacOS + + + Name + strcmp.c + MacOS + + + Name + strcpy.c + MacOS + + + Name + strcstr.c + MacOS + + + Name + strdup.c + MacOS + + + Name + strlen.c + MacOS + + + Name + strpbrk.c + MacOS + + + Name + strstr.c + MacOS + + + Name + strtok.c + MacOS + + + Name + pralarm.c + MacOS + + + Name + pratom.c + MacOS + + + Name + prdtoa.c + MacOS + + + Name + prenv.c + MacOS + + + Name + prerror.c + MacOS + + + Name + prinit.c + MacOS + + + Name + prinrval.c + MacOS + + + Name + prlog2.c + MacOS + + + Name + prlong.c + MacOS + + + Name + prnetdb.c + MacOS + + + Name + prsystem.c + MacOS + + + Name + prtime.c + MacOS + + + Name + prdir.c + MacOS + + + Name + prfile.c + MacOS + + + Name + prio.c + MacOS + + + Name + prlog.c + MacOS + + + Name + prmapopt.c + MacOS + + + Name + prprf.c + MacOS + + + Name + prsocket.c + MacOS + + + Name + prstdio.c + MacOS + + + Name + prlink.c + MacOS + + + Name + prmem.c + MacOS + + + Name + prseg.c + MacOS + + + Name + prcmon.c + MacOS + + + Name + prcthr.c + MacOS + + + Name + prdump.c + MacOS + + + Name + prlayer.c + MacOS + + + Name + prscanf.c + MacOS + + + Name + priometh.c + MacOS + + + Name + prmon.c + MacOS + + + Name + prsem.c + MacOS + + + Name + prthinfo.c + MacOS + + + Name + prtpd.c + MacOS + + + Name + prucpu.c + MacOS + + + Name + prucv.c + MacOS + + + Name + prulock.c + MacOS + + + Name + prustack.c + MacOS + + + Name + pruthr.c + MacOS + + + Name + prosdep.c + MacOS + + + Name + macdll.c + MacOS + + + Name + macio.c + MacOS + + + Name + macthr.c + MacOS + + + Name + mactime.c + MacOS + + + Name + mdmac.c + MacOS + + + Name + macsockotpt.c + MacOS + + + Name + NSRuntime.shlb + MacOS + + + Name + NSStdLibStubs + MacOS + + + Name + base64.c + MacOS + + + Name + prfdcach.c + MacOS + + + Name + prpolevt.c + MacOS + + + Name + prmmap.c + MacOS + + + Name + prmwait.c + MacOS + + + Name + prcountr.c + MacOS + + + Name + prolock.c + MacOS + + + Name + prtrace.c + MacOS + + + Name + prerr.c + MacOS + + + Name + prerrortable.c + MacOS + + + Name + prrwlock.c + MacOS + + + Name + prshm.c + MacOS + + + Name + prshma.c + MacOS + + + Name + pripc.c + MacOS + + + Name + pripcsem.c + MacOS + + + Name + prrng.c + MacOS + + + Name + macrng.c + MacOS + + + Name + prgcleak.c + MacOS + + + Name + pripv6.c + MacOS + + + Name + prvrsion.c + MacOS + + + Name + mdcriticalregion.c + MacOS + + + + + NSPR20CarbonDebug.shlb + + + + UserSourceTrees + + + AlwaysSearchUserPathsfalse + InterpretDOSAndUnixPathsfalse + RequireFrameworkStyleIncludesfalse + UserSearchPaths + + SearchPath + Path: + PathFormatMacOS + PathRootProject + + Recursivetrue + FrameworkPathfalse + HostFlagsAll + + + SearchPath + Path:: + PathFormatMacOS + PathRootProject + + Recursivetrue + FrameworkPathfalse + HostFlagsAll + + + SearchPath + Path:::dist: + PathFormatMacOS + PathRootProject + + Recursivetrue + FrameworkPathfalse + HostFlagsAll + + + SystemSearchPaths + + SearchPath + Path:MSL: + PathFormatMacOS + PathRootCodeWarrior + + Recursivetrue + FrameworkPathfalse + HostFlagsAll + + + SearchPath + Path:MacOS Support: + PathFormatMacOS + PathRootCodeWarrior + + Recursivetrue + FrameworkPathfalse + HostFlagsMacOS + + + + + MWRuntimeSettings_WorkingDirectory + MWRuntimeSettings_CommandLine + MWRuntimeSettings_HostApplication + Path + PathFormatGeneric + PathRootAbsolute + + MWRuntimeSettings_EnvVars + + + LinkerMacOS PPC Linker + PreLinker + PostLinker + TargetnameNSPR20CarbonDebug.shlb + OutputDirectory + Path: + PathFormatMacOS + PathRootProject + + SaveEntriesUsingRelativePathsfalse + + + FileMappings + + FileTypeAPPL + FileExtension + Compiler + EditLanguage + Precompilefalse + Launchabletrue + ResourceFiletrue + IgnoredByMakefalse + + + FileTypeAppl + FileExtension + Compiler + EditLanguage + Precompilefalse + Launchabletrue + ResourceFiletrue + IgnoredByMakefalse + + + FileTypeMMLB + FileExtension + CompilerLib Import PPC + EditLanguage + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeMPLF + FileExtension + CompilerLib Import PPC + EditLanguage + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeMWCD + FileExtension + Compiler + EditLanguage + Precompilefalse + Launchabletrue + ResourceFiletrue + IgnoredByMakefalse + + + FileTypeRSRC + FileExtension + Compiler + EditLanguage + Precompilefalse + Launchabletrue + ResourceFiletrue + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.bh + CompilerBalloon Help + EditLanguage + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.c + CompilerMW C/C++ PPC + EditLanguageC/C++ + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.c++ + CompilerMW C/C++ PPC + EditLanguageC/C++ + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.cc + CompilerMW C/C++ PPC + EditLanguageC/C++ + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.cp + CompilerMW C/C++ PPC + EditLanguageC/C++ + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.cpp + CompilerMW C/C++ PPC + EditLanguageC/C++ + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.exp + Compiler + EditLanguage + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.h + CompilerMW C/C++ PPC + EditLanguageC/C++ + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMaketrue + + + FileTypeTEXT + FileExtension.p + CompilerMW Pascal PPC + EditLanguage + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.pas + CompilerMW Pascal PPC + EditLanguage + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.pch + CompilerMW C/C++ PPC + EditLanguageC/C++ + Precompiletrue + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.pch++ + CompilerMW C/C++ PPC + EditLanguageC/C++ + Precompiletrue + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.r + CompilerRez + EditLanguageRez + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.s + CompilerPPCAsm + EditLanguage + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeXCOF + FileExtension + CompilerXCOFF Import PPC + EditLanguage + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypedocu + FileExtension + Compiler + EditLanguage + Precompilefalse + Launchabletrue + ResourceFiletrue + IgnoredByMakefalse + + + FileTypersrc + FileExtension + Compiler + EditLanguage + Precompilefalse + Launchabletrue + ResourceFiletrue + IgnoredByMakefalse + + + FileTypeshlb + FileExtension + CompilerPEF Import PPC + EditLanguage + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypestub + FileExtension + CompilerPEF Import PPC + EditLanguage + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileExtension.doc + Compiler + EditLanguage + Precompilefalse + Launchabletrue + ResourceFilefalse + IgnoredByMaketrue + + + + + CacheModDatesfalse + ActivateBrowsertrue + DumpBrowserInfofalse + CacheSubprojectstrue + UseThirdPartyDebuggerfalse + DebuggerAppPath + Path + PathFormatGeneric + PathRootAbsolute + + DebuggerCmdLineArgs + DebuggerWorkingDir + Path + PathFormatGeneric + PathRootAbsolute + + + + LogSystemMessagestrue + AutoTargetDLLsfalse + StopAtWatchpointstrue + PauseWhileRunningfalse + PauseInterval5 + PauseUIFlags0 + AltExePath + Path + PathFormatGeneric + PathRootAbsolute + + StopAtTempBPOnLaunchtrue + CacheSymbolicstrue + TempBPFunctionNamemain + TempBPType0 + + + Enabledfalse + ConnectionName + DownloadPath + LaunchRemoteAppfalse + RemoteAppPath + + + OtherExecutables + + + CustomColor1 + Red0 + Green39321 + Blue0 + + CustomColor2 + Red0 + Green32767 + Blue0 + + CustomColor3 + Red0 + Green32767 + Blue0 + + CustomColor4 + Red0 + Green32767 + Blue0 + + + + MWFrontEnd_C_cplusplus0 + MWFrontEnd_C_checkprotos0 + MWFrontEnd_C_arm0 + MWFrontEnd_C_trigraphs0 + MWFrontEnd_C_onlystdkeywords0 + MWFrontEnd_C_enumsalwaysint1 + MWFrontEnd_C_mpwpointerstyle0 + MWFrontEnd_C_prefixnameNSPRCarbonDebug.Prefix + MWFrontEnd_C_ansistrict0 + MWFrontEnd_C_mpwcnewline0 + MWFrontEnd_C_wchar_type1 + MWFrontEnd_C_enableexceptions1 + MWFrontEnd_C_dontreusestrings0 + MWFrontEnd_C_poolstrings0 + MWFrontEnd_C_dontinline0 + MWFrontEnd_C_useRTTI0 + MWFrontEnd_C_multibyteaware0 + MWFrontEnd_C_unsignedchars0 + MWFrontEnd_C_autoinline0 + MWFrontEnd_C_booltruefalse0 + MWFrontEnd_C_direct_to_som0 + MWFrontEnd_C_som_env_check0 + MWFrontEnd_C_alwaysinline0 + MWFrontEnd_C_inlinelevel0 + MWFrontEnd_C_ecplusplus0 + MWFrontEnd_C_objective_c0 + MWFrontEnd_C_defer_codegen0 + + + MWWarning_C_warn_illpragma1 + MWWarning_C_warn_emptydecl1 + MWWarning_C_warn_possunwant1 + MWWarning_C_warn_unusedvar1 + MWWarning_C_warn_unusedarg1 + MWWarning_C_warn_extracomma1 + MWWarning_C_pedantic1 + MWWarning_C_warningerrors0 + MWWarning_C_warn_hidevirtual1 + MWWarning_C_warn_implicitconv0 + MWWarning_C_warn_notinlined0 + MWWarning_C_warn_structclass0 + + + MWFTP_Post_hostName + MWFTP_Post_username + MWFTP_Post_password0 + MWFTP_Post_remoteDir + MWFTP_Post_ftp_PathVersion1 + MWFTP_Post_ftp_PathType0 + MWFTP_Post_ftp_PathFormat0 + MWFTP_Post_ftp_tree + MWFTP_Post_uploadDir + MWFTP_Post_ftp_port21 + MWFTP_Post_SendBin1 + MWFTP_Post_ShouldLog1 + + + MWCommandLine_Java_clsName + MWCommandLine_Java_args + + + MWVJavaDebugging_Protocol1 + MWVJavaDebugging_JDKVersion1 + MWVJavaDebugging_TimeOut10 + MWVJavaDebugging_SupportSlowDevicesfalse + + + MWJava_Language_optimizefalse + MWJava_Language_warnDeprecatedfalse + MWJava_Language_emitMapfalse + MWJava_Language_strictFileNamesfalse + MWJava_Language_strictFileHierarchyfalse + MWJava_Language_1_1_Compatiblefalse + MWJava_Language_emitHeaders0 + MWJava_Language_headerTypeJNINativeHeaders + MWJava_Language_packageFilter + MWJava_Language_genCommentstrue + MWJava_Language_genHeadersfalse + + + MWJava_MRJAppBuilder_outFileMRJApplication + MWJava_MRJAppBuilder_mergefalse + MWJava_MRJAppBuilder_quitMenutrue + MWJava_MRJAppBuilder_growfalse + MWJava_MRJAppBuilder_stdoutTypeConsole + MWJava_MRJAppBuilder_stderrTypeConsole + MWJava_MRJAppBuilder_stdinTypeConsole + MWJava_MRJAppBuilder_appIconPVersion0 + MWJava_MRJAppBuilder_appIconPType0 + MWJava_MRJAppBuilder_appIconPFormat0 + MWJava_MRJAppBuilder_appIconPTree + MWJava_MRJAppBuilder_appIconFile + MWJava_MRJAppBuilder_splashScreenPVersion0 + MWJava_MRJAppBuilder_splashScreenPType0 + MWJava_MRJAppBuilder_splashScreenPFormat0 + MWJava_MRJAppBuilder_splashScreenPTree + MWJava_MRJAppBuilder_splashScreenPICTFile + MWJava_MRJAppBuilder_aboutName + MWJava_MRJAppBuilder_stdoutPVersion0 + MWJava_MRJAppBuilder_stdoutPType0 + MWJava_MRJAppBuilder_stdoutPFormat0 + MWJava_MRJAppBuilder_stdoutPTree + MWJava_MRJAppBuilder_stdoutFile + MWJava_MRJAppBuilder_stdoutAppendfalse + MWJava_MRJAppBuilder_stderrPType0 + MWJava_MRJAppBuilder_stderrPFormat0 + MWJava_MRJAppBuilder_stderrPTree + MWJava_MRJAppBuilder_stderrFile + MWJava_MRJAppBuilder_stderrAppendfalse + MWJava_MRJAppBuilder_stdinPType0 + MWJava_MRJAppBuilder_stdinPFormat0 + MWJava_MRJAppBuilder_stdinPTree + MWJava_MRJAppBuilder_stdinFile + + + MWJava_Output_outputtypeJarFile + MWJava_Output_outfileJavaClasses.jar + MWJava_Output_ftype1514754080 + MWJava_Output_fcreator1297570384 + MWJava_Output_compress0 + MWJava_Output_genManifest0 + MWJava_Output_trunctypeFront + MWJava_Output_deleteClasses0 + MWJava_Output_consoleApp1 + + + MWJava_Proj_projtypeApplet + MWJava_Proj_mainClassName + MWJava_Proj_HTMLAppCreator1145457748 + MWJava_Proj_HTMLAppNameApple Applet Runner + MWJava_Proj_PathVersion1 + MWJava_Proj_PathType0 + MWJava_Proj_PathFormat0 + MWJava_Proj_tree + MWJava_Proj_HTMLAppWin32NameInternet Explorer + MWJava_Proj_compress0 + MWJava_Proj_useVM1 + MWJava_Proj_vmarguments + MWJava_Proj_vmName + MWJava_Proj_simPropFile + + + MWJavaDoc_Proj_Version1 + MWJavaDoc_Proj_Depricated1 + MWJavaDoc_Proj_Author1 + MWJavaDoc_Proj_Index1 + MWJavaDoc_Proj_Tree1 + MWJavaDoc_Proj_SunResolveToSame0 + MWJavaDoc_Proj_Shortnames1 + MWJavaDoc_Proj_Folder0 + MWJavaDoc_Proj_GenerateAPILinks0 + MWJavaDoc_Proj_scopePublic + MWJavaDoc_Proj_fcreator1297303877 + MWJavaDoc_Proj_encodingName + MWJavaDoc_Proj_decodingName + MWJavaDoc_Proj_javaPackagePathhttp://java.sun.com/products/jdk/1.1/docs/api/ + + + MWMerge_MacOS_projectTypeApplication + MWMerge_MacOS_outputNameMerge Out + MWMerge_MacOS_outputCreator???? + MWMerge_MacOS_outputTypeAPPL + MWMerge_MacOS_suppressWarning0 + MWMerge_MacOS_copyFragments1 + MWMerge_MacOS_copyResources1 + MWMerge_MacOS_flattenResource0 + MWMerge_MacOS_flatFileNamea.rsrc + MWMerge_MacOS_flatFileOutputPath + Path: + PathFormatMacOS + PathRootProject + + MWMerge_MacOS_skipResources + DLGX + ckid + Proj + WSPC + + + + FileLockedfalse + ResourcesMapIsReadOnlyfalse + PrinterDriverIsMultiFinderCompatiblefalse + Invisiblefalse + HasBundlefalse + NameLockedfalse + Stationeryfalse + HasCustomIconfalse + Sharedfalse + HasBeenInitedfalse + Label0 + Comments + + + MWMacOSPackager_UsePackager0 + MWMacOSPackager_FolderToPackage + Path: + PathFormatMacOS + PathRootProject + + MWMacOSPackager_CreateClassicAlias0 + MWMacOSPackager_ClassicAliasMethodUseTargetOutput + MWMacOSPackager_ClassicAliasPath + Path: + PathFormatMacOS + PathRootProject + + MWMacOSPackager_CreatePkgInfo0 + MWMacOSPackager_PkgCreatorType???? + MWMacOSPackager_PkgFileTypeAPPL + + + MWCodeGen_PPC_structalignmentPPC + MWCodeGen_PPC_tracebacktablesInline + MWCodeGen_PPC_processorGeneric + MWCodeGen_PPC_readonlystrings1 + MWCodeGen_PPC_tocdata1 + MWCodeGen_PPC_profiler0 + MWCodeGen_PPC_fpcontract1 + MWCodeGen_PPC_schedule0 + MWCodeGen_PPC_peephole0 + MWCodeGen_PPC_processorspecific0 + MWCodeGen_PPC_altivec0 + MWCodeGen_PPC_vectortocdata0 + MWCodeGen_PPC_vrsave0 + + + MWCodeGen_MachO_structalignmentPPC + MWCodeGen_MachO_tracebacktablesNone + MWCodeGen_MachO_processorGeneric + MWCodeGen_MachO_readonlystrings0 + MWCodeGen_MachO_profiler0 + MWCodeGen_MachO_fpcontract1 + MWCodeGen_MachO_schedule0 + MWCodeGen_MachO_peephole1 + MWCodeGen_MachO_processorspecific0 + MWCodeGen_MachO_altivec0 + MWCodeGen_MachO_vrsave1 + MWCodeGen_MachO_common0 + MWCodeGen_MachO_implicit_templates1 + + + MWDisassembler_PPC_showcode1 + MWDisassembler_PPC_extended1 + MWDisassembler_PPC_mix0 + MWDisassembler_PPC_nohex0 + MWDisassembler_PPC_showdata1 + MWDisassembler_PPC_showexceptions1 + MWDisassembler_PPC_showsym0 + MWDisassembler_PPC_shownames1 + + + GlobalOptimizer_PPC_optimizationlevelLevel0 + GlobalOptimizer_PPC_optforSpeed + + + MWLinker_PPC_linksym1 + MWLinker_PPC_symfullpath1 + MWLinker_PPC_linkmap0 + MWLinker_PPC_nolinkwarnings0 + MWLinker_PPC_dontdeadstripinitcode0 + MWLinker_PPC_permitmultdefs0 + MWLinker_PPC_linkmodeFast + MWLinker_PPC_initname__NSInitialize + MWLinker_PPC_mainname + MWLinker_PPC_termnameCleanupTermProc + + + MWLinker_MachO_exportsNone + MWLinker_MachO_mainnamestart + MWLinker_MachO_currentversion0 + MWLinker_MachO_compatibleversion0 + MWLinker_MachO_symfullpath0 + MWLinker_MachO_supresswarnings0 + MWLinker_MachO_multisymerror0 + MWLinker_MachO_prebind1 + MWLinker_MachO_deadstrip1 + MWLinker_MachO_objectivecsemantics0 + MWLinker_MachO_whichfileloaded0 + MWLinker_MachO_whyfileloaded0 + MWLinker_MachO_readonlyrelocsErrors + MWLinker_MachO_undefinedsymbolsErrors + MWLinker_MachO_twolevelnamespace1 + MWLinker_MachO_stripdebugsymbols0 + + + MWProject_MachO_typeExecutable + MWProject_MachO_outfilea.exe + MWProject_MachO_filecreator???? + MWProject_MachO_filetypeMEXE + MWProject_MachO_stacksize64 + MWProject_MachO_stackaddress0 + MWProject_MachO_flatrsrc1 + MWProject_MachO_flatrsrcfilenamea.rsrc + MWProject_MachO_flatrsrcoutputdir + Path: + PathFormatMacOS + PathRootProject + + MWProject_MachO_installpath./ + + + MWPEF_exportsPragma + MWPEF_libfolder0 + MWPEF_sortcodeNone + MWPEF_expandbss0 + MWPEF_sharedata0 + MWPEF_olddefversion400 + MWPEF_oldimpversion400 + MWPEF_currentversion401 + MWPEF_fragmentnameNSPR20 + MWPEF_collapsereloads0 + + + MWProject_PPC_typeSharedLibrary + MWProject_PPC_outfileNSPR20Debug.shlb + MWProject_PPC_filecreatorMOZZ + MWProject_PPC_filetypeshlb + MWProject_PPC_size0 + MWProject_PPC_minsize0 + MWProject_PPC_stacksize0 + MWProject_PPC_flags0 + MWProject_PPC_symfilename + MWProject_PPC_rsrcname + MWProject_PPC_rsrcheaderNative + MWProject_PPC_rsrctype???? + MWProject_PPC_rsrcid0 + MWProject_PPC_rsrcflags0 + MWProject_PPC_rsrcstore0 + MWProject_PPC_rsrcmerge0 + MWProject_PPC_flatrsrc0 + MWProject_PPC_flatrsrcoutputdir + Path: + PathFormatMacOS + PathRootProject + + MWProject_PPC_flatrsrcfilename + + + MWAssembler_PPC_auxheader0 + MWAssembler_PPC_symmodeMac + MWAssembler_PPC_dialectPPC + MWAssembler_PPC_prefixfile + MWAssembler_PPC_typecheck0 + MWAssembler_PPC_warnings0 + MWAssembler_PPC_casesensitive0 + + + MWRez_Language_maxwidth80 + MWRez_Language_scriptRoman + MWRez_Language_alignmentAlign1 + MWRez_Language_filtermodeFilterSkip + MWRez_Language_suppresswarnings0 + MWRez_Language_escapecontrolchars1 + MWRez_Language_prefixname + MWRez_Language_filteredtypes'CODE' 'DATA' 'PICT' + + + MWWinRC_prefixname + + + MWCodeGen_X86_processorGeneric + MWCodeGen_X86_alignmentbytes8 + MWCodeGen_X86_exceptionsZeroOverhead + MWCodeGen_X86_extinst_mmx0 + MWCodeGen_X86_extinst_3dnow0 + MWCodeGen_X86_use_mmx_3dnow_convention0 + MWCodeGen_X86_machinecodelisting0 + MWCodeGen_X86_intrinsics0 + MWCodeGen_X86_syminfo0 + MWCodeGen_X86_codeviewinfo1 + MWCodeGen_X86_extinst_cmov_fcomi0 + MWCodeGen_X86_extinst_sse0 + + + PDisasmX86_showHeaderstrue + PDisasmX86_showSymTabtrue + PDisasmX86_showCodetrue + PDisasmX86_showSourcefalse + PDisasmX86_showHextrue + PDisasmX86_showRelocationtrue + PDisasmX86_showCommentsfalse + PDisasmX86_showDebugfalse + PDisasmX86_showExceptionsfalse + PDisasmX86_showDatatrue + PDisasmX86_showRawfalse + PDisasmX86_verbosefalse + + + MWDebugger_X86_Exceptions + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + GlobalOptimizer_X86_optimizationlevelLevel0 + GlobalOptimizer_X86_optforSpeed + + + MWLinker_X86_entrypointusageDefault + MWLinker_X86_entrypoint + MWLinker_X86_subsystemWinGUI + MWLinker_X86_subsysmajorid4 + MWLinker_X86_subsysminorid0 + MWLinker_X86_usrmajorid0 + MWLinker_X86_usrminorid0 + MWLinker_X86_commandfile + MWLinker_X86_generatemap0 + MWLinker_X86_linksym0 + MWLinker_X86_linkCV1 + + + MWProject_X86_typeApplication + MWProject_X86_outfilenoname.exe + MWProject_X86_baseaddress4194304 + MWProject_X86_maxstacksize1024 + MWProject_X86_minstacksize4 + MWProject_X86_size1024 + MWProject_X86_minsize4 + MWProject_X86_importlib + xpidl Settings + 0001000101000000000000000000000000000000000000000000000000000000 + 0000000000000000 + + + + + Name + plarena.c + MacOS + Text + Debug + + + Name + plhash.c + MacOS + Text + Debug + + + Name + plerror.c + MacOS + Text + Debug + + + Name + plgetopt.c + MacOS + Text + Debug + + + Name + strcat.c + MacOS + Text + Debug + + + Name + strccmp.c + MacOS + Text + Debug + + + Name + strchr.c + MacOS + Text + Debug + + + Name + strcmp.c + MacOS + Text + Debug + + + Name + strcpy.c + MacOS + Text + Debug + + + Name + strcstr.c + MacOS + Text + Debug + + + Name + strdup.c + MacOS + Text + Debug + + + Name + strlen.c + MacOS + Text + Debug + + + Name + strpbrk.c + MacOS + Text + Debug + + + Name + strstr.c + MacOS + Text + Debug + + + Name + pralarm.c + MacOS + Text + Debug + + + Name + pratom.c + MacOS + Text + Debug + + + Name + prdtoa.c + MacOS + Text + Debug + + + Name + prenv.c + MacOS + Text + Debug + + + Name + prerror.c + MacOS + Text + Debug + + + Name + prinit.c + MacOS + Text + Debug + + + Name + prinrval.c + MacOS + Text + Debug + + + Name + prlog2.c + MacOS + Text + Debug + + + Name + prlong.c + MacOS + Text + Debug + + + Name + prnetdb.c + MacOS + Text + Debug + + + Name + prsystem.c + MacOS + Text + Debug + + + Name + prtime.c + MacOS + Text + Debug + + + Name + prdir.c + MacOS + Text + Debug + + + Name + prfile.c + MacOS + Text + Debug + + + Name + prio.c + MacOS + Text + Debug + + + Name + prlog.c + MacOS + Text + Debug + + + Name + prmapopt.c + MacOS + Text + Debug + + + Name + prprf.c + MacOS + Text + Debug + + + Name + prsocket.c + MacOS + Text + Debug + + + Name + prstdio.c + MacOS + Text + Debug + + + Name + prlink.c + MacOS + Text + Debug + + + Name + prmem.c + MacOS + Text + Debug + + + Name + prseg.c + MacOS + Text + Debug + + + Name + prcmon.c + MacOS + Text + Debug + + + Name + prcthr.c + MacOS + Text + Debug + + + Name + prdump.c + MacOS + Text + Debug + + + Name + prmon.c + MacOS + Text + Debug + + + Name + prsem.c + MacOS + Text + Debug + + + Name + prtpd.c + MacOS + Text + Debug + + + Name + prucpu.c + MacOS + Text + Debug + + + Name + prucv.c + MacOS + Text + Debug + + + Name + prulock.c + MacOS + Text + Debug + + + Name + prustack.c + MacOS + Text + Debug + + + Name + pruthr.c + MacOS + Text + Debug + + + Name + prosdep.c + MacOS + Text + Debug + + + Name + macdll.c + MacOS + Text + Debug + + + Name + macio.c + MacOS + Text + Debug + + + Name + macthr.c + MacOS + Text + Debug + + + Name + mactime.c + MacOS + Text + Debug + + + Name + mdmac.c + MacOS + Text + Debug + + + Name + priometh.c + MacOS + Text + Debug + + + Name + prthinfo.c + MacOS + Text + Debug + + + Name + prlayer.c + MacOS + Text + Debug + + + Name + prscanf.c + MacOS + Text + Debug + + + Name + NSStdLibStubs + MacOS + Library + Debug + + + Name + macsockotpt.c + MacOS + Text + Debug + + + Name + NSRuntimeDebug.shlb + MacOS + Library + Debug + + + Name + base64.c + MacOS + Text + Debug + + + Name + prfdcach.c + MacOS + Text + Debug + + + Name + prpolevt.c + MacOS + Text + Debug + + + Name + prmmap.c + MacOS + Text + Debug + + + Name + prmwait.c + MacOS + Text + Debug + + + Name + prcountr.c + MacOS + Text + Debug + + + Name + prolock.c + MacOS + Text + Debug + + + Name + prtrace.c + MacOS + Text + Debug + + + Name + InterfacesStubs + MacOS + Library + Debug + + + Name + prerr.c + MacOS + Text + Debug + + + Name + prerrortable.c + MacOS + Text + Debug + + + Name + prrwlock.c + MacOS + Text + Debug + + + Name + NSLibraryStartup.o + MacOS + Library + Debug + + + Name + prshm.c + MacOS + Text + Debug + + + Name + prshma.c + MacOS + Text + Debug + + + Name + pripc.c + MacOS + Text + Debug + + + Name + pripcsem.c + MacOS + Text + Debug + + + Name + prrng.c + MacOS + Text + Debug + + + Name + macrng.c + MacOS + Text + Debug + + + Name + prgcleak.c + MacOS + Text + Debug + + + Name + pripv6.c + MacOS + Text + Debug + + + Name + prvrsion.c + MacOS + Text + Debug + + + Name + mdcriticalregion.c + MacOS + Text + Debug + + + Name + strtok.c + MacOS + Text + Debug + + + + + Name + NSLibraryStartup.o + MacOS + + + Name + InterfacesStubs + MacOS + + + Name + plarena.c + MacOS + + + Name + plhash.c + MacOS + + + Name + plerror.c + MacOS + + + Name + plgetopt.c + MacOS + + + Name + strcat.c + MacOS + + + Name + strccmp.c + MacOS + + + Name + strchr.c + MacOS + + + Name + strcmp.c + MacOS + + + Name + strcpy.c + MacOS + + + Name + strcstr.c + MacOS + + + Name + strdup.c + MacOS + + + Name + strlen.c + MacOS + + + Name + strpbrk.c + MacOS + + + Name + strstr.c + MacOS + + + Name + strtok.c + MacOS + + + Name + pralarm.c + MacOS + + + Name + pratom.c + MacOS + + + Name + prdtoa.c + MacOS + + + Name + prenv.c + MacOS + + + Name + prerror.c + MacOS + + + Name + prinit.c + MacOS + + + Name + prinrval.c + MacOS + + + Name + prlog2.c + MacOS + + + Name + prlong.c + MacOS + + + Name + prnetdb.c + MacOS + + + Name + prsystem.c + MacOS + + + Name + prtime.c + MacOS + + + Name + prdir.c + MacOS + + + Name + prfile.c + MacOS + + + Name + prio.c + MacOS + + + Name + prlog.c + MacOS + + + Name + prmapopt.c + MacOS + + + Name + prprf.c + MacOS + + + Name + prsocket.c + MacOS + + + Name + prstdio.c + MacOS + + + Name + prlink.c + MacOS + + + Name + prmem.c + MacOS + + + Name + prseg.c + MacOS + + + Name + prlayer.c + MacOS + + + Name + prscanf.c + MacOS + + + Name + prcmon.c + MacOS + + + Name + prcthr.c + MacOS + + + Name + prdump.c + MacOS + + + Name + priometh.c + MacOS + + + Name + prmon.c + MacOS + + + Name + prsem.c + MacOS + + + Name + prthinfo.c + MacOS + + + Name + prtpd.c + MacOS + + + Name + prucpu.c + MacOS + + + Name + prucv.c + MacOS + + + Name + prulock.c + MacOS + + + Name + prustack.c + MacOS + + + Name + pruthr.c + MacOS + + + Name + prosdep.c + MacOS + + + Name + macdll.c + MacOS + + + Name + macio.c + MacOS + + + Name + macthr.c + MacOS + + + Name + mactime.c + MacOS + + + Name + mdmac.c + MacOS + + + Name + macsockotpt.c + MacOS + + + Name + NSRuntimeDebug.shlb + MacOS + + + Name + NSStdLibStubs + MacOS + + + Name + base64.c + MacOS + + + Name + prfdcach.c + MacOS + + + Name + prpolevt.c + MacOS + + + Name + prmmap.c + MacOS + + + Name + prmwait.c + MacOS + + + Name + prcountr.c + MacOS + + + Name + prolock.c + MacOS + + + Name + prtrace.c + MacOS + + + Name + prerr.c + MacOS + + + Name + prerrortable.c + MacOS + + + Name + prrwlock.c + MacOS + + + Name + prshm.c + MacOS + + + Name + prshma.c + MacOS + + + Name + pripc.c + MacOS + + + Name + pripcsem.c + MacOS + + + Name + prrng.c + MacOS + + + Name + macrng.c + MacOS + + + Name + prgcleak.c + MacOS + + + Name + pripv6.c + MacOS + + + Name + prvrsion.c + MacOS + + + Name + mdcriticalregion.c + MacOS + + + + + + + NSPR20.shlb + NSPR20Debug.shlb + NSPR20Carbon.shlb + NSPR20CarbonDebug.shlb + + + + pl + + NSPR20.shlb + Name + base64.c + MacOS + + + NSPR20.shlb + Name + plarena.c + MacOS + + + NSPR20.shlb + Name + plhash.c + MacOS + + + NSPR20.shlb + Name + plerror.c + MacOS + + + NSPR20.shlb + Name + plgetopt.c + MacOS + + + NSPR20.shlb + Name + strcat.c + MacOS + + + NSPR20.shlb + Name + strccmp.c + MacOS + + + NSPR20.shlb + Name + strchr.c + MacOS + + + NSPR20.shlb + Name + strcmp.c + MacOS + + + NSPR20.shlb + Name + strcpy.c + MacOS + + + NSPR20.shlb + Name + strcstr.c + MacOS + + + NSPR20.shlb + Name + strdup.c + MacOS + + + NSPR20.shlb + Name + strlen.c + MacOS + + + NSPR20.shlb + Name + strpbrk.c + MacOS + + + NSPR20.shlb + Name + strstr.c + MacOS + + + NSPR20.shlb + Name + strtok.c + MacOS + + + misc + + NSPR20.shlb + Name + prrng.c + MacOS + + + NSPR20.shlb + Name + pralarm.c + MacOS + + + NSPR20.shlb + Name + pratom.c + MacOS + + + NSPR20.shlb + Name + prcountr.c + MacOS + + + NSPR20.shlb + Name + prdtoa.c + MacOS + + + NSPR20.shlb + Name + prenv.c + MacOS + + + NSPR20.shlb + Name + prerr.c + MacOS + + + NSPR20.shlb + Name + prerror.c + MacOS + + + NSPR20.shlb + Name + prerrortable.c + MacOS + + + NSPR20.shlb + Name + prinit.c + MacOS + + + NSPR20.shlb + Name + prinrval.c + MacOS + + + NSPR20.shlb + Name + prlog2.c + MacOS + + + NSPR20.shlb + Name + prlong.c + MacOS + + + NSPR20.shlb + Name + prnetdb.c + MacOS + + + NSPR20.shlb + Name + prolock.c + MacOS + + + NSPR20.shlb + Name + prsystem.c + MacOS + + + NSPR20.shlb + Name + prthinfo.c + MacOS + + + NSPR20.shlb + Name + prtime.c + MacOS + + + NSPR20.shlb + Name + prtrace.c + MacOS + + + NSPR20.shlb + Name + pripc.c + MacOS + + + NSPR20.shlb + Name + pripcsem.c + MacOS + + + NSPR20.shlb + Name + prvrsion.c + MacOS + + + io + + NSPR20.shlb + Name + prdir.c + MacOS + + + NSPR20.shlb + Name + prfdcach.c + MacOS + + + NSPR20.shlb + Name + prfile.c + MacOS + + + NSPR20.shlb + Name + prio.c + MacOS + + + NSPR20.shlb + Name + priometh.c + MacOS + + + NSPR20.shlb + Name + pripv6.c + MacOS + + + NSPR20.shlb + Name + prlayer.c + MacOS + + + NSPR20.shlb + Name + prlog.c + MacOS + + + NSPR20.shlb + Name + prmapopt.c + MacOS + + + NSPR20.shlb + Name + prmmap.c + MacOS + + + NSPR20.shlb + Name + prmwait.c + MacOS + + + NSPR20.shlb + Name + prpolevt.c + MacOS + + + NSPR20.shlb + Name + prprf.c + MacOS + + + NSPR20.shlb + Name + prscanf.c + MacOS + + + NSPR20.shlb + Name + prsocket.c + MacOS + + + NSPR20.shlb + Name + prstdio.c + MacOS + + + linking + + NSPR20.shlb + Name + prlink.c + MacOS + + + memory + + NSPR20.shlb + Name + prmem.c + MacOS + + + NSPR20.shlb + Name + prseg.c + MacOS + + + NSPR20.shlb + Name + prshm.c + MacOS + + + NSPR20.shlb + Name + prshma.c + MacOS + + + threads + + NSPR20.shlb + Name + prcmon.c + MacOS + + + NSPR20.shlb + Name + prcthr.c + MacOS + + + NSPR20.shlb + Name + prdump.c + MacOS + + + NSPR20.shlb + Name + prmon.c + MacOS + + + NSPR20.shlb + Name + prrwlock.c + MacOS + + + NSPR20.shlb + Name + prsem.c + MacOS + + + NSPR20.shlb + Name + prtpd.c + MacOS + + + NSPR20.shlb + Name + prucpu.c + MacOS + + + NSPR20.shlb + Name + prucv.c + MacOS + + + NSPR20.shlb + Name + prulock.c + MacOS + + + NSPR20.shlb + Name + prustack.c + MacOS + + + NSPR20.shlb + Name + pruthr.c + MacOS + + + md + + NSPR20.shlb + Name + prosdep.c + MacOS + + + PR Mac + + NSPR20.shlb + Name + macrng.c + MacOS + + + NSPR20.shlb + Name + macdll.c + MacOS + + + NSPR20.shlb + Name + macio.c + MacOS + + + NSPR20.shlb + Name + macsockotpt.c + MacOS + + + NSPR20.shlb + Name + macthr.c + MacOS + + + NSPR20.shlb + Name + mactime.c + MacOS + + + NSPR20.shlb + Name + mdmac.c + MacOS + + + NSPR20.shlb + Name + mdcriticalregion.c + MacOS + + + NSPR20.shlb + Name + prgcleak.c + MacOS + + + NS Libraries + + NSPR20.shlb + Name + NSStdLibStubs + MacOS + + Optimized + + NSPR20.shlb + Name + NSRuntime.shlb + MacOS + + + Debug + + NSPR20Debug.shlb + Name + NSRuntimeDebug.shlb + MacOS + + + + System Libraries + + NSPR20.shlb + Name + NSLibraryStartup.o + MacOS + + + NSPR20.shlb + Name + InterfacesStubs + MacOS + + + NSPR20.shlb + Name + OpenTransportAppPPC.o + MacOS + + + NSPR20.shlb + Name + OpenTptInetPPC.o + MacOS + + + + + diff --git a/macbuild/NSPRCarbon.Prefix b/macbuild/NSPRCarbon.Prefix index d36f5663..cb70b847 100644 --- a/macbuild/NSPRCarbon.Prefix +++ b/macbuild/NSPRCarbon.Prefix @@ -1,11 +1,10 @@ // -// NSPR.Prefix +// NSPRCarbon.Prefix // -// Global prefix file for the non-debug NSPR project. +// Global prefix file for the non-debug Carbon NSPR project. // // +#include "MacPrefix.h" #include "NSPRConfig.h" - -#define TARGET_CARBON 1 diff --git a/macbuild/NSPRCarbonDebug.Prefix b/macbuild/NSPRCarbonDebug.Prefix index 4a67d9ef..c758898e 100644 --- a/macbuild/NSPRCarbonDebug.Prefix +++ b/macbuild/NSPRCarbonDebug.Prefix @@ -1,12 +1,12 @@ // -// NSPR.Prefix +// NSPRCarbonDebug.Prefix // -// Global prefix file for the debug NSPR project. +// Global prefix file for the Carbon debug NSPR project. // // -#define DEBUG 1 -#define DEVELOPER_DEBUG 1 +#include "MacPrefix_debug.h" #include "NSPRConfig.h" -#define TARGET_CARBON 1 + +#define DEVELOPER_DEBUG 1 diff --git a/macbuild/NSPRConfig.h b/macbuild/NSPRConfig.h index 4f2adf89..956a178d 100644 --- a/macbuild/NSPRConfig.h +++ b/macbuild/NSPRConfig.h @@ -34,7 +34,6 @@ #define OLDROUTINELOCATIONS 0 -#define XP_MAC 1 #define _PR_NO_PREEMPT 1 #define _NO_FAST_STRING_INLINES_ 1 #define FORCE_PR_LOG 1 diff --git a/macbuild/NSPRDebug.Prefix b/macbuild/NSPRDebug.Prefix index a656aa49..fb35702e 100644 --- a/macbuild/NSPRDebug.Prefix +++ b/macbuild/NSPRDebug.Prefix @@ -1,11 +1,12 @@ // -// NSPR.Prefix +// NSPRDebug.Prefix // // Global prefix file for the debug NSPR project. // // -#define DEBUG 1 +#include "MacPrefix_debug.h" +#include "NSPRConfig.h" + #define DEVELOPER_DEBUG 1 -#include "NSPRConfig.h" \ No newline at end of file diff --git a/pr/include/md/_aix.h b/pr/include/md/_aix.h index d8d79eeb..01afa6eb 100644 --- a/pr/include/md/_aix.h +++ b/pr/include/md/_aix.h @@ -243,4 +243,6 @@ struct _MDCPU { #define _MD_POLL poll #endif +extern void _MD_aix_map_sendfile_error(int err); + #endif /* nspr_aix_defs_h___ */ diff --git a/pr/include/md/_aix32.cfg b/pr/include/md/_aix32.cfg index 8047bb98..0bf01957 100644 --- a/pr/include/md/_aix32.cfg +++ b/pr/include/md/_aix32.cfg @@ -134,6 +134,9 @@ #define BYTES_PER_DWORD_LOG2 PR_BYTES_PER_DWORD_LOG2 #define WORDS_PER_DWORD_LOG2 PR_WORDS_PER_DWORD_LOG2 +/* used by protypes.h only */ +#define _PR_AIX_HAVE_BSD_INT_TYPES + #endif /* NO_NSPR_10_SUPPORT */ #endif /* nspr_cpucfg___ */ diff --git a/pr/include/md/_aix32in6.cfg b/pr/include/md/_aix32in6.cfg deleted file mode 100644 index 0bf01957..00000000 --- a/pr/include/md/_aix32in6.cfg +++ /dev/null @@ -1,142 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is the Netscape Portable Runtime (NSPR). - * - * The Initial Developer of the Original Code is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifndef nspr_cpucfg___ -#define nspr_cpucfg___ - -#ifndef XP_UNIX -#define XP_UNIX -#endif - -#ifndef AIX -#define AIX -#endif - -#undef IS_LITTLE_ENDIAN -#define IS_BIG_ENDIAN 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 8 -#define PR_ALIGN_OF_FLOAT 4 -#define PR_ALIGN_OF_DOUBLE 4 -#define PR_ALIGN_OF_POINTER 4 - -#define HAVE_LONG_LONG -#undef HAVE_ALIGNED_DOUBLES -#undef HAVE_ALIGNED_LONGLONGS - -#define PR_AF_INET6 24 /* same as AF_INET6 */ - -#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 - -/* used by protypes.h only */ -#define _PR_AIX_HAVE_BSD_INT_TYPES - -#endif /* NO_NSPR_10_SUPPORT */ - -#endif /* nspr_cpucfg___ */ diff --git a/pr/include/md/_beos.h b/pr/include/md/_beos.h index 232fea3c..1f69bd66 100644 --- a/pr/include/md/_beos.h +++ b/pr/include/md/_beos.h @@ -51,6 +51,10 @@ * Internal configuration macros */ +#ifdef BONE_VERSION +#define _PR_HAVE_SOCKADDR_LEN +#endif + #define PR_LINKER_ARCH "beos" #define _PR_SI_SYSNAME "BEOS" #ifdef __powerpc__ @@ -87,6 +91,7 @@ #define _PR_HAVE_PEEK_BUFFER #define _PR_PEEK_BUFFER_MAX (16 * 1024) #define _PR_FD_NEED_EMULATE_MSG_PEEK(fd) 1 +#define _PR_CONNECT_DOES_NOT_BIND /* Define threading functions and objects as native BeOS */ struct _MDThread { @@ -141,17 +146,21 @@ struct _MDSegment { ** File- and directory-related definitions */ +#ifndef BONE_VERSION #define BE_SOCK_SHUTDOWN_READ 0x01 #define BE_SOCK_SHUTDOWN_WRITE 0x02 +#endif struct _MDFileDesc { PRInt32 osfd; PRInt32 sock_state; PRBool accepted_socket; PRNetAddr peer_addr; +#ifndef BONE_VERSION PRBool connectValueValid; int connectReturnValue; int connectReturnError; +#endif }; struct _MDDir { @@ -175,14 +184,17 @@ struct _MDFileMap { * Network related definitions. */ +#ifndef BONE_VERSION #define IPPROTO_IP 0 #define AF_UNIX 2 #define TCP_NODELAY SO_NONBLOCK #define SO_LINGER -1 #define SO_ERROR 4 +#endif #define _PR_INTERRUPT_CHECK_INTERVAL_SECS 5 +#ifndef BONE_VERSION /* these aren't actually used. if they are, we're screwed */ struct protoent { char *p_name; /* official protocol name */ @@ -192,6 +204,7 @@ struct protoent { struct protoent* getprotobyname(const char* name); struct protoent* getprotobynumber(int number); +#endif /* * malloc() related definitions. @@ -304,6 +317,7 @@ struct protoent* getprotobynumber(int number); #define _MD_READ_DIR _MD_read_dir #define _MD_CLOSE_DIR _MD_close_dir #define _MD_MAKE_NONBLOCK _MD_make_nonblock +#define _MD_SET_FD_INHERITABLE _MD_set_fd_inheritable #define _MD_INIT_FD_INHERITABLE _MD_init_fd_inheritable #define _MD_QUERY_FD_INHERITABLE _MD_query_fd_inheritable #define _MD_OPEN _MD_open @@ -509,7 +523,7 @@ NSPR_API(PRInt32) _MD_open(const char *name, PRIntn osflags, PRIntn mode); NSPR_API(PRInt32) _MD_close_file(PRInt32 osfd); NSPR_API(PRInt32) _MD_read(PRFileDesc *fd, void *buf, PRInt32 amount); NSPR_API(PRInt32) _MD_write(PRFileDesc *fd, const void *buf, PRInt32 amount); -NSPR_API(PRInt32) _MD_writev(PRFileDesc *fd, struct PRIOVec *iov, PRInt32 iov_size, PRIntervalTime timeout); +NSPR_API(PRInt32) _MD_writev(PRFileDesc *fd, const PRIOVec *iov, PRInt32 iov_size, PRIntervalTime timeout); NSPR_API(PRInt32) _MD_lseek(PRFileDesc *fd, PRInt32 offset, int whence); NSPR_API(PRInt64) _MD_lseek64(PRFileDesc *fd, PRInt64 offset, int whence); NSPR_API(PRInt32) _MD_fsync(PRFileDesc *fd); diff --git a/pr/include/md/_darwin.cfg b/pr/include/md/_darwin.cfg index d06492b8..22fc1083 100644 --- a/pr/include/md/_darwin.cfg +++ b/pr/include/md/_darwin.cfg @@ -39,10 +39,6 @@ #define XP_UNIX #endif -#ifndef DARWIN -#define DARWIN -#endif - #define PR_AF_INET6 30 /* same as AF_INET6 */ #if defined(i386) diff --git a/pr/include/md/_freebsd.cfg b/pr/include/md/_freebsd.cfg index ad04ca20..7177478d 100644 --- a/pr/include/md/_freebsd.cfg +++ b/pr/include/md/_freebsd.cfg @@ -43,16 +43,16 @@ #define FREEBSD #endif +#define PR_AF_INET6 28 /* same as AF_INET6 */ + +#if defined(__i386__) + #define IS_LITTLE_ENDIAN 1 #undef IS_BIG_ENDIAN #define HAVE_LONG_LONG #undef HAVE_ALIGNED_DOUBLES #undef HAVE_ALIGNED_LONGLONGS -#define PR_AF_INET6 28 /* same as AF_INET6 */ - -#if defined(__i386__) - #define PR_BYTES_PER_BYTE 1 #define PR_BYTES_PER_SHORT 2 #define PR_BYTES_PER_INT 4 @@ -98,6 +98,7 @@ #define HAVE_LONG_LONG #define HAVE_ALIGNED_DOUBLES #define HAVE_ALIGNED_LONGLONGS +#define IS_64 #define PR_BYTES_PER_BYTE 1 #define PR_BYTES_PER_SHORT 2 diff --git a/pr/include/md/_freebsd.h b/pr/include/md/_freebsd.h index 0671b60f..844980c1 100644 --- a/pr/include/md/_freebsd.h +++ b/pr/include/md/_freebsd.h @@ -37,6 +37,9 @@ #include "prthread.h" +#if __FreeBSD__ >= 2 +#include /* for __FreeBSD_version */ +#endif #include #define PR_LINKER_ARCH "freebsd" @@ -65,19 +68,32 @@ #define _PR_HAVE_SOCKADDR_LEN #define _PR_STAT_HAS_ST_ATIMESPEC #define _PR_NO_LARGE_FILES -#if ( __FreeBSD__ > 2 ) -#if !defined(_PR_PTHREADS) + +#if defined(_PR_PTHREADS) +#if __FreeBSD_version >= 400008 /* - * libc_r doesn't have poll(). Although libc has poll(), it is not - * thread-safe so we can't use it in the pthreads version. + * libc_r before this version of FreeBSD doesn't have poll(). + * Although libc has poll(), it is not thread-safe so we can't + * use it in the pthreads version. */ #define _PR_POLL_AVAILABLE +#endif +#else +#if __FreeBSD_version >= 300000 +#define _PR_POLL_AVAILABLE #define _PR_USE_POLL #endif #endif + #define _PR_HAVE_SYSV_SEMAPHORES #define PR_HAVE_SYSV_NAMED_SHARED_MEMORY +#if __FreeBSD_version >= 400014 +#define _PR_INET6 +#define _PR_HAVE_GETHOSTBYNAME2 +#define _PR_INET6_PROBE +#endif + #define USE_SETJMP #ifndef _PR_PTHREADS diff --git a/pr/include/md/_hpux.h b/pr/include/md/_hpux.h index c83e7c3c..b09b7aaa 100644 --- a/pr/include/md/_hpux.h +++ b/pr/include/md/_hpux.h @@ -55,7 +55,11 @@ #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 diff --git a/pr/include/md/_hpux64.cfg b/pr/include/md/_hpux64.cfg index bacd0272..338e3016 100644 --- a/pr/include/md/_hpux64.cfg +++ b/pr/include/md/_hpux64.cfg @@ -82,8 +82,8 @@ #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_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 diff --git a/pr/include/md/_linux.h b/pr/include/md/_linux.h index 86ea248c..3f4b6735 100644 --- a/pr/include/md/_linux.h +++ b/pr/include/md/_linux.h @@ -470,4 +470,6 @@ extern int __syscall_poll(struct pollfd *ufds, unsigned long int nfds, /* For writev() */ #include +extern void _MD_linux_map_sendfile_error(int err); + #endif /* nspr_linux_defs_h___ */ diff --git a/pr/include/md/_macos.h b/pr/include/md/_macos.h index f1f0f8aa..90eb07db 100644 --- a/pr/include/md/_macos.h +++ b/pr/include/md/_macos.h @@ -65,6 +65,7 @@ #include #include +#include #define _PR_HAVE_PEEK_BUFFER #define _PR_PEEK_BUFFER_MAX (16 * 1024) @@ -105,7 +106,9 @@ struct _MDSegment { }; struct _MDCPU { - PRInt8 notused; + AbsoluteTime lastThreadSwitch; + AbsoluteTime lastWakeUpProcess; + PRBool trackScheduling; }; typedef struct _MDSocketCallerInfo { @@ -114,19 +117,22 @@ typedef struct _MDSocketCallerInfo { } _MDSocketCallerInfo; struct _MDFileDesc { - PRInt32 osfd; - PRBool orderlyDisconnect; - PRBool readReady; - PRBool writeReady; - PRBool exceptReady; - PRLock * miscLock; - - /* Server sockets: listen bit tells the notifier func what to do */ - PRBool doListen; - - _MDSocketCallerInfo misc; - _MDSocketCallerInfo read; - _MDSocketCallerInfo write; + PRInt32 osfd; + PRPackedBool orderlyDisconnect; + PRPackedBool readReady; + PRPackedBool writeReady; + PRPackedBool exceptReady; + PRLock * miscLock; + + /* Server sockets: listen bit tells the notifier func what to do */ + PRBool doListen; + + /* stored error for non-blocking connects, as a Unix-style error code */ + OTReason disconnectError; + + _MDSocketCallerInfo misc; + _MDSocketCallerInfo read; + _MDSocketCallerInfo write; }; /* @@ -172,7 +178,7 @@ extern void _MD_SetIntsOff(PRInt32 ints); #define _MD_CLEANUP_BEFORE_EXIT() #define _MD_EXIT(status) exit(status) #define _MD_INIT_CPUS() -#define _MD_INIT_RUNNING_CPU(cpu) +#define _MD_INIT_RUNNING_CPU(cpu) _MD_InitRunningCPU(cpu) /* ** Process Related definitions @@ -296,16 +302,20 @@ extern PRStatus _MD_InitThread(PRThread *thread); ** context switch because it might have changed. */ /* ResetTimer(); before _PR_Schedule() */ -#define _MD_SWITCH_CONTEXT(_thread) \ - PR_BEGIN_MACRO \ - PR_ASSERT(_thread->no_sched); \ - if (!setjmp(_thread->md.jb)) { \ - _MD_SET_LAST_THREAD(_thread); \ - _PR_Schedule(); \ - } else { \ - PR_ASSERT(_MD_LAST_THREAD() !=_MD_CURRENT_THREAD()); \ - _MD_LAST_THREAD()->no_sched = 0; \ - } \ + + +#define _MD_SWITCH_CONTEXT(_thread) \ + PR_BEGIN_MACRO \ + PR_ASSERT(_thread->no_sched); \ + if (!setjmp(_thread->md.jb)) { \ + _MD_SET_LAST_THREAD(_thread); \ + if (_PR_MD_CURRENT_CPU()->md.trackScheduling) \ + _PR_MD_CURRENT_CPU()->md.lastThreadSwitch = UpTime(); \ + _PR_Schedule(); \ + } else { \ + PR_ASSERT(_MD_LAST_THREAD() !=_MD_CURRENT_THREAD()); \ + _MD_LAST_THREAD()->no_sched = 0; \ + } \ PR_END_MACRO /* @@ -473,6 +483,7 @@ extern PRStatus _MD_setsockopt(PRFileDesc *fd, PRInt32 level, PRInt32 optname, c */ extern PRStatus _MD_gethostname(char *name, int namelen); #define _MD_GETHOSTNAME _MD_gethostname +#define _PR_GET_HOST_ADDR_AS_NAME /* XXX _MD_WRITEV, _MD_SHUTDOWN & _MD_GETPEERNAME not done yet!!! @@ -514,7 +525,6 @@ extern PRStatus _MD_gethostname(char *name, int namelen); ** Time Related definitions */ -#define kMacTimerInMiliSecs 8L #define _MD_GET_INTERVAL _MD_GetInterval #define _MD_INTERVAL_PER_SEC() PR_MSEC_PER_SEC #define _MD_INTERVAL_INIT() @@ -647,7 +657,7 @@ extern PRStatus _MD_CloseFileMap(struct PRFileMap *fmap); #define _MD_CLOSE_FILE_MAP _MD_CloseFileMap extern void SetLogFileTypeCreator(const char *logFile); -extern int _MD_mac_get_nonblocking_connect_error(PRInt32 osfd); +extern int _MD_mac_get_nonblocking_connect_error(PRFileDesc* fd); /* @@ -681,6 +691,18 @@ extern void LeaveCritialRegion(); #endif + +/* + * CPU Idle support + */ + +extern void InitIdleSemaphore(); +extern void TermIdleSemaphore(); + +extern void WaitOnIdleSemaphore(); +extern void SignalIdleSemaphore(); + + /* * Atomic operations */ diff --git a/pr/include/md/_nto.h b/pr/include/md/_nto.h index de6b8033..cd6213bf 100644 --- a/pr/include/md/_nto.h +++ b/pr/include/md/_nto.h @@ -212,4 +212,6 @@ struct _MDCPU { */ #define _MD_SELECT select +#define SA_RESTART 0 + #endif /* nspr_nto_defs_h___ */ diff --git a/pr/include/md/_openvms.h b/pr/include/md/_openvms.h index b0a2af6f..abf438f1 100644 --- a/pr/include/md/_openvms.h +++ b/pr/include/md/_openvms.h @@ -97,6 +97,7 @@ struct ip_mreq { #define _PR_USE_POLL #define _PR_STAT_HAS_ONLY_ST_ATIME #define _PR_NO_LARGE_FILES +#define _PR_STRICT_ADDR_LEN /* IPv6 support */ #ifdef _SOCKADDR_LEN diff --git a/pr/include/md/_os2.h b/pr/include/md/_os2.h index d98262d1..98d9b530 100644 --- a/pr/include/md/_os2.h +++ b/pr/include/md/_os2.h @@ -47,6 +47,31 @@ #include +#define USE_RAMSEM + +#ifdef USE_RAMSEM +#pragma pack(4) + +#pragma pack(2) +typedef struct _RAMSEM +{ + ULONG ulTIDPID; + ULONG hevSem; + ULONG cLocks; + USHORT cWaiting; + USHORT cPosts; +} RAMSEM, *PRAMSEM; + +typedef struct _CRITICAL_SECTION +{ + ULONG ulReserved[4]; /* Same size as RAMSEM */ +} CRITICAL_SECTION, *PCRITICAL_SECTION, *LPCRITICAL_SECTION; +#pragma pack(4) + +APIRET _Optlink SemRequest486(PRAMSEM, ULONG); +APIRET _Optlink SemReleasex86(PRAMSEM, ULONG); +#endif + #ifdef XP_OS2_EMX /* * EMX-specific tweaks: @@ -162,7 +187,11 @@ struct _MDNotified { }; struct _MDLock { - HMTX mutex; /* this is recursive on NT */ +#ifdef USE_RAMSEM + CRITICAL_SECTION mutex; /* this is recursive on NT */ +#else + HMTX mutex; /* this is recursive on NT */ +#endif /* * When notifying cvars, there is no point in actually @@ -258,7 +287,7 @@ extern void _MD_MakeNonblock(PRFileDesc *f); #define _MD_INIT_FD_INHERITABLE (_PR_MD_INIT_FD_INHERITABLE) #define _MD_QUERY_FD_INHERITABLE (_PR_MD_QUERY_FD_INHERITABLE) #define _MD_SHUTDOWN (_PR_MD_SHUTDOWN) -#define _MD_LISTEN(s, backlog) listen(s->secret->md.osfd,backlog) +#define _MD_LISTEN _PR_MD_LISTEN extern PRInt32 _MD_CloseSocket(PRInt32 osfd); #define _MD_CLOSE_SOCKET _MD_CloseSocket #define _MD_SENDTO (_PR_MD_SENDTO) @@ -349,11 +378,33 @@ extern PRInt32 _MD_Accept(PRFileDesc *fd, PRNetAddr *raddr, PRUint32 *rlen, #define _PR_LOCK _MD_LOCK #define _PR_UNLOCK _MD_UNLOCK +#ifdef USE_RAMSEM #define _MD_NEW_LOCK (_PR_MD_NEW_LOCK) -#define _MD_FREE_LOCK (_PR_MD_FREE_LOCK) -#define _MD_LOCK (_PR_MD_LOCK) -#define _MD_TEST_AND_LOCK (_PR_MD_TEST_AND_LOCK) -#define _MD_UNLOCK (_PR_MD_UNLOCK) +#define _MD_FREE_LOCK(lock) (DosCloseEventSem(((PRAMSEM)(&((lock)->mutex)))->hevSem)) +#define _MD_LOCK(lock) (SemRequest486(&((lock)->mutex), -1)) +#define _MD_TEST_AND_LOCK(lock) (SemRequest486(&((lock)->mutex), -1),0) +#define _MD_UNLOCK(lock) \ + PR_BEGIN_MACRO \ + if (0 != (lock)->notified.length) { \ + md_UnlockAndPostNotifies((lock), NULL, NULL); \ + } else { \ + SemReleasex86( &(lock)->mutex, 0 ); \ + } \ + PR_END_MACRO +#else +#define _MD_NEW_LOCK (_PR_MD_NEW_LOCK) +#define _MD_FREE_LOCK(lock) (DosCloseMutexSem((lock)->mutex)) +#define _MD_LOCK(lock) (DosRequestMutexSem((lock)->mutex, SEM_INDEFINITE_WAIT)) +#define _MD_TEST_AND_LOCK(lock) (DosRequestMutexSem((lock)->mutex, SEM_INDEFINITE_WAIT),0) +#define _MD_UNLOCK(lock) \ + PR_BEGIN_MACRO \ + if (0 != (lock)->notified.length) { \ + md_UnlockAndPostNotifies((lock), NULL, NULL); \ + } else { \ + DosReleaseMutexSem((lock)->mutex); \ + } \ + PR_END_MACRO +#endif /* --- lock and cv waiting --- */ #define _MD_WAIT (_PR_MD_WAIT) @@ -537,4 +588,6 @@ unsigned long _System _DLL_InitTerm( unsigned long mod_handle, unsigned long fla #define FreeLibrary(x) DosFreeModule((HMODULE)x) #define OutputDebugString(x) +extern int _MD_os2_get_nonblocking_connect_error(int osfd); + #endif /* nspr_os2_defs_h___ */ diff --git a/pr/include/md/_os2_errors.h b/pr/include/md/_os2_errors.h index f77e8f6e..f196a201 100644 --- a/pr/include/md/_os2_errors.h +++ b/pr/include/md/_os2_errors.h @@ -40,14 +40,17 @@ #include #endif +NSPR_API(void) _MD_os2_map_default_error(PRInt32 err); +#define _PR_MD_MAP_DEFAULT_ERROR _MD_os2_map_default_error + NSPR_API(void) _MD_os2_map_opendir_error(PRInt32 err); #define _PR_MD_MAP_OPENDIR_ERROR _MD_os2_map_opendir_error NSPR_API(void) _MD_os2_map_closedir_error(PRInt32 err); #define _PR_MD_MAP_CLOSEDIR_ERROR _MD_os2_map_closedir_error -NSPR_API(void) _MD_unix_readdir_error(PRInt32 err); -#define _PR_MD_MAP_READDIR_ERROR _MD_unix_readdir_error +NSPR_API(void) _MD_os2_readdir_error(PRInt32 err); +#define _PR_MD_MAP_READDIR_ERROR _MD_os2_readdir_error NSPR_API(void) _MD_os2_map_delete_error(PRInt32 err); #define _PR_MD_MAP_DELETE_ERROR _MD_os2_map_delete_error @@ -103,6 +106,9 @@ NSPR_API(void) _MD_os2_map_send_error(PRInt32 err); NSPR_API(void) _MD_os2_map_sendto_error(PRInt32 err); #define _PR_MD_MAP_SENDTO_ERROR _MD_os2_map_sendto_error +NSPR_API(void) _MD_os2_map_writev_error(int err); +#define _PR_MD_MAP_WRITEV_ERROR _MD_os2_map_writev_error + NSPR_API(void) _MD_os2_map_accept_error(PRInt32 err); #define _PR_MD_MAP_ACCEPT_ERROR _MD_os2_map_accept_error diff --git a/pr/include/md/_pth.h b/pr/include/md/_pth.h index faa50377..4cfbfe9a 100644 --- a/pr/include/md/_pth.h +++ b/pr/include/md/_pth.h @@ -91,7 +91,11 @@ #define _PT_PTHREAD_MUTEXATTR_DESTROY pthread_mutexattr_destroy #define _PT_PTHREAD_MUTEX_INIT(m, a) pthread_mutex_init(&(m), &(a)) #define _PT_PTHREAD_MUTEX_IS_LOCKED(m) (EBUSY == pthread_mutex_trylock(&(m))) +#if defined(DARWIN) +#define _PT_PTHREAD_CONDATTR_INIT(x) 0 +#else #define _PT_PTHREAD_CONDATTR_INIT pthread_condattr_init +#endif #define _PT_PTHREAD_CONDATTR_DESTROY pthread_condattr_destroy #define _PT_PTHREAD_COND_INIT(m, a) pthread_cond_init(&(m), &(a)) #endif @@ -181,24 +185,23 @@ #define PT_TRYLOCK_BUSY EBUSY #endif -/* - * These platforms don't have pthread_atfork() - */ -#if defined(_PR_DCETHREADS) || defined(FREEBSD) \ - || (defined(LINUX) && defined(__alpha)) \ - || defined(NETBSD) || defined(OPENBSD) -#define PT_NO_ATFORK -#endif - /* * These platforms don't have sigtimedwait() */ #if (defined(AIX) && !defined(AIX4_3)) || defined(LINUX) \ || defined(FREEBSD) || defined(NETBSD) || defined(OPENBSD) \ - || defined(BSDI) || defined(VMS) || defined(UNIXWARE) + || defined(BSDI) || defined(VMS) || defined(UNIXWARE) \ + || defined(DARWIN) #define PT_NO_SIGTIMEDWAIT #endif +/* + * These platforms don't have pthread_kill() + */ +#if defined(DARWIN) +#define pthread_kill(thread, sig) ENOSYS +#endif + #if defined(OSF1) || defined(VMS) #define PT_PRIO_MIN PRI_OTHER_MIN #define PT_PRIO_MAX PRI_OTHER_MAX @@ -225,7 +228,7 @@ #define PT_PRIO_MAX sched_get_priority_max(SCHED_OTHER) #endif /* defined(_PR_DCETHREADS) */ -#elif defined(LINUX) +#elif defined(LINUX) || defined(FREEBSD) #define PT_PRIO_MIN sched_get_priority_min(SCHED_OTHER) #define PT_PRIO_MAX sched_get_priority_max(SCHED_OTHER) #elif defined(NTO) @@ -245,7 +248,7 @@ */ #define PT_PRIO_MIN 1 #define PT_PRIO_MAX 127 -#elif defined(FREEBSD) || defined(NETBSD) || defined(OPENBSD) \ +#elif defined(NETBSD) || defined(OPENBSD) \ || defined(BSDI) || defined(DARWIN) || defined(UNIXWARE) /* XXX */ #define PT_PRIO_MIN 0 #define PT_PRIO_MAX 126 diff --git a/pr/include/md/_solaris.h b/pr/include/md/_solaris.h index a6412b69..42415a5b 100644 --- a/pr/include/md/_solaris.h +++ b/pr/include/md/_solaris.h @@ -784,5 +784,7 @@ PR_END_EXTERN_C #endif /* _PR_GLOBAL_THREADS_ONLY */ +extern void _MD_solaris_map_sendfile_error(int err); + #endif /* nspr_solaris_defs_h___ */ diff --git a/pr/include/md/_unixos.h b/pr/include/md/_unixos.h index 345c48d5..25ae239c 100644 --- a/pr/include/md/_unixos.h +++ b/pr/include/md/_unixos.h @@ -145,6 +145,9 @@ extern PRUint32 _pr_md_ioq_timeout; struct _MDFileDesc { int osfd; +#if defined(LINUX) && defined(_PR_PTHREADS) + int tcp_nodelay; /* used by pt_LinuxSendFile */ +#endif }; struct _MDDir { diff --git a/pr/include/md/_win16.h b/pr/include/md/_win16.h index 147ef77a..15edc7db 100644 --- a/pr/include/md/_win16.h +++ b/pr/include/md/_win16.h @@ -442,13 +442,6 @@ NSPR_API(void) _PR_NativeDestroyThread(PRThread *thread); NSPR_API(void) _PR_UserDestroyThread(PRThread *thread); -/* - * _PR_ShutdownLinker unloads all dlls loaded by the application via - * calls to PR_LoadLibrary - */ -void _PR_ShutdownLinker(void); - - /* ** If thread emulation is used, then setjmp/longjmp stores the register ** state of each thread. diff --git a/pr/include/md/_win95.h b/pr/include/md/_win95.h index 6a9bb271..86b39d5d 100644 --- a/pr/include/md/_win95.h +++ b/pr/include/md/_win95.h @@ -243,7 +243,7 @@ extern void _MD_MakeNonblock(PRFileDesc *f); #define _MD_INIT_FD_INHERITABLE _PR_MD_INIT_FD_INHERITABLE #define _MD_QUERY_FD_INHERITABLE _PR_MD_QUERY_FD_INHERITABLE #define _MD_SHUTDOWN _PR_MD_SHUTDOWN -#define _MD_LISTEN(s, backlog) listen(s->secret->md.osfd,backlog) +#define _MD_LISTEN _PR_MD_LISTEN extern PRInt32 _MD_CloseSocket(PRInt32 osfd); #define _MD_CLOSE_SOCKET _MD_CloseSocket #define _MD_SENDTO _PR_MD_SENDTO diff --git a/pr/include/obsolete/Makefile.in b/pr/include/obsolete/Makefile.in index 88342b0b..f2d78313 100644 --- a/pr/include/obsolete/Makefile.in +++ b/pr/include/obsolete/Makefile.in @@ -48,7 +48,7 @@ HEADERS = $(wildcard $(srcdir)/*.h) RELEASE_HEADERS = $(HEADERS) RELEASE_HEADERS_DEST = $(RELEASE_INCLUDE_DIR)/obsolete -includedir := $(includedir)/obsolete +include_subdir = obsolete include $(topsrcdir)/config/rules.mk diff --git a/pr/include/prinet.h b/pr/include/prinet.h index f5aea7eb..8dba5cd1 100644 --- a/pr/include/prinet.h +++ b/pr/include/prinet.h @@ -57,7 +57,7 @@ #define prinet_h__ #if defined(XP_UNIX) || defined(XP_OS2) || defined(XP_BEOS) -#ifdef linux +#ifdef LINUX #undef __STRICT_ANSI__ #define __STRICT_ANSI__ #endif diff --git a/pr/include/prinit.h b/pr/include/prinit.h index 0e8e124c..4bd983a2 100644 --- a/pr/include/prinit.h +++ b/pr/include/prinit.h @@ -60,11 +60,11 @@ PR_BEGIN_EXTERN_C ** The format of the version string is ** ".[.] []" */ -#define PR_VERSION "4.2 Beta" +#define PR_VERSION "4.2.1" #define PR_VMAJOR 4 #define PR_VMINOR 2 -#define PR_VPATCH 0 -#define PR_BETA PR_TRUE +#define PR_VPATCH 1 +#define PR_BETA PR_FALSE /* ** PRVersionCheck diff --git a/pr/include/prio.h b/pr/include/prio.h index f60e1f1a..29da2314 100644 --- a/pr/include/prio.h +++ b/pr/include/prio.h @@ -156,7 +156,7 @@ struct PRIPv6Addr { #define pr_s6_addr _S6_un._S6_u8 #define pr_s6_addr16 _S6_un._S6_u16 #define pr_s6_addr32 _S6_un._S6_u32 -#define pr_s6_addr64 _S6_un._S6_addr64 +#define pr_s6_addr64 _S6_un._S6_u64 typedef struct PRIPv6Addr PRIPv6Addr; diff --git a/pr/include/private/Makefile.in b/pr/include/private/Makefile.in index 31c82552..cafb86c8 100644 --- a/pr/include/private/Makefile.in +++ b/pr/include/private/Makefile.in @@ -49,7 +49,7 @@ RELEASE_HEADERS_DEST = $(RELEASE_INCLUDE_DIR)/private HEADERS = $(RELEASE_HEADERS) $(srcdir)/pprmwait.h $(srcdir)/primpl.h -includedir := $(includedir)/private +include_subdir = private include $(topsrcdir)/config/rules.mk diff --git a/pr/include/private/primpl.h b/pr/include/private/primpl.h index 8501c0e0..f6a1f63d 100644 --- a/pr/include/private/primpl.h +++ b/pr/include/private/primpl.h @@ -1716,6 +1716,13 @@ struct PRFilePrivate { PRBool appendMode; #endif _MDFileDesc md; +#ifdef _PR_STRICT_ADDR_LEN + PRUint16 af; /* If the platform requires passing the exact + * length of the sockaddr structure for the + * address family of the socket to socket + * functions like accept(), we need to save + * the address family of the socket. */ +#endif }; struct PRDir { @@ -1741,8 +1748,13 @@ extern void _PR_InitMW(void); extern void _PR_InitRWLocks(void); extern void _PR_NotifyCondVar(PRCondVar *cvar, PRThread *me); extern void _PR_CleanupThread(PRThread *thread); +extern void _PR_CleanupCallOnce(void); +extern void _PR_CleanupMW(void); +extern void _PR_CleanupDtoa(void); +extern void _PR_ShutdownLinker(void); extern void _PR_CleanupEnv(void); extern void _PR_CleanupIO(void); +extern void _PR_CleanupNet(void); extern void _PR_CleanupLayerCache(void); extern void _PR_CleanupStacks(void); extern void _PR_CleanupThreads(void); @@ -1800,7 +1812,7 @@ extern PRFileDesc *_pr_stderr; ** and functions with macros that expand to the native thread ** types and functions on each platform. */ -#if defined(_PR_PTHREADS) +#if defined(_PR_PTHREADS) && !defined(_PR_DCETHREADS) #define _PR_ZONE_ALLOCATOR #endif diff --git a/pr/include/prtypes.h b/pr/include/prtypes.h index b01673d0..508b9299 100644 --- a/pr/include/prtypes.h +++ b/pr/include/prtypes.h @@ -239,13 +239,15 @@ /*********************************************************************** ** MACROS: PR_ROUNDUP ** PR_MIN -** PR_MAX +** PR_MAX +** PR_ABS ** DESCRIPTION: ** Commonly used macros for operations on compatible types. ***********************************************************************/ #define PR_ROUNDUP(x,y) ((((x)+((y)-1))/(y))*(y)) #define PR_MIN(x,y) ((x)<(y)?(x):(y)) #define PR_MAX(x,y) ((x)>(y)?(x):(y)) +#define PR_ABS(x) ((x)<0?-(x):(x)) PR_BEGIN_EXTERN_C diff --git a/pr/src/io/prfdcach.c b/pr/src/io/prfdcach.c index 8803a419..82cbf058 100644 --- a/pr/src/io/prfdcach.c +++ b/pr/src/io/prfdcach.c @@ -73,7 +73,7 @@ static PRFileDesc **stack2fd = &(((PRFileDesc*)NULL)->higher); ** Get a FileDescriptor from the cache if one exists. If not allocate ** a new one from the heap. */ -PRFileDesc *_PR_Getfd() +PRFileDesc *_PR_Getfd(void) { PRFileDesc *fd; /* @@ -248,7 +248,7 @@ PR_IMPLEMENT(PRStatus) PR_SetFDCacheSize(PRIntn low, PRIntn high) return PR_SUCCESS; } /* PR_SetFDCacheSize */ -void _PR_InitFdCache() +void _PR_InitFdCache(void) { /* ** The fd caching is enabled by default for DEBUG builds, diff --git a/pr/src/io/prfile.c b/pr/src/io/prfile.c index e19705c7..adb2ea55 100644 --- a/pr/src/io/prfile.c +++ b/pr/src/io/prfile.c @@ -203,7 +203,7 @@ static PRStatus PR_CALLBACK PipeSync(PRFileDesc *fd) return PR_SUCCESS; } -static PRStatus PR_CALLBACK FileInfo(PRFileDesc *fd, PRFileInfo *info) +static PRStatus PR_CALLBACK FileGetInfo(PRFileDesc *fd, PRFileInfo *info) { PRInt32 rv; @@ -214,7 +214,7 @@ static PRStatus PR_CALLBACK FileInfo(PRFileDesc *fd, PRFileInfo *info) return PR_SUCCESS; } -static PRStatus PR_CALLBACK FileInfo64(PRFileDesc *fd, PRFileInfo64 *info) +static PRStatus PR_CALLBACK FileGetInfo64(PRFileDesc *fd, PRFileInfo64 *info) { #ifdef XP_MAC #pragma unused( fd, info ) @@ -276,8 +276,8 @@ static PRIOMethods _pr_fileMethods = { FileSync, FileSeek, FileSeek64, - FileInfo, - FileInfo64, + FileGetInfo, + FileGetInfo64, (PRWritevFN)_PR_InvalidInt, (PRConnectFN)_PR_InvalidStatus, (PRAcceptFN)_PR_InvalidDesc, @@ -735,7 +735,7 @@ PR_IMPLEMENT(PRStatus) PR_CreatePipe( (*readPipe)->secret->inheritable = _PR_TRI_TRUE; (*writePipe)->secret->inheritable = _PR_TRI_TRUE; return PR_SUCCESS; -#elif defined(XP_UNIX) || defined(XP_OS2) +#elif defined(XP_UNIX) || defined(XP_OS2) || defined(XP_BEOS) #ifdef XP_OS2 HFILE pipefd[2]; #else @@ -765,9 +765,13 @@ PR_IMPLEMENT(PRStatus) PR_CreatePipe( close(pipefd[1]); return PR_FAILURE; } - _MD_MakeNonblock(*readPipe); +#ifndef XP_BEOS /* Pipes are nonblocking on BeOS */ + _PR_MD_MAKE_NONBLOCK(*readPipe); +#endif _PR_MD_INIT_FD_INHERITABLE(*readPipe, PR_FALSE); - _MD_MakeNonblock(*writePipe); +#ifndef XP_BEOS /* Pipes are nonblocking on BeOS */ + _PR_MD_MAKE_NONBLOCK(*writePipe); +#endif _PR_MD_INIT_FD_INHERITABLE(*writePipe, PR_FALSE); return PR_SUCCESS; #else diff --git a/pr/src/io/prio.c b/pr/src/io/prio.c index 250d9b6f..36c8df8a 100644 --- a/pr/src/io/prio.c +++ b/pr/src/io/prio.c @@ -164,7 +164,7 @@ PR_IMPLEMENT(PRStatus) PR_SetFDInheritable( PRFileDesc *fd, PRBool inheritable) { -#if defined(XP_UNIX) || defined(WIN32) || defined(XP_OS2) +#if defined(XP_UNIX) || defined(WIN32) || defined(XP_OS2) || defined(XP_BEOS) /* * Only a non-layered, NSPR file descriptor can be inherited * by a child process. diff --git a/pr/src/io/priometh.c b/pr/src/io/priometh.c index a2b8e9c8..b9279fad 100644 --- a/pr/src/io/priometh.c +++ b/pr/src/io/priometh.c @@ -76,21 +76,21 @@ PRIOMethods _pr_faulty_methods = { (PRReservedFN)_PR_InvalidInt }; -PRIntn _PR_InvalidInt() +PRIntn _PR_InvalidInt(void) { PR_ASSERT(!"I/O method is invalid"); PR_SetError(PR_INVALID_METHOD_ERROR, 0); return -1; } /* _PR_InvalidInt */ -PRInt16 _PR_InvalidInt16() +PRInt16 _PR_InvalidInt16(void) { PR_ASSERT(!"I/O method is invalid"); PR_SetError(PR_INVALID_METHOD_ERROR, 0); return -1; } /* _PR_InvalidInt */ -PRInt64 _PR_InvalidInt64() +PRInt64 _PR_InvalidInt64(void) { PRInt64 rv; LL_I2L(rv, -1); @@ -103,7 +103,7 @@ PRInt64 _PR_InvalidInt64() * An invalid method that returns PRStatus */ -PRStatus _PR_InvalidStatus() +PRStatus _PR_InvalidStatus(void) { PR_ASSERT(!"I/O method is invalid"); PR_SetError(PR_INVALID_METHOD_ERROR, 0); @@ -114,7 +114,7 @@ PRStatus _PR_InvalidStatus() * An invalid method that returns a pointer */ -PRFileDesc *_PR_InvalidDesc() +PRFileDesc *_PR_InvalidDesc(void) { PR_ASSERT(!"I/O method is invalid"); PR_SetError(PR_INVALID_METHOD_ERROR, 0); diff --git a/pr/src/io/prlayer.c b/pr/src/io/prlayer.c index d74fa8be..d377f546 100644 --- a/pr/src/io/prlayer.c +++ b/pr/src/io/prlayer.c @@ -459,7 +459,7 @@ static PRIOMethods pl_methods = { (PRReservedFN)_PR_InvalidInt }; -PR_IMPLEMENT(const PRIOMethods*) PR_GetDefaultIOMethods() +PR_IMPLEMENT(const PRIOMethods*) PR_GetDefaultIOMethods(void) { return &pl_methods; } /* PR_GetDefaultIOMethods */ @@ -736,7 +736,7 @@ PR_IMPLEMENT(PRFileDesc*) PR_GetIdentitiesLayer(PRFileDesc* fd, PRDescIdentity i return NULL; } /* PR_GetIdentitiesLayer */ -void _PR_InitLayerCache() +void _PR_InitLayerCache(void) { memset(&identity_cache, 0, sizeof(identity_cache)); identity_cache.ml = PR_NewLock(); diff --git a/pr/src/io/prlog.c b/pr/src/io/prlog.c index 16f68823..334fddcc 100644 --- a/pr/src/io/prlog.c +++ b/pr/src/io/prlog.c @@ -277,11 +277,16 @@ void _PR_LogCleanup(void) while (lm != NULL) { PRLogModuleInfo *next = lm->next; - PR_Free((/*const*/ char *)lm->name); + free((/*const*/ char *)lm->name); PR_Free(lm); lm = next; } logModules = NULL; + + if (_pr_logLock) { + PR_DestroyLock(_pr_logLock); + _pr_logLock = NULL; + } } static void _PR_SetLogModuleLevel( PRLogModuleInfo *lm ) @@ -361,7 +366,7 @@ PR_IMPLEMENT(PRBool) PR_SetLogFile(const char *file) #else PRFileDesc *newLogFile; - newLogFile = PR_Open(file, PR_WRONLY|PR_CREATE_FILE, 0666); + newLogFile = PR_Open(file, PR_WRONLY|PR_CREATE_FILE|PR_TRUNCATE, 0666); if (newLogFile) { if (logFile && logFile != _pr_stdout && logFile != _pr_stderr) { PR_Close(logFile); diff --git a/pr/src/io/prmapopt.c b/pr/src/io/prmapopt.c index f017c36a..5828bf9e 100644 --- a/pr/src/io/prmapopt.c +++ b/pr/src/io/prmapopt.c @@ -57,7 +57,7 @@ #include /* n_short, n_long, n_time */ #endif -#if defined(XP_UNIX) || defined(OS2) +#if defined(XP_UNIX) || defined(OS2) || (defined(XP_BEOS) && defined(BONE_VERSION)) #include /* TCP_NODELAY, TCP_MAXSEG */ #endif @@ -86,7 +86,7 @@ PRStatus PR_CALLBACK _PR_SocketGetSocketOption(PRFileDesc *fd, PRSocketOptionDat { case PR_SockOpt_Linger: { -#if !defined(XP_BEOS) +#if !defined(XP_BEOS) || defined(BONE_VERSION) struct linger linger; length = sizeof(linger); rv = _PR_MD_GETSOCKOPT( @@ -244,7 +244,7 @@ PRStatus PR_CALLBACK _PR_SocketSetSocketOption(PRFileDesc *fd, const PRSocketOpt { case PR_SockOpt_Linger: { -#if !defined(XP_BEOS) +#if !defined(XP_BEOS) || defined(BONE_VERSION) struct linger linger; linger.l_onoff = data->value.linger.polarity; linger.l_linger = PR_IntervalToSeconds(data->value.linger.linger); diff --git a/pr/src/io/prmwait.c b/pr/src/io/prmwait.c index a48fbc19..65ea1cd6 100644 --- a/pr/src/io/prmwait.c +++ b/pr/src/io/prmwait.c @@ -58,19 +58,8 @@ typedef struct TimerEvent { struct { PRLock *ml; PRCondVar *new_timer; - PRCondVar *cancel_timer; /* The cancel_timer condition variable is - * used to cancel a timer (i.e., remove a - * timer event from the timer queue). At - * startup I'm borrowing this condition - * variable for a different purpose (to - * tell the primordial thread that the - * timer manager thread has started) so - * that I don't need to create a new - * condition variable just for this one - * time use. - */ + PRCondVar *cancel_timer; PRThread *manager_thread; - PRBool manager_started; PRCList timer_queue; } tm_vars; @@ -88,11 +77,6 @@ static void TimerManager(void *arg) TimerEvent *timer; PR_Lock(tm_vars.ml); - /* tell the primordial thread that we have started */ - tm_vars.manager_started = PR_TRUE; - if (!_native_threads_only) { - PR_NotifyCondVar(tm_vars.cancel_timer); - } while (1) { if (PR_CLIST_IS_EMPTY(&tm_vars.timer_queue)) @@ -216,16 +200,6 @@ static PRStatus TimerInit(void) { goto failed; } - /* - * Need to wait until the timer manager thread starts - * if the timer manager thread is a local thread. - */ - if (!_native_threads_only) { - PR_Lock(tm_vars.ml); - while (!tm_vars.manager_started) - PR_WaitCondVar(tm_vars.cancel_timer, PR_INTERVAL_NO_TIMEOUT); - PR_Unlock(tm_vars.ml); - } return PR_SUCCESS; failed: @@ -269,6 +243,17 @@ void _PR_InitMW(void) max_polling_interval = PR_MillisecondsToInterval(MAX_POLLING_INTERVAL); } /* _PR_InitMW */ +void _PR_CleanupMW(void) +{ + PR_DestroyLock(mw_lock); + mw_lock = NULL; + if (mw_state->group) { + PR_DestroyWaitGroup(mw_state->group); + /* mw_state->group is set to NULL as a side effect. */ + } + PR_DELETE(mw_state); +} /* _PR_CleanupMW */ + static PRWaitGroup *MW_Init2(void) { PRWaitGroup *group = mw_state->group; /* it's the null group */ diff --git a/pr/src/io/prsocket.c b/pr/src/io/prsocket.c index 2483f963..652632fc 100644 --- a/pr/src/io/prsocket.c +++ b/pr/src/io/prsocket.c @@ -338,27 +338,16 @@ static PRStatus PR_CALLBACK SocketConnectContinue( #elif defined(XP_OS2) - if (out_flags & PR_POLL_EXCEPT) { - int len = sizeof(err); - if (getsockopt(osfd, SOL_SOCKET, SO_ERROR, (char *) &err, &len) - < 0) { - _PR_MD_MAP_GETSOCKOPT_ERROR(sock_errno()); - return PR_FAILURE; - } - if (err != 0) { - _PR_MD_MAP_CONNECT_ERROR(err); - } else { - PR_SetError(PR_UNKNOWN_ERROR, 0); - } + err = _MD_os2_get_nonblocking_connect_error(osfd); + if (err != 0) { + _PR_MD_MAP_CONNECT_ERROR(err); return PR_FAILURE; } - - PR_ASSERT(out_flags & PR_POLL_WRITE); return PR_SUCCESS; #elif defined(XP_MAC) - err = _MD_mac_get_nonblocking_connect_error(osfd); + err = _MD_mac_get_nonblocking_connect_error(fd); if (err == -1) return PR_FAILURE; else @@ -366,13 +355,23 @@ static PRStatus PR_CALLBACK SocketConnectContinue( #elif defined(XP_BEOS) +#ifdef BONE_VERSION /* bug 122364 */ + /* temporary workaround until getsockopt(SO_ERROR) works in BONE */ + if (out_flags & PR_POLL_EXCEPT) { + PR_SetError(PR_CONNECT_REFUSED_ERROR, 0); + return PR_FAILURE; + } + PR_ASSERT(out_flags & PR_POLL_WRITE); + return PR_SUCCESS; +#else err = _MD_beos_get_nonblocking_connect_error(fd); if( err != 0 ) { - _PR_MD_MAP_CONNECT_ERROR(err); - return PR_FAILURE; + _PR_MD_MAP_CONNECT_ERROR(err); + return PR_FAILURE; } else - return PR_SUCCESS; + return PR_SUCCESS; +#endif /* BONE_VERSION */ #else PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0); @@ -1396,7 +1395,7 @@ PR_IMPLEMENT(PRStatus) PR_NewTCPSocketPair(PRFileDesc *f[]) */ SOCKET listenSock; SOCKET osfd[2]; - struct sockaddr_in selfAddr; + struct sockaddr_in selfAddr, peerAddr; int addrLen; if (!_pr_initialized) _PR_ImplicitInitialization(); @@ -1440,10 +1439,24 @@ PR_IMPLEMENT(PRStatus) PR_NewTCPSocketPair(PRFileDesc *f[]) addrLen) == SOCKET_ERROR) { goto failed; } - osfd[1] = accept(listenSock, NULL, NULL); + /* + * A malicious local process may connect to the listening + * socket, so we need to verify that the accepted connection + * is made from our own socket osfd[0]. + */ + if (getsockname(osfd[0], (struct sockaddr *) &selfAddr, + &addrLen) == SOCKET_ERROR) { + goto failed; + } + osfd[1] = accept(listenSock, (struct sockaddr *) &peerAddr, &addrLen); if (osfd[1] == INVALID_SOCKET) { goto failed; } + if (peerAddr.sin_port != selfAddr.sin_port) { + /* the connection we accepted is not from osfd[0] */ + PR_SetError(PR_INSUFFICIENT_RESOURCES_ERROR, 0); + goto failed; + } closesocket(listenSock); f[0] = PR_AllocFileDesc(osfd[0], PR_GetTCPMethods()); @@ -1480,7 +1493,7 @@ failed: * default implementation */ PRFileDesc *listenSock; - PRNetAddr selfAddr; + PRNetAddr selfAddr, peerAddr; PRUint16 port; f[0] = f[1] = NULL; @@ -1503,6 +1516,17 @@ failed: if (f[0] == NULL) { goto failed; } +#ifdef _PR_CONNECT_DOES_NOT_BIND + /* + * If connect does not implicitly bind the socket (e.g., on + * BeOS), we have to bind the socket so that we can get its + * port with getsockname later. + */ + PR_InitializeNetAddr(PR_IpAddrLoopback, 0, &selfAddr); + if (PR_Bind(f[0], &selfAddr) == PR_FAILURE) { + goto failed; + } +#endif PR_InitializeNetAddr(PR_IpAddrLoopback, port, &selfAddr); /* @@ -1518,10 +1542,23 @@ failed: == PR_FAILURE) { goto failed; } - f[1] = PR_Accept(listenSock, NULL, PR_INTERVAL_NO_TIMEOUT); + /* + * A malicious local process may connect to the listening + * socket, so we need to verify that the accepted connection + * is made from our own socket f[0]. + */ + if (PR_GetSockName(f[0], &selfAddr) == PR_FAILURE) { + goto failed; + } + f[1] = PR_Accept(listenSock, &peerAddr, PR_INTERVAL_NO_TIMEOUT); if (f[1] == NULL) { goto failed; } + if (peerAddr.inet.port != selfAddr.inet.port) { + /* the connection we accepted is not from f[0] */ + PR_SetError(PR_INSUFFICIENT_RESOURCES_ERROR, 0); + goto failed; + } PR_Close(listenSock); return PR_SUCCESS; @@ -1532,6 +1569,9 @@ failed: if (f[0]) { PR_Close(f[0]); } + if (f[1]) { + PR_Close(f[1]); + } return PR_FAILURE; #endif } @@ -1539,20 +1579,14 @@ failed: PR_IMPLEMENT(PRInt32) PR_FileDesc2NativeHandle(PRFileDesc *fd) { - if (fd) { - /* - * The fd may be layered. Chase the links to the - * bottom layer to get the osfd. - */ - PRFileDesc *bottom = fd; - while (bottom->lower != NULL) { - bottom = bottom->lower; - } - return bottom->secret->md.osfd; - } else { - PR_SetError(PR_INVALID_ARGUMENT_ERROR, 0); - return -1; - } + if (fd) { + fd = PR_GetIdentitiesLayer(fd, PR_NSPR_IO_LAYER); + } + if (!fd) { + PR_SetError(PR_INVALID_ARGUMENT_ERROR, 0); + return -1; + } + return fd->secret->md.osfd; } PR_IMPLEMENT(void) diff --git a/pr/src/linking/prlink.c b/pr/src/linking/prlink.c index b3802055..24a15f8a 100644 --- a/pr/src/linking/prlink.c +++ b/pr/src/linking/prlink.c @@ -262,6 +262,10 @@ void _PR_InitLinker(void) } #if defined(WIN16) +/* + * _PR_ShutdownLinker unloads all dlls loaded by the application via + * calls to PR_LoadLibrary + */ void _PR_ShutdownLinker(void) { PR_EnterMonitor(pr_linker_lock); @@ -282,6 +286,32 @@ void _PR_ShutdownLinker(void) PR_DestroyMonitor(pr_linker_lock); pr_linker_lock = NULL; } +#else +/* + * _PR_ShutdownLinker was originally only used on WIN16 (see above), + * but I think it should also be used on other platforms. However, + * I disagree with the original implementation's unloading the dlls + * for the application. Any dlls that still remain on the pr_loadmap + * list when NSPR shuts down are application programming errors. The + * only exception is pr_exe_loadmap, which was added to the list by + * NSPR and hence should be cleaned up by NSPR. + */ +void _PR_ShutdownLinker(void) +{ + /* FIXME: pr_exe_loadmap should be destroyed. */ + + PR_DestroyMonitor(pr_linker_lock); + pr_linker_lock = NULL; + + if (_pr_currentLibPath) { + free(_pr_currentLibPath); + _pr_currentLibPath = NULL; + } + +#if !defined(USE_DLFCN) && !defined(HAVE_STRERROR) + PR_DELETE(errStrBuf); +#endif +} #endif /******************************************************************************/ @@ -292,7 +322,9 @@ PR_IMPLEMENT(PRStatus) PR_SetLibraryPath(const char *path) if (!_pr_initialized) _PR_ImplicitInitialization(); PR_EnterMonitor(pr_linker_lock); - PR_FREEIF(_pr_currentLibPath); + if (_pr_currentLibPath) { + free(_pr_currentLibPath); + } if (path) { _pr_currentLibPath = strdup(path); if (!_pr_currentLibPath) { @@ -310,7 +342,7 @@ PR_IMPLEMENT(PRStatus) PR_SetLibraryPath(const char *path) ** Return the library path for finding shared libraries. */ PR_IMPLEMENT(char *) -PR_GetLibraryPath() +PR_GetLibraryPath(void) { char *ev; char *copy = NULL; /* a copy of _pr_currentLibPath */ @@ -342,7 +374,7 @@ PR_GetLibraryPath() ev = ""; len = strlen(ev) + 1; /* +1 for the null */ - p = (char*) PR_MALLOC(len); + p = (char*) malloc(len); if (p) { strcpy(p, ev); } @@ -369,7 +401,7 @@ PR_GetLibraryPath() #endif len = strlen(ev) + 1; /* +1 for the null */ - p = (char*) PR_MALLOC(len); + p = (char*) malloc(len); if (p) { strcpy(p, ev); } /* if (p) */ @@ -1148,7 +1180,8 @@ PR_UnloadLibrary(PRLibrary *lib) freeLib: PR_LOG(_pr_linker_lm, PR_LOG_MIN, ("Unloaded library %s", lib->name)); - PR_DELETE(lib->name); + free(lib->name); + lib->name = NULL; PR_DELETE(lib); if (result == -1) { PR_SetError(PR_UNLOAD_LIBRARY_ERROR, _MD_ERRNO()); diff --git a/pr/src/malloc/prmem.c b/pr/src/malloc/prmem.c index 0a70b439..20cf7e99 100644 --- a/pr/src/malloc/prmem.c +++ b/pr/src/malloc/prmem.c @@ -97,20 +97,79 @@ _PR_DestroyZones(void) while (mz->head) { MemBlockHdr *hdr = mz->head; mz->head = hdr->s.next; /* unlink it */ - pr_ZoneFree(hdr); + free(hdr); mz->elements--; } } } + use_zone_allocator = PR_FALSE; } +/* +** pr_FindSymbolInProg +** +** Find the specified data symbol in the program and return +** its address. +*/ + +#ifdef USE_DLFCN + +#include + +static void * +pr_FindSymbolInProg(const char *name) +{ + void *h; + void *sym; + + h = dlopen(0, RTLD_LAZY); + if (h == NULL) + return NULL; + sym = dlsym(h, name); + (void)dlclose(h); + return sym; +} + +#elif defined(USE_HPSHL) + +#include + +static void * +pr_FindSymbolInProg(const char *name) +{ + shl_t h = NULL; + void *sym; + + if (shl_findsym(&h, name, TYPE_DATA, &sym) == -1) + return NULL; + return sym; +} + +#elif defined(USE_MACH_DYLD) + +static void * +pr_FindSymbolInProg(const char *name) +{ + /* FIXME: not implemented */ + return NULL; +} + +#else + +#error "The zone allocator is not supported on this platform" + +#endif + void _PR_InitZones(void) { int i, j; char *envp; + PRBool *sym; - if (envp = getenv("NSPR_USE_ZONE_ALLOCATOR")) { + if ((sym = pr_FindSymbolInProg("nspr_use_zone_allocator")) != NULL) { + use_zone_allocator = *sym; + } else if ((envp = getenv("NSPR_USE_ZONE_ALLOCATOR")) != NULL) { use_zone_allocator = (atoi(envp) == 1); } @@ -275,6 +334,11 @@ pr_ZoneRealloc(void *oldptr, PRUint32 bytes) PR_ASSERT(mb->s.magic == ZONE_MAGIC); if (mb->s.magic != ZONE_MAGIC) { /* Maybe this just came from ordinary malloc */ +#ifdef DEBUG + fprintf(stderr, + "Warning: reallocing memory block %p from ordinary malloc\n", + oldptr); +#endif /* We don't know how big it is. But we can fix that. */ oldptr = realloc(oldptr, bytes); if (!oldptr) { @@ -329,6 +393,10 @@ pr_ZoneFree(void *ptr) if (mb->s.magic != ZONE_MAGIC) { /* maybe this came from ordinary malloc */ +#ifdef DEBUG + fprintf(stderr, + "Warning: freeing memory block %p from ordinary malloc\n", ptr); +#endif free(ptr); return; } @@ -342,7 +410,7 @@ pr_ZoneFree(void *ptr) if (!mz) { PR_ASSERT(blockSize > 65536); /* This block was not in any zone. Just free it. */ - free(ptr); + free(mb); return; } PR_ASSERT(mz->blockSize == blockSize); diff --git a/pr/src/md/beos/bfile.c b/pr/src/md/beos/bfile.c index e80181cc..38da1f33 100644 --- a/pr/src/md/beos/bfile.c +++ b/pr/src/md/beos/bfile.c @@ -118,18 +118,45 @@ _MD_make_nonblock (PRFileDesc *fd) } +PRStatus +_MD_set_fd_inheritable (PRFileDesc *fd, PRBool inheritable) +{ + int rv; + + rv = fcntl(fd->secret->md.osfd, F_SETFD, inheritable ? 0 : FD_CLOEXEC); + if (-1 == rv) { + PR_SetError(PR_UNKNOWN_ERROR, _MD_ERRNO()); + return PR_FAILURE; + } + return PR_SUCCESS; +} + void _MD_init_fd_inheritable (PRFileDesc *fd, PRBool imported) { - /* XXX this function needs to be implemented */ - fd->secret->inheritable = _PR_TRI_UNKNOWN; + if (imported) { + fd->secret->inheritable = _PR_TRI_UNKNOWN; + } else { + int flags = fcntl(fd->secret->md.osfd, F_GETFD, 0); + if (flags == -1) { + PR_SetError(PR_UNKNOWN_ERROR, _MD_ERRNO()); + return; + } + fd->secret->inheritable = (flags & FD_CLOEXEC) ? + _PR_TRI_TRUE : _PR_TRI_FALSE; + } } void _MD_query_fd_inheritable (PRFileDesc *fd) { - /* XXX this function needs to be implemented */ - PR_ASSERT(0); + int flags; + + PR_ASSERT(_PR_TRI_UNKNOWN == fd->secret->inheritable); + flags = fcntl(fd->secret->md.osfd, F_GETFD, 0); + PR_ASSERT(-1 != flags); + fd->secret->inheritable = (flags & FD_CLOEXEC) ? + _PR_TRI_FALSE : _PR_TRI_TRUE; } PRInt32 @@ -223,12 +250,14 @@ _MD_write (PRFileDesc *fd, const void *buf, PRInt32 amount) return( rv ); } +#ifndef BONE_VERSION /* Writev moves to bnet.c with BONE */ PRInt32 -_MD_writev (PRFileDesc *fd, struct PRIOVec *iov, PRInt32 iov_size, +_MD_writev (PRFileDesc *fd, const PRIOVec *iov, PRInt32 iov_size, PRIntervalTime timeout) { return PR_NOT_IMPLEMENTED_ERROR; } +#endif PRInt32 _MD_lseek (PRFileDesc *fd, PRInt32 offset, int whence) @@ -524,191 +553,277 @@ int rv, err; } PRInt32 -_MD_pr_poll (PRPollDesc *pds, PRIntn npds, PRIntervalTime timeout) +_MD_pr_poll(PRPollDesc *pds, PRIntn npds, PRIntervalTime timeout) { - PRInt32 rc = 0; - fd_set rd, wr; - struct timeval tv, *tvp = NULL; + PRInt32 rv = 0; + PRThread *me = _PR_MD_CURRENT_THREAD(); + /* + * This code is almost a duplicate of w32poll.c's _PR_MD_PR_POLL(). + */ + fd_set rd, wt, ex; + PRFileDesc *bottom; PRPollDesc *pd, *epd; - int i = 0, j = 0; - int maxfd = -1; - PRInt32 osfd; - PRInt16 in_flags; - PRFileDesc *bottom; + PRInt32 maxfd = -1, ready, err; + PRIntervalTime remaining, elapsed, start; - /*printf("POLL: entering _MD_pr_poll\n");*/ - - /* - * Is it an empty set? If so, just sleep for the timeout and return - */ - if (npds < 1) - { - /*printf("POLL: empty set. exiting _MD_pr_poll\n");*/ - PR_Sleep(timeout); - return rc; - } + struct timeval tv, *tvp = NULL; + + if (_PR_PENDING_INTERRUPT(me)) + { + me->flags &= ~_PR_INTERRUPT; + PR_SetError(PR_PENDING_INTERRUPT_ERROR, 0); + return -1; + } + + if (0 == npds) { + PR_Sleep(timeout); + return rv; + } - FD_ZERO(&rd); - FD_ZERO(&wr); + FD_ZERO(&rd); + FD_ZERO(&wt); + FD_ZERO(&ex); - /* - * first, sort out the new connects, the reads, and the writes - */ - epd = pds + npds; - for(pd = pds; pd < epd; pd++) + ready = 0; + for (pd = pds, epd = pd + npds; pd < epd; pd++) { - in_flags = pd->in_flags; - bottom = pd->fd; + PRInt16 in_flags_read = 0, in_flags_write = 0; + PRInt16 out_flags_read = 0, out_flags_write = 0; - if(bottom != 0 && in_flags != 0) + if ((NULL != pd->fd) && (0 != pd->in_flags)) { - while(bottom->lower != 0) + if (pd->in_flags & PR_POLL_READ) { - bottom = bottom->lower; + in_flags_read = (pd->fd->methods->poll)(pd->fd, pd->in_flags & ~PR_POLL_WRITE, &out_flags_read); } - osfd = bottom->secret->md.osfd; - - if(in_flags & PR_POLL_WRITE || in_flags & PR_POLL_EXCEPT) + if (pd->in_flags & PR_POLL_WRITE) { - /*printf("POLL: adding to write\n");*/ - FD_SET(osfd, &wr); - if( osfd > maxfd ) maxfd = osfd; + in_flags_write = (pd->fd->methods->poll)(pd->fd, pd->in_flags & ~PR_POLL_READ, &out_flags_write); } - if(in_flags & PR_POLL_READ || in_flags & PR_POLL_EXCEPT) + if ((0 != (in_flags_read & out_flags_read)) + || (0 != (in_flags_write & out_flags_write))) { - /*printf("POLL: adding to read\n");*/ - FD_SET(osfd, &rd); - if( osfd > maxfd ) maxfd = osfd; + /* this one's ready right now */ + if (0 == ready) + { + /* + * We will have to return without calling the + * system poll/select function. So zero the + * out_flags fields of all the poll descriptors + * before this one. + */ + PRPollDesc *prev; + for (prev = pds; prev < pd; prev++) + { + prev->out_flags = 0; + } + } + ready += 1; + pd->out_flags = out_flags_read | out_flags_write; + } + else + { + pd->out_flags = 0; /* pre-condition */ + + /* make sure this is an NSPR supported stack */ + bottom = PR_GetIdentitiesLayer(pd->fd, PR_NSPR_IO_LAYER); + PR_ASSERT(NULL != bottom); /* what to do about that? */ + if ((NULL != bottom) + && (_PR_FILEDESC_OPEN == bottom->secret->state)) + { + if (0 == ready) + { + PRInt32 osfd = bottom->secret->md.osfd; + if (osfd > maxfd) maxfd = osfd; + if (in_flags_read & PR_POLL_READ) + { + pd->out_flags |= _PR_POLL_READ_SYS_READ; + FD_SET(osfd, &rd); + } + if (in_flags_read & PR_POLL_WRITE) + { + pd->out_flags |= _PR_POLL_READ_SYS_WRITE; + FD_SET(osfd, &wt); + } + if (in_flags_write & PR_POLL_READ) + { + pd->out_flags |= _PR_POLL_WRITE_SYS_READ; + FD_SET(osfd, &rd); + } + if (in_flags_write & PR_POLL_WRITE) + { + pd->out_flags |= _PR_POLL_WRITE_SYS_WRITE; + FD_SET(osfd, &wt); + } + if (pd->in_flags & PR_POLL_EXCEPT) FD_SET(osfd, &ex); + } + } + else + { + if (0 == ready) + { + PRPollDesc *prev; + for (prev = pds; prev < pd; prev++) + { + prev->out_flags = 0; + } + } + ready += 1; /* this will cause an abrupt return */ + pd->out_flags = PR_POLL_NVAL; /* bogii */ + } } } - - - } + } + + if (0 != ready) return ready; /* no need to block */ - if(maxfd >= 0) + remaining = timeout; + start = PR_IntervalNow(); + + retry: + if (timeout != PR_INTERVAL_NO_TIMEOUT) + { + PRInt32 ticksPerSecond = PR_TicksPerSecond(); + tv.tv_sec = remaining / ticksPerSecond; + tv.tv_usec = remaining - (ticksPerSecond * tv.tv_sec); + tv.tv_usec = (PR_USEC_PER_SEC * tv.tv_usec) / ticksPerSecond; + tvp = &tv; + } + + ready = _MD_SELECT(maxfd + 1, &rd, &wt, &ex, tvp); + + if (ready == -1 && errno == EINTR) { - PRInt32 n; - do { - PRIntervalTime start = PR_IntervalNow(); - if (timeout != PR_INTERVAL_NO_TIMEOUT) + if (timeout == PR_INTERVAL_NO_TIMEOUT) goto retry; + else + { + elapsed = (PRIntervalTime) (PR_IntervalNow() - start); + if (elapsed > timeout) ready = 0; /* timed out */ + else { - /*printf("POLL: timeout = %ld\n", (long) PR_IntervalToMicroseconds(timeout));*/ - tv.tv_sec = PR_IntervalToSeconds(timeout); - tv.tv_usec = PR_IntervalToMicroseconds(timeout) % PR_USEC_PER_SEC; - tvp = &tv; + remaining = timeout - elapsed; + goto retry; } + } + } - - n = select(maxfd + 1, &rd, &wr, 0, tvp); - /*printf("POLL: maxfd = %d, select returns %d, errno = %d %s\n", maxfd, n, errno, strerror(errno));*/ - if (n == 0 || (n < 0 && errno == EINTR)) + /* + ** Now to unravel the select sets back into the client's poll + ** descriptor list. Is this possibly an area for pissing away + ** a few cycles or what? + */ + if (ready > 0) + { + ready = 0; + for (pd = pds, epd = pd + npds; pd < epd; pd++) + { + PRInt16 out_flags = 0; + if ((NULL != pd->fd) && (0 != pd->in_flags)) { - if (timeout != PR_INTERVAL_NO_TIMEOUT) - { - timeout -= PR_IntervalNow() - start; - if(timeout <= 0) + PRInt32 osfd; + bottom = PR_GetIdentitiesLayer(pd->fd, PR_NSPR_IO_LAYER); + PR_ASSERT(NULL != bottom); + + osfd = bottom->secret->md.osfd; + + if (FD_ISSET(osfd, &rd)) { - /* timed out */ - n = 0; + if (pd->out_flags & _PR_POLL_READ_SYS_READ) + out_flags |= PR_POLL_READ; + if (pd->out_flags & _PR_POLL_WRITE_SYS_READ) + out_flags |= PR_POLL_WRITE; } - } - } - - } while(n < 0 && errno == EINTR); - - if(n > 0) - { - epd = pds + npds; - for(pd = pds; pd < epd; pd++) - { - int selected; - in_flags = pd->in_flags; - bottom = pd->fd; - selected = 0; - - if(bottom != 0 && in_flags != 0) + if (FD_ISSET(osfd, &wt)) { - while(bottom->lower != 0) - { - bottom = bottom->lower; - } - osfd = bottom->secret->md.osfd; - if (FD_ISSET(osfd, &rd)) - { - pd->out_flags |= PR_POLL_READ; - selected++; - } - if (FD_ISSET(osfd, &wr)) - { - pd->out_flags |= PR_POLL_WRITE; - selected++; - } - - if(selected > 0) + if (pd->out_flags & _PR_POLL_READ_SYS_WRITE) + out_flags |= PR_POLL_READ; + if (pd->out_flags & _PR_POLL_WRITE_SYS_WRITE) + out_flags |= PR_POLL_WRITE; + } + if (FD_ISSET(osfd, &ex)) out_flags |= PR_POLL_EXCEPT; + +/* Workaround for nonblocking connects under net_server */ +#ifndef BONE_VERSION + if (out_flags) + { + /* check if it is a pending connect */ + int i = 0, j = 0; + PR_Lock( _connectLock ); + for( i = 0; i < connectCount; i++ ) { - rc++; - /* - * check if it is a pending connect - */ - PR_Lock( _connectLock ); - for( i = 0; i < connectCount; i++ ) + if(connectList[i].osfd == osfd) { - if(connectList[i].osfd == osfd) + int connectError; + int connectResult; + + connectResult = connect(connectList[i].osfd, + &connectList[i].addr, + connectList[i].addrlen); + connectError = errno; + + if(connectResult < 0 ) { - int connectError; - int connectResult; - - connectResult = connect(connectList[i].osfd, - &connectList[i].addr, - connectList[i].addrlen); - connectError = errno; - - if(connectResult < 0 ) + if(connectError == EINTR || connectError == EWOULDBLOCK || + connectError == EINPROGRESS || connectError == EALREADY) { - if(connectError == EINTR || connectError == EWOULDBLOCK - || connectError == EINPROGRESS || connectError == EALREADY) - { - break; - } + break; } - - if(i == (connectCount - 1)) + } + + if(i == (connectCount - 1)) + { + connectList[i].osfd = -1; + } else { + for(j = i; j < connectCount; j++ ) { - connectList[i].osfd = -1; - } else { - for(j = i; j < connectCount; j++ ) - { - memcpy( &connectList[j], &connectList[j+1], - sizeof(connectList[j])); - } + memcpy( &connectList[j], &connectList[j+1], + sizeof(connectList[j])); } - connectCount--; - - bottom->secret->md.connectReturnValue = connectResult; - bottom->secret->md.connectReturnError = connectError; - bottom->secret->md.connectValueValid = PR_TRUE; - break; } + connectCount--; + + bottom->secret->md.connectReturnValue = connectResult; + bottom->secret->md.connectReturnError = connectError; + bottom->secret->md.connectValueValid = PR_TRUE; + break; } - - - PR_Unlock( _connectLock ); } - } else { - pd->out_flags = 0; - continue; + PR_Unlock( _connectLock ); } - +#endif } - } else if (n < 0) { - /* hit error that's not EINTR. */ - rc = -1; + pd->out_flags = out_flags; + if (out_flags) ready++; } + PR_ASSERT(ready > 0); } - - /*printf("POLL: exiting _MD_pr_poll with %d\n", rc);*/ - return rc; -} + else if (ready < 0) + { + err = _MD_ERRNO(); + if (err == EBADF) + { + /* Find the bad fds */ + ready = 0; + for (pd = pds, epd = pd + npds; pd < epd; pd++) + { + pd->out_flags = 0; + if ((NULL != pd->fd) && (0 != pd->in_flags)) + { + bottom = PR_GetIdentitiesLayer(pd->fd, PR_NSPR_IO_LAYER); + if (fcntl(bottom->secret->md.osfd, F_GETFL, 0) == -1) + { + pd->out_flags = PR_POLL_NVAL; + ready++; + } + } + } + PR_ASSERT(ready > 0); + } + else _PR_MD_MAP_SELECT_ERROR(err); + } + + return ready; +} /* _MD_pr_poll */ /* * File locking. diff --git a/pr/src/md/beos/bmisc.c b/pr/src/md/beos/bmisc.c index 634bea11..056d26a9 100644 --- a/pr/src/md/beos/bmisc.c +++ b/pr/src/md/beos/bmisc.c @@ -37,8 +37,12 @@ #include PRLock *_connectLock = NULL; + +#ifndef BONE_VERSION +/* Workaround for nonblocking connects under net_server */ PRUint32 connectCount = 0; ConnectListNode connectList[64]; +#endif void _MD_cleanup_before_exit (void) @@ -63,7 +67,10 @@ _MD_final_init (void) { _connectLock = PR_NewLock(); PR_ASSERT(NULL != _connectLock); +#ifndef BONE_VERSION + /* Workaround for nonblocking connects under net_server */ connectCount = 0; +#endif } void diff --git a/pr/src/md/beos/bnet.c b/pr/src/md/beos/bnet.c index 86943b3b..2aa0194f 100644 --- a/pr/src/md/beos/bnet.c +++ b/pr/src/md/beos/bnet.c @@ -1,5 +1,5 @@ /* -*- Mode: C++; c-basic-offset: 4 -*- */ -/* +/* * The contents of this file are subject to the Mozilla Public * License Version 1.1 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of @@ -49,6 +49,7 @@ */ #define _PRSockLen_t int + /* ** Global lock variable used to bracket calls into rusty libraries that ** aren't thread safe (like libc, libX, etc). @@ -56,135 +57,154 @@ static PRLock *_pr_rename_lock = NULL; static PRMonitor *_pr_Xfe_mon = NULL; -/* +#define READ_FD 1 +#define WRITE_FD 2 + +/* ** This is a support routine to handle "deferred" i/o on sockets. ** It uses "select", so it is subject to all of the BeOS limitations ** (only READ notification, only sockets) */ -#define READ_FD 1 -#define WRITE_FD 2 + +/* + * socket_io_wait -- + * + * wait for socket i/o, periodically checking for interrupt + * + */ static PRInt32 socket_io_wait(PRInt32 osfd, PRInt32 fd_type, - PRIntervalTime timeout) + PRIntervalTime timeout) { - PRInt32 rv = -1; - struct timeval tv, *tvp; - PRThread *me = _PR_MD_CURRENT_THREAD(); - PRIntervalTime epoch, now, elapsed, remaining; - PRInt32 syserror; - fd_set rd_wr; - - switch (timeout) { - case PR_INTERVAL_NO_WAIT: - PR_SetError(PR_IO_TIMEOUT_ERROR, 0); - break; - case PR_INTERVAL_NO_TIMEOUT: - /* - * This is a special case of the 'default' case below. - * Please see the comments there. - */ - tv.tv_sec = _PR_INTERRUPT_CHECK_INTERVAL_SECS; - tv.tv_usec = 0; - tvp = &tv; - FD_ZERO(&rd_wr); - do { - FD_SET(osfd, &rd_wr); - if (fd_type == READ_FD) - rv = _MD_SELECT(osfd + 1, &rd_wr, NULL, NULL, tvp); - else - rv = _MD_SELECT(osfd + 1, NULL, &rd_wr, NULL, tvp); - if (rv == -1 && (syserror = _MD_ERRNO()) != EINTR) { - if (syserror == EBADF) { - PR_SetError(PR_BAD_DESCRIPTOR_ERROR, EBADF); - } else { - PR_SetError(PR_UNKNOWN_ERROR, syserror); - } - if( _PR_PENDING_INTERRUPT(me)) { - me->flags &= ~_PR_INTERRUPT; - PR_SetError(PR_PENDING_INTERRUPT_ERROR, 0); - rv = -1; - break; - } - break; - } - } while (rv == 0 || (rv == -1 && syserror == EINTR)); - break; - default: - now = epoch = PR_IntervalNow(); - remaining = timeout; - tvp = &tv; - FD_ZERO(&rd_wr); - do { - /* - * We block in _MD_SELECT for at most - * _PR_INTERRUPT_CHECK_INTERVAL_SECS seconds, - * so that there is an upper limit on the delay - * before the interrupt bit is checked. - */ - tv.tv_sec = PR_IntervalToSeconds(remaining); - if (tv.tv_sec > _PR_INTERRUPT_CHECK_INTERVAL_SECS) { - tv.tv_sec = _PR_INTERRUPT_CHECK_INTERVAL_SECS; - tv.tv_usec = 0; - } else { - tv.tv_usec = PR_IntervalToMicroseconds( - remaining - - PR_SecondsToInterval(tv.tv_sec)); - } - FD_SET(osfd, &rd_wr); - if (fd_type == READ_FD) - rv = _MD_SELECT(osfd + 1, &rd_wr, NULL, NULL, tvp); - else - rv = _MD_SELECT(osfd + 1, NULL, &rd_wr, NULL, tvp); - /* - * we don't consider EINTR a real error - */ - if (rv == -1 && (syserror = _MD_ERRNO()) != EINTR) { - if (syserror == EBADF) { - PR_SetError(PR_BAD_DESCRIPTOR_ERROR, EBADF); - } else { - PR_SetError(PR_UNKNOWN_ERROR, syserror); - } - break; - } - if (_PR_PENDING_INTERRUPT(me)) { - me->flags &= ~_PR_INTERRUPT; - PR_SetError(PR_PENDING_INTERRUPT_ERROR, 0); - rv = -1; - break; - } - /* - * We loop again if _MD_SELECT timed out or got interrupted - * by a signal, and the timeout deadline has not passed yet. - */ - if (rv == 0 || (rv == -1 && syserror == EINTR)) { - /* - * If _MD_SELECT timed out, we know how much time - * we spent in blocking, so we can avoid a - * PR_IntervalNow() call. - */ - if (rv == 0) { - now += PR_SecondsToInterval(tv.tv_sec) - + PR_MicrosecondsToInterval(tv.tv_usec); - } else { - now = PR_IntervalNow(); - } - elapsed = (PRIntervalTime) (now - epoch); - if (elapsed >= timeout) { - PR_SetError(PR_IO_TIMEOUT_ERROR, 0); - rv = -1; - break; - } else { - remaining = timeout - elapsed; - } - } - } while (rv == 0 || (rv == -1 && syserror == EINTR)); - break; - } - return(rv); + PRInt32 rv = -1; + struct timeval tv; + PRThread *me = _PR_MD_CURRENT_THREAD(); + PRIntervalTime epoch, now, elapsed, remaining; + PRBool wait_for_remaining; + PRInt32 syserror; + fd_set rd_wr; + + switch (timeout) { + case PR_INTERVAL_NO_WAIT: + PR_SetError(PR_IO_TIMEOUT_ERROR, 0); + break; + case PR_INTERVAL_NO_TIMEOUT: + /* + * This is a special case of the 'default' case below. + * Please see the comments there. + */ + tv.tv_sec = _PR_INTERRUPT_CHECK_INTERVAL_SECS; + tv.tv_usec = 0; + FD_ZERO(&rd_wr); + do { + FD_SET(osfd, &rd_wr); + if (fd_type == READ_FD) + rv = _MD_SELECT(osfd + 1, &rd_wr, NULL, NULL, &tv); + else + rv = _MD_SELECT(osfd + 1, NULL, &rd_wr, NULL, &tv); + if (rv == -1 && (syserror = _MD_ERRNO()) != EINTR) { +#ifdef BONE_VERSION + _PR_MD_MAP_SELECT_ERROR(syserror); +#else + if (syserror == EBADF) { + PR_SetError(PR_BAD_DESCRIPTOR_ERROR, EBADF); + } else { + PR_SetError(PR_UNKNOWN_ERROR, syserror); + } +#endif + break; + } + if (_PR_PENDING_INTERRUPT(me)) { + me->flags &= ~_PR_INTERRUPT; + PR_SetError(PR_PENDING_INTERRUPT_ERROR, 0); + rv = -1; + break; + } + } while (rv == 0 || (rv == -1 && syserror == EINTR)); + break; + default: + now = epoch = PR_IntervalNow(); + remaining = timeout; + FD_ZERO(&rd_wr); + do { + /* + * We block in _MD_SELECT for at most + * _PR_INTERRUPT_CHECK_INTERVAL_SECS seconds, + * so that there is an upper limit on the delay + * before the interrupt bit is checked. + */ + wait_for_remaining = PR_TRUE; + tv.tv_sec = PR_IntervalToSeconds(remaining); + if (tv.tv_sec > _PR_INTERRUPT_CHECK_INTERVAL_SECS) { + wait_for_remaining = PR_FALSE; + tv.tv_sec = _PR_INTERRUPT_CHECK_INTERVAL_SECS; + tv.tv_usec = 0; + } else { + tv.tv_usec = PR_IntervalToMicroseconds( + remaining - + PR_SecondsToInterval(tv.tv_sec)); + } + FD_SET(osfd, &rd_wr); + if (fd_type == READ_FD) + rv = _MD_SELECT(osfd + 1, &rd_wr, NULL, NULL, &tv); + else + rv = _MD_SELECT(osfd + 1, NULL, &rd_wr, NULL, &tv); + /* + * we don't consider EINTR a real error + */ + if (rv == -1 && (syserror = _MD_ERRNO()) != EINTR) { +#ifdef BONE_VERSION + _PR_MD_MAP_SELECT_ERROR(syserror); +#else + if (syserror == EBADF) { + PR_SetError(PR_BAD_DESCRIPTOR_ERROR, EBADF); + } else { + PR_SetError(PR_UNKNOWN_ERROR, syserror); + } +#endif + break; + } + if (_PR_PENDING_INTERRUPT(me)) { + me->flags &= ~_PR_INTERRUPT; + PR_SetError(PR_PENDING_INTERRUPT_ERROR, 0); + rv = -1; + break; + } + /* + * We loop again if _MD_SELECT timed out or got interrupted + * by a signal, and the timeout deadline has not passed yet. + */ + if (rv == 0 || (rv == -1 && syserror == EINTR)) { + /* + * If _MD_SELECT timed out, we know how much time + * we spent in blocking, so we can avoid a + * PR_IntervalNow() call. + */ + if (rv == 0) { + if (wait_for_remaining) { + now += remaining; + } else { + now += PR_SecondsToInterval(tv.tv_sec) + + PR_MicrosecondsToInterval(tv.tv_usec); + } + } else { + now = PR_IntervalNow(); + } + elapsed = (PRIntervalTime) (now - epoch); + if (elapsed >= timeout) { + PR_SetError(PR_IO_TIMEOUT_ERROR, 0); + rv = -1; + break; + } else { + remaining = timeout - elapsed; + } + } + } while (rv == 0 || (rv == -1 && syserror == EINTR)); + break; + } + return(rv); } - - PRInt32 _MD_recv (PRFileDesc *fd, void *buf, PRInt32 amount, PRInt32 flags, PRIntervalTime timeout) @@ -193,33 +213,44 @@ _MD_recv (PRFileDesc *fd, void *buf, PRInt32 amount, PRInt32 flags, PRInt32 rv, err; PRThread *me = _PR_MD_CURRENT_THREAD(); +#ifndef BONE_VERSION if (fd->secret->md.sock_state & BE_SOCK_SHUTDOWN_READ) { - _PR_MD_MAP_RECV_ERROR(EPIPE); - return -1; + _PR_MD_MAP_RECV_ERROR(EPIPE); + return -1; } +#endif + +#ifdef BONE_VERSION + /* + ** Gah, stupid hack. If reading a zero amount, instantly return success. + ** BONE beta 6 returns EINVAL for reads of zero bytes, which parts of + ** mozilla use to check for socket availability. + */ + + if( 0 == amount ) return(0); +#endif while ((rv = recv(osfd, buf, amount, flags)) == -1) { - err = _MD_ERRNO(); + err = _MD_ERRNO(); - if ((err == EAGAIN) || (err == EWOULDBLOCK)) { - if (fd->secret->nonblocking) { - break; - } - /* If socket was supposed to be blocking, - wait a while for the condition to be - satisfied. */ - if ((rv = socket_io_wait(osfd, READ_FD, timeout)) < 0) - goto done; - } else if ((err == EINTR) && (!_PR_PENDING_INTERRUPT(me))){ - continue; + if ((err == EAGAIN) || (err == EWOULDBLOCK)) { + if (fd->secret->nonblocking) { + break; + } + /* If socket was supposed to be blocking, + wait a while for the condition to be + satisfied. */ + if ((rv = socket_io_wait(osfd, READ_FD, timeout)) < 0) + goto done; + } else if ((err == EINTR) && (!_PR_PENDING_INTERRUPT(me))){ + continue; - } else { - break; - } + } else + break; } if (rv < 0) { - _PR_MD_MAP_RECV_ERROR(err); + _PR_MD_MAP_RECV_ERROR(err); } done: @@ -235,31 +266,38 @@ _MD_recvfrom (PRFileDesc *fd, void *buf, PRInt32 amount, PRIntn flags, PRThread *me = _PR_MD_CURRENT_THREAD(); while ((*addrlen = PR_NETADDR_SIZE(addr)), - ((rv = recvfrom(osfd, buf, amount, flags, - (struct sockaddr *) addr, - (_PRSockLen_t *)addrlen)) == -1)) { - err = _MD_ERRNO(); - - if ((err == EAGAIN) || (err == EWOULDBLOCK)) { - if (fd->secret->nonblocking) { - break; - } + ((rv = recvfrom(osfd, buf, amount, flags, + (struct sockaddr *) addr, + (_PRSockLen_t *)addrlen)) == -1)) { + err = _MD_ERRNO(); + + if ((err == EAGAIN) || (err == EWOULDBLOCK)) { + if (fd->secret->nonblocking) { + break; + } if ((rv = socket_io_wait(osfd, READ_FD, timeout)) < 0) goto done; - } else if ((err == EINTR) && (!_PR_PENDING_INTERRUPT(me))) { - continue; - - } else { - break; - } + } else if ((err == EINTR) && (!_PR_PENDING_INTERRUPT(me))) { + continue; + } else { + break; + } } if (rv < 0) { - _PR_MD_MAP_RECVFROM_ERROR(err); + _PR_MD_MAP_RECVFROM_ERROR(err); } done: +#ifdef _PR_HAVE_SOCKADDR_LEN + if (rv != -1) { + /* ignore the sa_len field of struct sockaddr */ + if (addr) { + addr->raw.family = ((struct sockaddr *) addr)->sa_family; + } + } +#endif /* _PR_HAVE_SOCKADDR_LEN */ return(rv); } @@ -271,46 +309,56 @@ _MD_send (PRFileDesc *fd, const void *buf, PRInt32 amount, PRInt32 flags, PRInt32 rv, err; PRThread *me = _PR_MD_CURRENT_THREAD(); +#ifndef BONE_VERSION if (fd->secret->md.sock_state & BE_SOCK_SHUTDOWN_WRITE) { - _PR_MD_MAP_SEND_ERROR(EPIPE); - return -1; + _PR_MD_MAP_SEND_ERROR(EPIPE); + return -1; } +#endif while ((rv = send(osfd, buf, amount, flags)) == -1) { - err = _MD_ERRNO(); + err = _MD_ERRNO(); - if ((err == EAGAIN) || (err == EWOULDBLOCK)) { - if (fd->secret->nonblocking) { - break; - } + if ((err == EAGAIN) || (err == EWOULDBLOCK)) { + if (fd->secret->nonblocking) { + break; + } - if( _PR_PENDING_INTERRUPT(me)) { +#ifndef BONE_VERSION + if( _PR_PENDING_INTERRUPT(me)) { me->flags &= ~_PR_INTERRUPT; PR_SetError( PR_PENDING_INTERRUPT_ERROR, 0); return -1; } - /* in UNIX implementations, you could do a socket_io_wait here. - * but since BeOS doesn't yet support WRITE notification in select, - * you're spanked. - */ - snooze( 10000L ); - continue; - - } else if ((err == EINTR) && (!_PR_PENDING_INTERRUPT(me))) { - continue; + /* in UNIX implementations, you could do a socket_io_wait here. + * but since BeOS doesn't yet support WRITE notification in select, + * you're spanked. + */ + snooze( 10000L ); + continue; +#else /* BONE_VERSION */ + if ((rv = socket_io_wait(osfd, WRITE_FD, timeout))< 0) + goto done; +#endif + + } else if ((err == EINTR) && (!_PR_PENDING_INTERRUPT(me))) { + continue; - } else { - break; - } + } else { + break; + } } if (rv < 0) { - _PR_MD_MAP_SEND_ERROR(err); + _PR_MD_MAP_SEND_ERROR(err); } +#ifdef BONE_VERSION +done: +#endif return(rv); } @@ -321,32 +369,97 @@ _MD_sendto (PRFileDesc *fd, const void *buf, PRInt32 amount, PRIntn flags, PRInt32 osfd = fd->secret->md.osfd; PRInt32 rv, err; PRThread *me = _PR_MD_CURRENT_THREAD(); +#ifdef _PR_HAVE_SOCKADDR_LEN + PRNetAddr addrCopy; + + addrCopy = *addr; + ((struct sockaddr *) &addrCopy)->sa_len = addrlen; + ((struct sockaddr *) &addrCopy)->sa_family = addr->raw.family; while ((rv = sendto(osfd, buf, amount, flags, - (struct sockaddr *) addr, addrlen)) == -1) { - err = _MD_ERRNO(); + (struct sockaddr *) &addrCopy, addrlen)) == -1) { +#else + while ((rv = sendto(osfd, buf, amount, flags, + (struct sockaddr *) addr, addrlen)) == -1) { +#endif + err = _MD_ERRNO(); - if ((err == EAGAIN) || (err == EWOULDBLOCK)) { - if (fd->secret->nonblocking) { - break; - } + if ((err == EAGAIN) || (err == EWOULDBLOCK)) { + if (fd->secret->nonblocking) { + break; + } - printf( "This should be a blocking sendto call!!!\n" ); - } else if ((err == EINTR) && (!_PR_PENDING_INTERRUPT(me))) { - continue; +#ifdef BONE_VERSION + if ((rv = socket_io_wait(osfd, WRITE_FD, timeout))< 0) + goto done; +#endif + } else if ((err == EINTR) && (!_PR_PENDING_INTERRUPT(me))) { + continue; - } else { - break; - } + } else { + break; + } } if (rv < 0) { - _PR_MD_MAP_SENDTO_ERROR(err); + _PR_MD_MAP_SENDTO_ERROR(err); } +#ifdef BONE_VERSION +done: +#endif + return(rv); +} + +#ifdef BONE_VERSION + +PRInt32 _MD_writev( + PRFileDesc *fd, const PRIOVec *iov, + PRInt32 iov_size, PRIntervalTime timeout) +{ + PRInt32 rv, err; + PRThread *me = _PR_MD_CURRENT_THREAD(); + PRInt32 index, amount = 0; + PRInt32 osfd = fd->secret->md.osfd; + + /* + * Calculate the total number of bytes to be sent; needed for + * optimization later. + * We could avoid this if this number was passed in; but it is + * probably not a big deal because iov_size is usually small (less than + * 3) + */ + if (!fd->secret->nonblocking) { + for (index=0; indexsecret->nonblocking) { + break; + } + if ((rv = socket_io_wait(osfd, WRITE_FD, timeout))<0) + goto done; + + } else if ((err == EINTR) && (!_PR_PENDING_INTERRUPT(me))){ + continue; + } else { + break; + } + } + + if (rv < 0) { + _PR_MD_MAP_WRITEV_ERROR(err); + } +done: return(rv); } +#endif /* BONE_VERSION */ + PRInt32 _MD_accept (PRFileDesc *fd, PRNetAddr *addr, PRUint32 *addrlen, PRIntervalTime timeout) @@ -356,42 +469,39 @@ _MD_accept (PRFileDesc *fd, PRNetAddr *addr, PRUint32 *addrlen, PRThread *me = _PR_MD_CURRENT_THREAD(); while ((rv = accept(osfd, (struct sockaddr *) addr, - (_PRSockLen_t *)addrlen)) == -1) { - err = _MD_ERRNO(); - - if ((err == EAGAIN) || (err == EWOULDBLOCK)) { - if (fd->secret->nonblocking) { - break; - } - /* If it's SUPPOSED to be a blocking thread, wait - * a while to see if the triggering condition gets - * satisfied. - */ - /* Assume that we're always using a native thread */ - if ((rv = socket_io_wait(osfd, READ_FD, timeout)) < 0) - goto done; - } else if ((err == EINTR) && (!_PR_PENDING_INTERRUPT(me))) { - continue; - } else { - break; - } - } - - if (addr) addr->raw.family = AF_INET; + (_PRSockLen_t *)addrlen)) == -1) { + err = _MD_ERRNO(); + if ((err == EAGAIN) || (err == EWOULDBLOCK)) { + if (fd->secret->nonblocking) { + break; + } + /* If it's SUPPOSED to be a blocking thread, wait + * a while to see if the triggering condition gets + * satisfied. + */ + /* Assume that we're always using a native thread */ + if ((rv = socket_io_wait(osfd, READ_FD, timeout)) < 0) + goto done; + } else if ((err == EINTR) && (!_PR_PENDING_INTERRUPT(me))) { + continue; + } else { + break; + } + } if (rv < 0) { - _PR_MD_MAP_ACCEPT_ERROR(err); + _PR_MD_MAP_ACCEPT_ERROR(err); + } else if (addr != NULL) { + /* bug 134099 */ + err = getpeername(rv, (struct sockaddr *) addr, (_PRSockLen_t *)addrlen); } done: #ifdef _PR_HAVE_SOCKADDR_LEN if (rv != -1) { - /* Mask off the first byte of struct sockaddr (the length field) */ - if (addr) { - *((unsigned char *) addr) = 0; -#ifdef IS_LITTLE_ENDIAN - addr->raw.family = ntohs(addr->raw.family); -#endif - } + /* Mask off the first byte of struct sockaddr (the length field) */ + if (addr) { + addr->raw.family = ((struct sockaddr *) addr)->sa_family; + } } #endif /* _PR_HAVE_SOCKADDR_LEN */ return(rv); @@ -401,62 +511,118 @@ PRInt32 _MD_connect (PRFileDesc *fd, const PRNetAddr *addr, PRUint32 addrlen, PRIntervalTime timeout) { - PRInt32 osfd = fd->secret->md.osfd; PRInt32 rv, err; PRThread *me = _PR_MD_CURRENT_THREAD(); + PRInt32 osfd = fd->secret->md.osfd; +#ifndef BONE_VERSION fd->secret->md.connectValueValid = PR_FALSE; +#endif +#ifdef _PR_HAVE_SOCKADDR_LEN + PRNetAddr addrCopy; + + addrCopy = *addr; + ((struct sockaddr *) &addrCopy)->sa_len = addrlen; + ((struct sockaddr *) &addrCopy)->sa_family = addr->raw.family; +#endif + + /* (Copied from unix.c) + * We initiate the connection setup by making a nonblocking connect() + * call. If the connect() call fails, there are two cases we handle + * specially: + * 1. The connect() call was interrupted by a signal. In this case + * we simply retry connect(). + * 2. The NSPR socket is nonblocking and connect() fails with + * EINPROGRESS. We first wait until the socket becomes writable. + * Then we try to find out whether the connection setup succeeded + * or failed. + */ retry: +#ifdef _PR_HAVE_SOCKADDR_LEN + if ((rv = connect(osfd, (struct sockaddr *)&addrCopy, addrlen)) == -1) { +#else if ((rv = connect(osfd, (struct sockaddr *)addr, addrlen)) == -1) { +#endif err = _MD_ERRNO(); - fd->secret->md.connectReturnValue = rv; - fd->secret->md.connectReturnError = err; - fd->secret->md.connectValueValid = PR_TRUE; - - if( err == EINTR ) { +#ifndef BONE_VERSION + fd->secret->md.connectReturnValue = rv; + fd->secret->md.connectReturnError = err; + fd->secret->md.connectValueValid = PR_TRUE; +#endif + if( err == EINTR ) { - if( _PR_PENDING_INTERRUPT(me)) { + if( _PR_PENDING_INTERRUPT(me)) { - me->flags &= ~_PR_INTERRUPT; + me->flags &= ~_PR_INTERRUPT; PR_SetError( PR_PENDING_INTERRUPT_ERROR, 0); return -1; } - snooze( 100000L ); +#ifndef BONE_VERSION + snooze( 100000L ); +#endif goto retry; } +#ifndef BONE_VERSION if(!fd->secret->nonblocking && ((err == EINPROGRESS) || (err==EAGAIN) || (err==EALREADY))) { - /* - ** There's no timeout on this connect, but that's not - ** a big deal, since the connect times out anyways - ** after 30 seconds. Just sleep for 1/10th of a second - ** and retry until we go through or die. - */ + /* + ** There's no timeout on this connect, but that's not + ** a big deal, since the connect times out anyways + ** after 30 seconds. Just sleep for 1/10th of a second + ** and retry until we go through or die. + */ - if( _PR_PENDING_INTERRUPT(me)) { + if( _PR_PENDING_INTERRUPT(me)) { me->flags &= ~_PR_INTERRUPT; PR_SetError( PR_PENDING_INTERRUPT_ERROR, 0); return -1; - } + } + + goto retry; + } - goto retry; - } + if( fd->secret->nonblocking && ((err == EAGAIN) || (err == EINPROGRESS))) { + PR_Lock(_connectLock); + if (connectCount < sizeof(connectList)/sizeof(connectList[0])) { + connectList[connectCount].osfd = osfd; + memcpy(&connectList[connectCount].addr, addr, addrlen); + connectList[connectCount].addrlen = addrlen; + connectList[connectCount].timeout = timeout; + connectCount++; + PR_Unlock(_connectLock); + _PR_MD_MAP_CONNECT_ERROR(err); + } else { + PR_Unlock(_connectLock); + PR_SetError(PR_INSUFFICIENT_RESOURCES_ERROR, 0); + } + return rv; + } +#else /* BONE_VERSION */ + if(!fd->secret->nonblocking && (err == EINTR)) { + + rv = socket_io_wait(osfd, WRITE_FD, timeout); + if (rv == -1) { + return -1; + } - if( fd->secret->nonblocking && ((err == EAGAIN) || (err == EINPROGRESS))) { - PR_Lock(_connectLock); - connectList[connectCount].osfd = osfd; - memcpy(&connectList[connectCount].addr, addr, addrlen); - connectList[connectCount].addrlen = addrlen; - connectList[connectCount].timeout = timeout; - connectCount++; - PR_Unlock(_connectLock); - _PR_MD_MAP_CONNECT_ERROR(err); - return rv; - } + PR_ASSERT(rv == 1); + if (_PR_PENDING_INTERRUPT(me)) { + me->flags &= ~_PR_INTERRUPT; + PR_SetError( PR_PENDING_INTERRUPT_ERROR, 0); + return -1; + } + err = _MD_beos_get_nonblocking_connect_error(osfd); + if (err != 0) { + _PR_MD_MAP_CONNECT_ERROR(err); + return -1; + } + return 0; + } +#endif - _PR_MD_MAP_CONNECT_ERROR(err); + _PR_MD_MAP_CONNECT_ERROR(err); } return rv; @@ -466,9 +632,16 @@ PRInt32 _MD_bind (PRFileDesc *fd, const PRNetAddr *addr, PRUint32 addrlen) { PRInt32 rv, err; +#ifdef _PR_HAVE_SOCKADDR_LEN + PRNetAddr addrCopy; + addrCopy = *addr; + ((struct sockaddr *) &addrCopy)->sa_len = addrlen; + ((struct sockaddr *) &addrCopy)->sa_family = addr->raw.family; + rv = bind(fd->secret->md.osfd, (struct sockaddr *) &addrCopy, (int )addrlen); +#else rv = bind(fd->secret->md.osfd, (struct sockaddr *) addr, (int )addrlen); - +#endif if (rv < 0) { err = _MD_ERRNO(); _PR_MD_MAP_BIND_ERROR(err); @@ -482,12 +655,14 @@ _MD_listen (PRFileDesc *fd, PRIntn backlog) { PRInt32 rv, err; +#ifndef BONE_VERSION /* Bug workaround! Setting listen to 0 on Be accepts no connections. ** On most UN*Xes this sets the default. */ if( backlog == 0 ) backlog = 5; - +#endif + rv = listen(fd->secret->md.osfd, backlog); if (rv < 0) { err = _MD_ERRNO(); @@ -502,15 +677,24 @@ _MD_shutdown (PRFileDesc *fd, PRIntn how) { PRInt32 rv, err; +#ifndef BONE_VERSION if (how == PR_SHUTDOWN_SEND) - fd->secret->md.sock_state = BE_SOCK_SHUTDOWN_WRITE; + fd->secret->md.sock_state = BE_SOCK_SHUTDOWN_WRITE; else if (how == PR_SHUTDOWN_RCV) - fd->secret->md.sock_state = BE_SOCK_SHUTDOWN_READ; + fd->secret->md.sock_state = BE_SOCK_SHUTDOWN_READ; else if (how == PR_SHUTDOWN_BOTH) { - fd->secret->md.sock_state = (BE_SOCK_SHUTDOWN_WRITE | BE_SOCK_SHUTDOWN_READ); + fd->secret->md.sock_state = (BE_SOCK_SHUTDOWN_WRITE | BE_SOCK_SHUTDOWN_READ); } return 0; +#else /* BONE_VERSION */ + rv = shutdown(fd->secret->md.osfd, how); + if (rv < 0) { + err = _MD_ERRNO(); + _PR_MD_MAP_SHUTDOWN_ERROR(err); + } + return(rv); +#endif } PRInt32 @@ -522,7 +706,11 @@ _MD_socketpair (int af, int type, int flags, PRInt32 *osfd) PRInt32 _MD_close_socket (PRInt32 osfd) { +#ifdef BONE_VERSION + close( osfd ); +#else closesocket( osfd ); +#endif } PRStatus @@ -532,7 +720,14 @@ _MD_getsockname (PRFileDesc *fd, PRNetAddr *addr, PRUint32 *addrlen) rv = getsockname(fd->secret->md.osfd, (struct sockaddr *) addr, (_PRSockLen_t *)addrlen); - +#ifdef _PR_HAVE_SOCKADDR_LEN + if (rv == 0) { + /* ignore the sa_len field of struct sockaddr */ + if (addr) { + addr->raw.family = ((struct sockaddr *) addr)->sa_family; + } + } +#endif /* _PR_HAVE_SOCKADDR_LEN */ if (rv < 0) { err = _MD_ERRNO(); _PR_MD_MAP_GETSOCKNAME_ERROR(err); @@ -560,9 +755,6 @@ PRStatus _MD_getsockopt (PRFileDesc *fd, PRInt32 level, PRInt32 optname, char* optval, PRInt32* optlen) { - return PR_NOT_IMPLEMENTED_ERROR; - -#if 0 PRInt32 rv, err; rv = getsockopt(fd->secret->md.osfd, level, optname, @@ -573,7 +765,6 @@ _MD_getsockopt (PRFileDesc *fd, PRInt32 level, } return rv==0?PR_SUCCESS:PR_FAILURE; -#endif } PRStatus @@ -597,6 +788,7 @@ _MD_accept_read (PRFileDesc *sd, PRInt32 *newSock, PRNetAddr **raddr, return PR_NOT_IMPLEMENTED_ERROR; } +#ifndef BONE_VERSION PRInt32 _MD_socket (int af, int type, int flags) { @@ -606,17 +798,43 @@ _MD_socket (int af, int type, int flags) if( -1 == osfd ) { - err = _MD_ERRNO(); - _PR_MD_MAP_SOCKET_ERROR( err ); + err = _MD_ERRNO(); + _PR_MD_MAP_SOCKET_ERROR( err ); } return( osfd ); } +#else +PRInt32 +_MD_socket(PRInt32 domain, PRInt32 type, PRInt32 proto) +{ + PRInt32 osfd, err; + + osfd = socket(domain, type, proto); + + if (osfd == -1) { + err = _MD_ERRNO(); + _PR_MD_MAP_SOCKET_ERROR(err); + } + + return(osfd); +} +#endif PRInt32 _MD_socketavailable (PRFileDesc *fd) { +#ifdef BONE_VERSION + PRInt32 result; + + if (ioctl(fd->secret->md.osfd, FIONREAD, &result) < 0) { + _PR_MD_MAP_SOCKETAVAILABLE_ERROR(_MD_ERRNO()); + return -1; + } + return result; +#else return PR_NOT_IMPLEMENTED_ERROR; +#endif } PRInt32 @@ -628,32 +846,25 @@ _MD_get_socket_error (void) PRStatus _MD_gethostname (char *name, PRUint32 namelen) { -PRInt32 rv, err; + PRInt32 rv, err; rv = gethostname(name, namelen); if (rv == 0) { - err = _MD_ERRNO(); - _PR_MD_MAP_GETHOSTNAME_ERROR(err); - return PR_FAILURE; + err = _MD_ERRNO(); + _PR_MD_MAP_GETHOSTNAME_ERROR(err); + return PR_FAILURE; } return PR_SUCCESS; } +#ifndef BONE_VERSION PRInt32 _MD_beos_get_nonblocking_connect_error(PRFileDesc *fd) { int rv; int flags = 0; - if( fd->secret->md.connectValueValid == PR_TRUE ) - - if( fd->secret->md.connectReturnValue == -1 ) - - return fd->secret->md.connectReturnError; - else - return 0; /* No error */ - rv = recv(fd->secret->md.osfd, NULL, 0, flags); PR_ASSERT(-1 == rv || 0 == rv); if (-1 == rv && errno != EAGAIN && errno != EWOULDBLOCK) { @@ -661,3 +872,17 @@ _MD_beos_get_nonblocking_connect_error(PRFileDesc *fd) } return 0; /* no error */ } +#else +PRInt32 +_MD_beos_get_nonblocking_connect_error(int osfd) +{ + return PR_NOT_IMPLEMENTED_ERROR; + // int err; + // _PRSockLen_t optlen = sizeof(err); + // if (getsockopt(osfd, SOL_SOCKET, SO_ERROR, (char *) &err, &optlen) == -1) { + // return errno; + // } else { + // return err; + // } +} +#endif /* BONE_VERSION */ diff --git a/pr/src/md/beos/bproc.c b/pr/src/md/beos/bproc.c index 5d9ac0a5..54ccaa0f 100644 --- a/pr/src/md/beos/bproc.c +++ b/pr/src/md/beos/bproc.c @@ -1,4 +1,4 @@ -/* -*- Mode: C++; c-basic-offset: 4 -*- */ +/* -*- Mode: C++; tab-width: 8; c-basic-offset: 8 -*- */ /* * The contents of this file are subject to the Mozilla Public * License Version 1.1 (the "License"); you may not use this file @@ -33,28 +33,202 @@ */ #include "primpl.h" +#include +#include + +#define _PR_SIGNALED_EXITSTATUS 256 PRProcess* _MD_create_process (const char *path, char *const *argv, char *const *envp, const PRProcessAttr *attr) { - return NULL; + PRProcess *process; + int nEnv, idx; + char *const *childEnvp; + char **newEnvp = NULL; + int flags; + + process = PR_NEW(PRProcess); + if (!process) { + PR_SetError(PR_OUT_OF_MEMORY_ERROR, 0); + return NULL; + } + + childEnvp = envp; + if (attr && attr->fdInheritBuffer) { + if (NULL == childEnvp) { + childEnvp = environ; + } + for (nEnv = 0; childEnvp[nEnv]; nEnv++) { + } + newEnvp = (char **) PR_MALLOC((nEnv + 2) * sizeof(char *)); + if (NULL == newEnvp) { + PR_DELETE(process); + PR_SetError(PR_OUT_OF_MEMORY_ERROR, 0); + return NULL; + } + for (idx = 0; idx < nEnv; idx++) { + newEnvp[idx] = childEnvp[idx]; + } + newEnvp[idx++] = attr->fdInheritBuffer; + newEnvp[idx] = NULL; + childEnvp = newEnvp; + } + + process->md.pid = fork(); + + if ((pid_t) -1 == process->md.pid) { + PR_SetError(PR_INSUFFICIENT_RESOURCES_ERROR, errno); + PR_DELETE(process); + if (newEnvp) { + PR_DELETE(newEnvp); + } + return NULL; + } else if (0 == process->md.pid) { /* the child process */ + /* + * If the child process needs to exit, it must call _exit(). + * Do not call exit(), because exit() will flush and close + * the standard I/O file descriptors, and hence corrupt + * the parent process's standard I/O data structures. + */ + + if (attr) { + /* the osfd's to redirect stdin, stdout, and stderr to */ + int in_osfd = -1, out_osfd = -1, err_osfd = -1; + + if (attr->stdinFd + && attr->stdinFd->secret->md.osfd != 0) { + in_osfd = attr->stdinFd->secret->md.osfd; + if (dup2(in_osfd, 0) != 0) { + _exit(1); /* failed */ + } + flags = fcntl(0, F_GETFL, 0); + if (flags & O_NONBLOCK) { + fcntl(0, F_SETFL, flags & ~O_NONBLOCK); + } + } + if (attr->stdoutFd + && attr->stdoutFd->secret->md.osfd != 1) { + out_osfd = attr->stdoutFd->secret->md.osfd; + if (dup2(out_osfd, 1) != 1) { + _exit(1); /* failed */ + } + flags = fcntl(1, F_GETFL, 0); + if (flags & O_NONBLOCK) { + fcntl(1, F_SETFL, flags & ~O_NONBLOCK); + } + } + if (attr->stderrFd + && attr->stderrFd->secret->md.osfd != 2) { + err_osfd = attr->stderrFd->secret->md.osfd; + if (dup2(err_osfd, 2) != 2) { + _exit(1); /* failed */ + } + flags = fcntl(2, F_GETFL, 0); + if (flags & O_NONBLOCK) { + fcntl(2, F_SETFL, flags & ~O_NONBLOCK); + } + } + if (in_osfd != -1) { + close(in_osfd); + } + if (out_osfd != -1 && out_osfd != in_osfd) { + close(out_osfd); + } + if (err_osfd != -1 && err_osfd != in_osfd + && err_osfd != out_osfd) { + close(err_osfd); + } + if (attr->currentDirectory) { + if (chdir(attr->currentDirectory) < 0) { + _exit(1); /* failed */ + } + } + } + + if (childEnvp) { + (void)execve(path, argv, childEnvp); + } else { + /* Inherit the environment of the parent. */ + (void)execv(path, argv); + } + /* Whoops! It returned. That's a bad sign. */ + _exit(1); + } + + if (newEnvp) { + PR_DELETE(newEnvp); + } + + return process; } PRStatus _MD_detach_process (PRProcess *process) { - return PR_NOT_IMPLEMENTED_ERROR; + /* If we kept a process table like unix does, + * we'd remove the entry here. + * Since we dont', just delete the process variable + */ + PR_DELETE(process); + return PR_SUCCESS; } PRStatus _MD_wait_process (PRProcess *process, PRInt32 *exitCode) { - return PR_NOT_IMPLEMENTED_ERROR; + PRStatus retVal = PR_SUCCESS; + int ret, status; + + /* Ignore interruptions */ + do { + ret = waitpid(process->md.pid, &status, 0); + } while (ret == -1 && errno == EINTR); + + /* + * waitpid() cannot return 0 because we did not invoke it + * with the WNOHANG option. + */ + PR_ASSERT(0 != ret); + + if (ret < 0) { + PR_SetError(PR_UNKNOWN_ERROR, _MD_ERRNO()); + return PR_FAILURE; + } + + /* If child process exited normally, return child exit code */ + if (WIFEXITED(status)) { + *exitCode = WEXITSTATUS(status); + } else { + PR_ASSERT(WIFSIGNALED(status)); + *exitCode = _PR_SIGNALED_EXITSTATUS; + } + + PR_DELETE(process); + return PR_SUCCESS; } PRStatus _MD_kill_process (PRProcess *process) { - return PR_NOT_IMPLEMENTED_ERROR; + PRErrorCode prerror; + PRInt32 oserror; + + if (kill(process->md.pid, SIGKILL) == 0) { + return PR_SUCCESS; + } + oserror = errno; + switch (oserror) { + case EPERM: + prerror = PR_NO_ACCESS_RIGHTS_ERROR; + break; + case ESRCH: + prerror = PR_INVALID_ARGUMENT_ERROR; + break; + default: + prerror = PR_UNKNOWN_ERROR; + break; + } + PR_SetError(prerror, oserror); + return PR_FAILURE; } diff --git a/pr/src/md/mac/macdll.c b/pr/src/md/mac/macdll.c index 2cfe79db..23b32759 100644 --- a/pr/src/md/mac/macdll.c +++ b/pr/src/md/mac/macdll.c @@ -218,7 +218,7 @@ GetSharedLibraryFilterProc(const CInfoPBRec* const inCpb, Boolean* inWantQuit, v // see if this symbol is in this fragment if (LibInPefContainer(&fragSpec, pFilterData->inName, &codeOffset, &codeLength)) - tempErr = GetDiskFragment(&fragSpec, codeOffset, codeLength, pFilterData->inName, kLoadCFrag, &pFilterData->outID, &pFilterData->outAddress, errName); + tempErr = GetDiskFragment(&fragSpec, codeOffset, codeLength, fragSpec.name, kLoadCFrag, &pFilterData->outID, &pFilterData->outAddress, errName); else return; @@ -503,19 +503,30 @@ done: OSErr NSLoadNamedFragment(const FSSpec *fileSpec, const char* fragmentName, CFragConnectionID *outConnectionID) { - UInt32 fragOffset, fragLength; - Ptr main; - Str255 fragName = "\p"; - Str255 errName; - OSErr err; - - err = GetNamedFragmentOffsets(fileSpec, fragmentName, &fragOffset, &fragLength); - if (err != noErr) return err; - - err = GetDiskFragment(fileSpec, fragOffset, fragLength, fragName, - kLoadCFrag, outConnectionID, &main, errName); - - return err; + UInt32 fragOffset, fragLength; + short fragNameLength; + Ptr main; + Str255 fragName; + Str255 errName; + OSErr err; + + err = GetNamedFragmentOffsets(fileSpec, fragmentName, &fragOffset, &fragLength); + if (err != noErr) return err; + + // convert fragment name to pascal string + fragNameLength = strlen(fragmentName); + if (fragNameLength > 255) + fragNameLength = 255; + BlockMoveData(fragmentName, &fragName[1], fragNameLength); + fragName[0] = fragNameLength; + + // Note that we pass the fragment name as the 4th param to GetDiskFragment. + // This value affects the ability of debuggers, and the Talkback system, + // to match code fragments with symbol files + err = GetDiskFragment(fileSpec, fragOffset, fragLength, fragName, + kLoadCFrag, outConnectionID, &main, errName); + + return err; } @@ -532,39 +543,42 @@ OSErr NSLoadNamedFragment(const FSSpec *fileSpec, const char* fragmentName, CFra -----------------------------------------------------------------*/ OSErr NSLoadIndexedFragment(const FSSpec *fileSpec, PRUint32 fragmentIndex, - char** outFragName, CFragConnectionID *outConnectionID) + char** outFragName, CFragConnectionID *outConnectionID) { - UInt32 fragOffset, fragLength; - char *fragNameBlock = NULL; - Ptr main; - Str255 fragName = "\p"; - Str255 errName; - OSErr err; - - *outFragName = NULL; - - err = GetIndexedFragmentOffsets(fileSpec, fragmentIndex, &fragOffset, &fragLength, &fragNameBlock); - if (err != noErr) return err; - - if (fragNameBlock) - { - UInt32 nameLen = strlen(fragNameBlock); - if (nameLen > 63) - nameLen = 63; - BlockMoveData(fragNameBlock, &fragName[1], nameLen); - fragName[0] = nameLen; - } - - err = GetDiskFragment(fileSpec, fragOffset, fragLength, fragName, - kLoadCFrag, outConnectionID, &main, errName); - if (err != noErr) - { - free(fragNameBlock); - return err; - } - - *outFragName = fragNameBlock; - return noErr; + UInt32 fragOffset, fragLength; + char *fragNameBlock = NULL; + Ptr main; + Str255 fragName = "\p"; + Str255 errName; + OSErr err; + + *outFragName = NULL; + + err = GetIndexedFragmentOffsets(fileSpec, fragmentIndex, &fragOffset, &fragLength, &fragNameBlock); + if (err != noErr) return err; + + if (fragNameBlock) + { + UInt32 nameLen = strlen(fragNameBlock); + if (nameLen > 63) + nameLen = 63; + BlockMoveData(fragNameBlock, &fragName[1], nameLen); + fragName[0] = nameLen; + } + + // Note that we pass the fragment name as the 4th param to GetDiskFragment. + // This value affects the ability of debuggers, and the Talkback system, + // to match code fragments with symbol files + err = GetDiskFragment(fileSpec, fragOffset, fragLength, fragName, + kLoadCFrag, outConnectionID, &main, errName); + if (err != noErr) + { + free(fragNameBlock); + return err; + } + + *outFragName = fragNameBlock; + return noErr; } diff --git a/pr/src/md/mac/macio.c b/pr/src/md/mac/macio.c index 0a546635..ef404db5 100644 --- a/pr/src/md/mac/macio.c +++ b/pr/src/md/mac/macio.c @@ -81,15 +81,16 @@ static void AsyncIOCompletion (ExtendedParamBlock *pbAsyncPtr) if (_PR_MD_GET_INTSOFF()) { thread->md.missedIONotify = PR_TRUE; cpu->u.missed[cpu->where] |= _PR_MISSED_IO; - return; - } + } else { + _PR_INTSOFF(is); - _PR_INTSOFF(is); + thread->md.osErrCode = noErr; + DoneWaitingOnThisThread(thread); - thread->md.osErrCode = noErr; - DoneWaitingOnThisThread(thread); + _PR_FAST_INTSON(is); + } - _PR_FAST_INTSON(is); + SignalIdleSemaphore(); } void _MD_SetError(OSErr oserror) @@ -266,7 +267,7 @@ PRInt32 ReadWriteProc(PRFileDesc *fd, void *buf, PRUint32 bytes, IOOperation op) a 32 byte Ptr in the heap, so only do this once */ if (!sCompletionUPP) - sCompletionUPP = NewIOCompletionProc((IOCompletionProcPtr)&AsyncIOCompletion); + sCompletionUPP = NewIOCompletionUPP((IOCompletionProcPtr)&AsyncIOCompletion); /* grab the thread so we know which one to post to at completion */ pbAsync.thread = me; diff --git a/pr/src/md/mac/macsocket.h b/pr/src/md/mac/macsocket.h index b1045e36..b9194c52 100644 --- a/pr/src/md/mac/macsocket.h +++ b/pr/src/md/mac/macsocket.h @@ -39,6 +39,7 @@ // Interface visible to xp code // C socket type definitions and routines // from sys/socket.h +#include #include // All the internet typedefs #include // For timeval /* diff --git a/pr/src/md/mac/macsockotpt.c b/pr/src/md/mac/macsockotpt.c index ef15a56b..42462740 100644 --- a/pr/src/md/mac/macsockotpt.c +++ b/pr/src/md/mac/macsockotpt.c @@ -38,6 +38,7 @@ #include #include +#include #include #include @@ -173,9 +174,9 @@ static pascal void DNSNotifierRoutine(void * contextPtr, OTEventCode otEvent, O if (_PR_MD_GET_INTSOFF()) { dnsContext.thread->md.missedIONotify = PR_TRUE; cpu->u.missed[cpu->where] |= _PR_MISSED_IO; - return; + } else { + DoneWaitingOnThisThread(dnsContext.thread); } - DoneWaitingOnThisThread(dnsContext.thread); break; case kOTProviderWillClose: @@ -189,9 +190,9 @@ static pascal void DNSNotifierRoutine(void * contextPtr, OTEventCode otEvent, O if (_PR_MD_GET_INTSOFF()) { dnsContext.thread->md.missedIONotify = PR_TRUE; cpu->u.missed[cpu->where] |= _PR_MISSED_IO; - return; + } else { + DoneWaitingOnThisThread(dnsContext.thread); } - DoneWaitingOnThisThread(dnsContext.thread); break; default: // or else we don't handle the event @@ -199,6 +200,8 @@ static pascal void DNSNotifierRoutine(void * contextPtr, OTEventCode otEvent, O } // or else we don't handle the event + + SignalIdleSemaphore(); } @@ -296,10 +299,12 @@ WakeUpNotifiedThread(PRThread *thread, OTResult result) if (_PR_MD_GET_INTSOFF()) { thread->md.missedIONotify = PR_TRUE; cpu->u.missed[cpu->where] |= _PR_MISSED_IO; - return; + } else { + DoneWaitingOnThisThread(thread); } - DoneWaitingOnThisThread(thread); } + + SignalIdleSemaphore(); } // Notification routine @@ -369,6 +374,8 @@ static pascal void NotifierRoutine(void * contextPtr, OTEventCode code, OTResul PR_ASSERT(err == kOTNoError); secret->md.exceptReady = PR_TRUE; // XXX Check this + md->disconnectError = discon.reason; // save for _MD_mac_get_nonblocking_connect_error + // wake up waiting threads, if any result = -3199 - discon.reason; // obtain the negative error code if ((readThread = secret->md.read.thread) != NULL) { @@ -1080,12 +1087,12 @@ typedef struct RawEndpointAndThread // A5 is OK. Cannot allocate memory here static pascal void RawEndpointNotifierRoutine(void * contextPtr, OTEventCode code, OTResult result, void * cookie) { - RawEndpointAndThread *endthr = (RawEndpointAndThread *) contextPtr; + RawEndpointAndThread *endthr = (RawEndpointAndThread *) contextPtr; PRThread * thread = endthr->thread; EndpointRef * endpoint = endthr->endpoint; _PRCPU * cpu = _PR_MD_CURRENT_CPU(); - OSStatus err; - OTResult resultOT; + OSStatus err; + OTResult resultOT; switch (code) { @@ -1169,10 +1176,12 @@ static pascal void RawEndpointNotifierRoutine(void * contextPtr, OTEventCode co if (_PR_MD_GET_INTSOFF()) { thread->md.asyncNotifyPending = PR_TRUE; cpu->u.missed[cpu->where] |= _PR_MISSED_IO; - return; + } else { + DoneWaitingOnThisThread(thread); } - DoneWaitingOnThisThread(thread); } + + SignalIdleSemaphore(); } PRInt32 _MD_accept(PRFileDesc *fd, PRNetAddr *addr, PRUint32 *addrlen, PRIntervalTime timeout) @@ -1309,7 +1318,7 @@ PRInt32 _MD_connect(PRFileDesc *fd, PRNetAddr *addr, PRUint32 addrlen, PRInterva err = kEFAULTErr; goto ErrorExit; } - + // Bind to a local port; let the system assign it. bindAddr.inet.family = AF_INET; @@ -1320,19 +1329,19 @@ PRInt32 _MD_connect(PRFileDesc *fd, PRNetAddr *addr, PRUint32 addrlen, PRInterva bindReq.addr.buf = (UInt8*) &bindAddr; bindReq.qlen = 0; - PR_Lock(fd->secret->md.miscLock); + PR_Lock(fd->secret->md.miscLock); PrepareForAsyncCompletion(me, fd->secret->md.osfd); - fd->secret->md.misc.thread = me; + fd->secret->md.misc.thread = me; err = OTBind(endpoint, &bindReq, NULL); if (err != kOTNoError) { - me->io_pending = PR_FALSE; - PR_Unlock(fd->secret->md.miscLock); - goto ErrorExit; - } + me->io_pending = PR_FALSE; + PR_Unlock(fd->secret->md.miscLock); + goto ErrorExit; + } WaitOnThisThread(me, PR_INTERVAL_NO_TIMEOUT); - PR_Unlock(fd->secret->md.miscLock); + PR_Unlock(fd->secret->md.miscLock); err = me->md.osErrCode; if (err != kOTNoError) @@ -1344,26 +1353,26 @@ PRInt32 _MD_connect(PRFileDesc *fd, PRNetAddr *addr, PRUint32 addrlen, PRInterva sndCall.addr.len = addrlen; sndCall.addr.buf = (UInt8*) addr; - if (!fd->secret->nonblocking) { - PrepareForAsyncCompletion(me, fd->secret->md.osfd); - PR_ASSERT(fd->secret->md.write.thread == NULL); - fd->secret->md.write.thread = me; + if (!fd->secret->nonblocking) { + PrepareForAsyncCompletion(me, fd->secret->md.osfd); + PR_ASSERT(fd->secret->md.write.thread == NULL); + fd->secret->md.write.thread = me; } - + err = OTConnect (endpoint, &sndCall, NULL); - if (err == kOTNoError) { - PR_ASSERT(!"OTConnect returned kOTNoError in async mode!?!"); - } - if (fd->secret->nonblocking) { - if (err == kOTNoDataErr) - err = EINPROGRESS; - goto ErrorExit; - } else { - if (err != kOTNoError && err != kOTNoDataErr) { - me->io_pending = PR_FALSE; - goto ErrorExit; - } - } + if (err == kOTNoError) { + PR_ASSERT(!"OTConnect returned kOTNoError in async mode!?!"); + } + if (fd->secret->nonblocking) { + if (err == kOTNoDataErr) + err = EINPROGRESS; + goto ErrorExit; + } else { + if (err != kOTNoError && err != kOTNoDataErr) { + me->io_pending = PR_FALSE; + goto ErrorExit; + } + } WaitOnThisThread(me, timeout); @@ -1583,7 +1592,6 @@ static PRInt32 SendReceiveDgram(PRFileDesc *fd, void *buf, PRInt32 amount, PRThread *me = _PR_MD_CURRENT_THREAD(); PRInt32 bytesLeft = amount; TUnitData dgram; - OTResult result; PR_ASSERT(flags == 0); @@ -1618,13 +1626,13 @@ static PRInt32 SendReceiveDgram(PRFileDesc *fd, void *buf, PRInt32 amount, fd->secret->md.write.thread = me; fd->secret->md.writeReady = PR_FALSE; // expect the worst err = OTSndUData(endpoint, &dgram); - if (result != kOTFlowErr) // hope for the best + if (err != kOTFlowErr) // hope for the best fd->secret->md.writeReady = PR_TRUE; } else { fd->secret->md.read.thread = me; fd->secret->md.readReady = PR_FALSE; // expect the worst err = OTRcvUData(endpoint, &dgram, NULL); - if (result != kOTNoDataErr) // hope for the best + if (err != kOTNoDataErr) // hope for the best fd->secret->md.readReady = PR_TRUE; } @@ -1754,83 +1762,126 @@ static PRBool GetState(PRFileDesc *fd, PRBool *readReady, PRBool *writeReady, PR } // check to see if any of the poll descriptors have data available +// for reading or writing, by calling their poll methods (layered IO). +static PRInt32 CheckPollDescMethods(PRPollDesc *pds, PRIntn npds, PRInt16 *outReadFlags, PRInt16 *outWriteFlags) +{ + PRInt32 ready = 0; + PRPollDesc *pd, *epd; + PRInt16 *readFlag, *writeFlag; + + for (pd = pds, epd = pd + npds, readFlag = outReadFlags, writeFlag = outWriteFlags; + pd < epd; + pd++, readFlag++, writeFlag++) + { + PRInt16 in_flags_read = 0, in_flags_write = 0; + PRInt16 out_flags_read = 0, out_flags_write = 0; + + if (NULL == pd->fd || pd->in_flags == 0) continue; + + if (pd->in_flags & PR_POLL_READ) + { + in_flags_read = (pd->fd->methods->poll)( + pd->fd, pd->in_flags & ~PR_POLL_WRITE, &out_flags_read); + } + + if (pd->in_flags & PR_POLL_WRITE) + { + in_flags_write = (pd->fd->methods->poll)( + pd->fd, pd->in_flags & ~PR_POLL_READ, &out_flags_write); + } + + if ((0 != (in_flags_read & out_flags_read)) || + (0 != (in_flags_write & out_flags_write))) + { + ready += 1; /* some layer has buffer input */ + pd->out_flags = out_flags_read | out_flags_write; + } + + *readFlag = in_flags_read; + *writeFlag = in_flags_write; + } + + return ready; +} + +// check to see if any of OT endpoints of the poll descriptors have data available // for reading or writing. -static PRInt32 CheckPollDescs(PRPollDesc *pds, PRIntn npds) +static PRInt32 CheckPollDescEndpoints(PRPollDesc *pds, PRIntn npds, const PRInt16 *inReadFlags, const PRInt16 *inWriteFlags) { PRInt32 ready = 0; PRPollDesc *pd, *epd; + const PRInt16 *readFlag, *writeFlag; - for (pd = pds, epd = pd + npds; pd < epd; pd++) - { - PRInt16 in_flags_read = 0, in_flags_write = 0; - PRInt16 out_flags_read = 0, out_flags_write = 0; + for (pd = pds, epd = pd + npds, readFlag = inReadFlags, writeFlag = inWriteFlags; + pd < epd; + pd++, readFlag++, writeFlag++) + { + PRFileDesc *bottomFD; + PRBool readReady, writeReady, exceptReady; + PRInt16 in_flags_read = *readFlag; + PRInt16 in_flags_write = *writeFlag; - if (NULL == pd->fd || pd->in_flags == 0) continue; + if (NULL == pd->fd || pd->in_flags == 0) continue; - if (pd->in_flags & PR_POLL_READ) - { - in_flags_read = (pd->fd->methods->poll)( - pd->fd, pd->in_flags & ~PR_POLL_WRITE, &out_flags_read); - } - if (pd->in_flags & PR_POLL_WRITE) - { - in_flags_write = (pd->fd->methods->poll)( - pd->fd, pd->in_flags & ~PR_POLL_READ, &out_flags_write); - } - if ((0 != (in_flags_read & out_flags_read)) - || (0 != (in_flags_write & out_flags_write))) - { - ready += 1; /* some layer has buffer input */ - pd->out_flags = out_flags_read | out_flags_write; - } - else + bottomFD = PR_GetIdentitiesLayer(pd->fd, PR_NSPR_IO_LAYER); + /* bottomFD can be NULL for pollable sockets */ + if (bottomFD) + { + if (_PR_FILEDESC_OPEN == bottomFD->secret->state) { - PRFileDesc *bottomFD; - PRBool readReady, writeReady, exceptReady; - pd->out_flags = 0; /* pre-condition */ - bottomFD = PR_GetIdentitiesLayer(pd->fd, PR_NSPR_IO_LAYER); - /* bottomFD can be NULL for pollable sockets */ - if (bottomFD) + + if (GetState(bottomFD, &readReady, &writeReady, &exceptReady)) { - if (_PR_FILEDESC_OPEN == bottomFD->secret->state) + if (readReady) { - if (GetState(bottomFD, &readReady, &writeReady, &exceptReady)) - { - if (readReady) - { - if (in_flags_read & PR_POLL_READ) - pd->out_flags |= PR_POLL_READ; - if (in_flags_write & PR_POLL_READ) - pd->out_flags |= PR_POLL_WRITE; - } - if (writeReady) - { - if (in_flags_read & PR_POLL_WRITE) - pd->out_flags |= PR_POLL_READ; - if (in_flags_write & PR_POLL_WRITE) - pd->out_flags |= PR_POLL_WRITE; - } - if (exceptReady && (pd->in_flags & PR_POLL_EXCEPT)) - { - pd->out_flags |= PR_POLL_EXCEPT; - } - if (0 != pd->out_flags) ready++; - } + if (in_flags_read & PR_POLL_READ) + pd->out_flags |= PR_POLL_READ; + if (in_flags_write & PR_POLL_READ) + pd->out_flags |= PR_POLL_WRITE; } - else /* bad state */ + if (writeReady) { - ready += 1; /* this will cause an abrupt return */ - pd->out_flags = PR_POLL_NVAL; /* bogii */ + if (in_flags_read & PR_POLL_WRITE) + pd->out_flags |= PR_POLL_READ; + if (in_flags_write & PR_POLL_WRITE) + pd->out_flags |= PR_POLL_WRITE; } + if (exceptReady && (pd->in_flags & PR_POLL_EXCEPT)) + { + pd->out_flags |= PR_POLL_EXCEPT; + } + if (0 != pd->out_flags) ready++; } } + else /* bad state */ + { + ready += 1; /* this will cause an abrupt return */ + pd->out_flags = PR_POLL_NVAL; /* bogii */ + } } + } + + return ready; +} + + +// see how many of the poll descriptors are ready +static PRInt32 CountReadyPollDescs(PRPollDesc *pds, PRIntn npds) +{ + PRInt32 ready = 0; + PRPollDesc *pd, *epd; + + for (pd = pds, epd = pd + npds; pd < epd; pd++) + { + if (pd->out_flags) + ready ++; + } return ready; } -// set or clear md.poll.thread on the poll descriptors +// set or clear the poll thread on the poll descriptors static void SetDescPollThread(PRPollDesc *pds, PRIntn npds, PRThread* thread) { PRInt32 ready = 0; @@ -1862,43 +1913,84 @@ static void SetDescPollThread(PRPollDesc *pds, PRIntn npds, PRThread* thread) bottomFD->secret->md.write.thread = thread; } } - } + } } } + +#define DESCRIPTOR_FLAGS_ARRAY_SIZE 32 + PRInt32 _MD_poll(PRPollDesc *pds, PRIntn npds, PRIntervalTime timeout) { + PRInt16 readFlagsArray[DESCRIPTOR_FLAGS_ARRAY_SIZE]; + PRInt16 writeFlagsArray[DESCRIPTOR_FLAGS_ARRAY_SIZE]; + + PRInt16 *readFlags = readFlagsArray; + PRInt16 *writeFlags = writeFlagsArray; + + PRInt16 *ioFlags = NULL; + PRThread *thread = _PR_MD_CURRENT_THREAD(); - intn is; - PRInt32 ready; + PRInt32 ready; - if (timeout == PR_INTERVAL_NO_WAIT) { - return CheckPollDescs(pds, npds); + if (npds > DESCRIPTOR_FLAGS_ARRAY_SIZE) + { + // we allocate a single double-size array. The first half is used + // for read flags, and the second half for write flags. + ioFlags = (PRInt16*)PR_Malloc(sizeof(PRInt16) * npds * 2); + if (!ioFlags) + { + PR_SetError(PR_OUT_OF_MEMORY_ERROR, 0); + return -1; + } + + readFlags = ioFlags; + writeFlags = &ioFlags[npds]; } - - _PR_INTSOFF(is); - PR_Lock(thread->md.asyncIOLock); - // ensure that we don't miss the firing of the notifier while checking socket status - // need to set up the thread - PrepareForAsyncCompletion(thread, 0); + if (timeout != PR_INTERVAL_NO_WAIT) { + intn is; + + // we have to be outside the lock when calling this, since + // it can call arbitrary user code (including other socket + // entry points) + (void)CheckPollDescMethods(pds, npds, readFlags, writeFlags); - SetDescPollThread(pds, npds, thread); - ready = CheckPollDescs(pds, npds); + _PR_INTSOFF(is); + PR_Lock(thread->md.asyncIOLock); + PrepareForAsyncCompletion(thread, 0); - PR_Unlock(thread->md.asyncIOLock); - _PR_FAST_INTSON(is); + SetDescPollThread(pds, npds, thread); - if (ready == 0) { - WaitOnThisThread(thread, timeout); - ready = CheckPollDescs(pds, npds); + (void)CheckPollDescEndpoints(pds, npds, readFlags, writeFlags); - } else { + PR_Unlock(thread->md.asyncIOLock); + _PR_FAST_INTSON(is); + + ready = CountReadyPollDescs(pds, npds); + + if (ready == 0) { + WaitOnThisThread(thread, timeout); + + // since we may have been woken by a pollable event firing, + // we have to check both poll methods and endpoints. + (void)CheckPollDescMethods(pds, npds, readFlags, writeFlags); + (void)CheckPollDescEndpoints(pds, npds, readFlags, writeFlags); + ready = CountReadyPollDescs(pds, npds); + } + thread->io_pending = PR_FALSE; + SetDescPollThread(pds, npds, NULL); + } + else { + (void)CheckPollDescMethods(pds, npds, readFlags, writeFlags); + (void)CheckPollDescEndpoints(pds, npds, readFlags, writeFlags); + ready = CountReadyPollDescs(pds, npds); } - SetDescPollThread(pds, npds, NULL); - + if (readFlags != readFlagsArray) + PR_Free(ioFlags); + return ready; } @@ -2192,25 +2284,32 @@ ErrorExit: } -int _MD_mac_get_nonblocking_connect_error(PRInt32 osfd) +int _MD_mac_get_nonblocking_connect_error(PRFileDesc* fd) { - OTResult resultOT; - EndpointRef endpoint = (EndpointRef) osfd; + EndpointRef endpoint = (EndpointRef)fd->secret->md.osfd; + OTResult resultOT = OTGetEndpointState(endpoint); - resultOT = OTGetEndpointState(endpoint); switch (resultOT) { case T_OUTCON: macsock_map_error(EINPROGRESS); return -1; + case T_DATAXFER: return 0; + case T_IDLE: + macsock_map_error(fd->secret->md.disconnectError); + fd->secret->md.disconnectError = 0; return -1; + case T_INREL: macsock_map_error(ENOTCONN); return -1; + default: PR_ASSERT(0); return -1; } + + return -1; // not reached } diff --git a/pr/src/md/mac/macthr.c b/pr/src/md/mac/macthr.c index 0df8a590..fd3b489d 100644 --- a/pr/src/md/mac/macthr.c +++ b/pr/src/md/mac/macthr.c @@ -39,7 +39,7 @@ #include #include #include - +#include #include #include #include @@ -49,6 +49,8 @@ TimerUPP gTimerCallbackUPP = NULL; PRThread * gPrimaryThread = NULL; +ProcessSerialNumber gApplicationProcess; + PR_IMPLEMENT(PRThread *) PR_GetPrimaryThread() { return gPrimaryThread; @@ -159,7 +161,21 @@ extern void _MD_ClearStack(PRThreadStack *ts) #pragma mark - #pragma mark TIME MANAGER-BASED CLOCK -TMTask gTimeManagerTaskElem; +// On Mac OS X, it's possible for the application to spend lots of time +// in WaitNextEvent, yielding to other applications. Since NSPR threads are +// cooperative here, this means that NSPR threads will also get very little +// time to run. To kick ourselves out of a WaitNextEvent call when we have +// determined that it's time to schedule another thread, the Timer Task +// (which fires every 8ms, even when other apps have the CPU) calls WakeUpProcess. +// We only want to do this on Mac OS X; the gTimeManagerTaskDoesWUP variable +// indicates when we're running on that OS. +// +// Note that the TimerCallback makes use of gApplicationProcess. We need to +// have set this up before the first possible run of the timer task; we do +// so in _MD_EarlyInit(). +static Boolean gTimeManagerTaskDoesWUP; + +static TMTask gTimeManagerTaskElem; extern void _MD_IOInterrupt(void); _PRInterruptTable _pr_interruptTable[] = { @@ -168,6 +184,8 @@ _PRInterruptTable _pr_interruptTable[] = { { 0 } }; +#define kMacTimerInMiliSecs 8L + pascal void TimerCallback(TMTaskPtr tmTaskPtr) { _PRCPU *cpu = _PR_MD_CURRENT_CPU(); @@ -184,8 +202,20 @@ pascal void TimerCallback(TMTaskPtr tmTaskPtr) // And tell nspr that a clock interrupt occured. _PR_ClockInterrupt(); - if ((_PR_RUNQREADYMASK(cpu)) >> ((_PR_MD_CURRENT_THREAD()->priority))) + if ((_PR_RUNQREADYMASK(cpu)) >> ((_PR_MD_CURRENT_THREAD()->priority))) { + if (gTimeManagerTaskDoesWUP) { + // We only want to call WakeUpProcess if we know that NSPR has managed to switch threads + // since the last call, otherwise we end up spewing out WakeUpProcess() calls while the + // application is blocking somewhere. This can interfere with events loops other than + // our own (see bug 158927). + if (UnsignedWideToUInt64(cpu->md.lastThreadSwitch) > UnsignedWideToUInt64(cpu->md.lastWakeUpProcess)) + { + WakeUpProcess(&gApplicationProcess); + cpu->md.lastWakeUpProcess = UpTime(); + } + } _PR_SET_RESCHED_FLAG(); + } _PR_FAST_INTSON(is); @@ -198,8 +228,10 @@ void _MD_StartInterrupts(void) { gPrimaryThread = _PR_MD_CURRENT_THREAD(); + gTimeManagerTaskDoesWUP = RunningOnOSX(); + if ( !gTimerCallbackUPP ) - gTimerCallbackUPP = NewTimerProc(TimerCallback); + gTimerCallbackUPP = NewTimerUPP(TimerCallback); // Fill in the Time Manager queue element @@ -222,26 +254,36 @@ void _MD_StopInterrupts(void) } } + +#define MAX_PAUSE_TIMEOUT_MS 500 + void _MD_PauseCPU(PRIntervalTime timeout) { if (timeout != PR_INTERVAL_NO_WAIT) { - EventRecord theEvent; - - /* - ** Calling WaitNextEvent() here is suboptimal. This routine should - ** pause the process until IO or the timeout occur, yielding time to - ** other processes on operating systems that require this (Mac OS classic). - ** WaitNextEvent() may incur too much latency, and has other problems, - ** such as the potential to drop suspend/resume events, and to handle - ** AppleEvents at a time at which we're not prepared to handle them. - */ - (void) WaitNextEvent(nullEvent, &theEvent, 1, NULL); - + // There is a race condition entering the critical section + // in AsyncIOCompletion (and probably elsewhere) that can + // causes deadlock for the duration of this timeout. To + // work around this, use a max 500ms timeout for now. + // See bug 99561 for details. + if (PR_IntervalToMilliseconds(timeout) > MAX_PAUSE_TIMEOUT_MS) + timeout = PR_MillisecondsToInterval(MAX_PAUSE_TIMEOUT_MS); + + WaitOnIdleSemaphore(timeout); (void) _MD_IOInterrupt(); } } +void _MD_InitRunningCPU(_PRCPU* cpu) +{ + cpu->md.trackScheduling = RunningOnOSX(); + if (cpu->md.trackScheduling) { + AbsoluteTime zeroTime = {0, 0}; + cpu->md.lastThreadSwitch = UpTime(); + cpu->md.lastWakeUpProcess = zeroTime; + } +} + //############################################################################## //############################################################################## @@ -528,19 +570,25 @@ void _MD_SetIntsOff(PRInt32 ints) #pragma mark - #pragma mark CRITICAL REGION SUPPORT + +static PRBool RunningOnOSX() +{ + long systemVersion; + OSErr err = Gestalt(gestaltSystemVersion, &systemVersion); + return (err == noErr) && (systemVersion >= 0x00001000); +} + + #if MAC_CRITICAL_REGIONS MDCriticalRegionID gCriticalRegion; void InitCriticalRegion() { - long systemVersion; OSStatus err; // we only need to do critical region stuff on Mac OS X - err = Gestalt(gestaltSystemVersion, &systemVersion); - gUseCriticalRegions = (err == noErr) && (systemVersion >= 0x00001000); - + gUseCriticalRegions = RunningOnOSX(); if (!gUseCriticalRegions) return; err = MD_CriticalRegionCreate(&gCriticalRegion); @@ -586,3 +634,85 @@ void LeaveCritialRegion() #endif // MAC_CRITICAL_REGIONS +//############################################################################## +//############################################################################## +#pragma mark - +#pragma mark IDLE SEMAPHORE SUPPORT + +/* + Since the WaitNextEvent() in _MD_PauseCPU() is causing all sorts of + headache under Mac OS X we're going to switch to MPWaitOnSemaphore() + which should do what we want +*/ + +#if TARGET_CARBON +PRBool gUseIdleSemaphore = PR_FALSE; +MPSemaphoreID gIdleSemaphore = NULL; +#endif + +void InitIdleSemaphore() +{ + // we only need to do idle semaphore stuff on Mac OS X +#if TARGET_CARBON + gUseIdleSemaphore = RunningOnOSX(); + if (gUseIdleSemaphore) + { + OSStatus err = MPCreateSemaphore(1 /* max value */, 0 /* initial value */, &gIdleSemaphore); + PR_ASSERT(err == noErr); + } +#endif +} + +void TermIdleSemaphore() +{ +#if TARGET_CARBON + if (gUseIdleSemaphore) + { + OSStatus err = MPDeleteSemaphore(gIdleSemaphore); + PR_ASSERT(err == noErr); + gUseIdleSemaphore = NULL; + } +#endif +} + + +void WaitOnIdleSemaphore(PRIntervalTime timeout) +{ +#if TARGET_CARBON + if (gUseIdleSemaphore) + { + OSStatus err = MPWaitOnSemaphore(gIdleSemaphore, kDurationMillisecond * PR_IntervalToMilliseconds(timeout)); + PR_ASSERT(err == noErr); + } + else +#endif + { + EventRecord theEvent; + /* + ** Calling WaitNextEvent() here is suboptimal. This routine should + ** pause the process until IO or the timeout occur, yielding time to + ** other processes on operating systems that require this (Mac OS classic). + ** WaitNextEvent() may incur too much latency, and has other problems, + ** such as the potential to drop suspend/resume events. + */ + (void)WaitNextEvent(nullEvent, &theEvent, 1, NULL); + } +} + + +void SignalIdleSemaphore() +{ +#if TARGET_CARBON + if (gUseIdleSemaphore) + { + // often we won't be waiting on the semaphore here, so ignore any errors + (void)MPSignalSemaphore(gIdleSemaphore); + } + else +#endif + { + WakeUpProcess(&gApplicationProcess); + } +} + + diff --git a/pr/src/md/mac/mdcriticalregion.c b/pr/src/md/mac/mdcriticalregion.c index 927b9246..ff035d0d 100644 --- a/pr/src/md/mac/mdcriticalregion.c +++ b/pr/src/md/mac/mdcriticalregion.c @@ -35,6 +35,7 @@ */ #include "mdcriticalregion.h" +#include /* This code is a replacement for MPEnterCriticalRegion/MPLeaveCriticalRegion, diff --git a/pr/src/md/mac/mdmac.c b/pr/src/md/mac/mdmac.c index f7e9a4fa..6d65e578 100644 --- a/pr/src/md/mac/mdmac.c +++ b/pr/src/md/mac/mdmac.c @@ -70,6 +70,7 @@ unsigned char GarbageCollectorCacheFlusher(PRUint32 size); extern PRThread *gPrimaryThread; +extern ProcessSerialNumber gApplicationProcess; // in macthr.c //############################################################################## @@ -288,7 +289,10 @@ void _MD_EarlyInit() { Handle environmentVariables; + GetCurrentProcess(&gApplicationProcess); + INIT_CRITICAL_REGION(); + InitIdleSemaphore(); #if !defined(MAC_NSPR_STANDALONE) // MacintoshInitializeMemory(); Moved to mdmacmem.c: AllocateRawMemory(Size blockSize) @@ -376,6 +380,7 @@ void CleanupTermProc(void) _MD_StopInterrupts(); // deactive Time Manager task CLOSE_OPEN_TRANSPORT(); + TermIdleSemaphore(); TERM_CRITICAL_REGION(); __NSTerminate(); diff --git a/pr/src/md/os2/os2_errors.c b/pr/src/md/os2/os2_errors.c index f5be8391..5efd2c16 100644 --- a/pr/src/md/os2/os2_errors.c +++ b/pr/src/md/os2/os2_errors.c @@ -35,6 +35,44 @@ #include "prerror.h" #include "primpl.h" +void _MD_os2_map_default_error(PRInt32 err) +{ + switch (err) { + case EWOULDBLOCK: + PR_SetError(PR_WOULD_BLOCK_ERROR, err); + break; + case EBADF: + PR_SetError(PR_BAD_DESCRIPTOR_ERROR, err); + break; + case ENOTSOCK: + PR_SetError(PR_NOT_SOCKET_ERROR, err); + break; + case EMSGSIZE: + case EINVAL: + PR_SetError(PR_INVALID_ARGUMENT_ERROR, err); + break; + case ENOBUFS: + PR_SetError(PR_INSUFFICIENT_RESOURCES_ERROR, err); + break; + case ECONNREFUSED: + PR_SetError(PR_CONNECT_REFUSED_ERROR, err); + break; + case EISCONN: + PR_SetError(PR_IS_CONNECTED_ERROR, err); + break; +#ifdef SOCEFAULT + case SOCEFAULT: + PR_SetError(PR_ACCESS_FAULT_ERROR, err); + break; +#endif + case ERROR_NETNAME_DELETED: + PR_SetError(PR_CONNECT_RESET_ERROR, err); + break; + default: + PR_SetError(PR_UNKNOWN_ERROR, err); + break; + } +} void _MD_os2_map_opendir_error(PRInt32 err) { switch (err) { @@ -92,7 +130,7 @@ void _MD_os2_map_closedir_error(PRInt32 err) } } -void _MD_unix_readdir_error(PRInt32 err) +void _MD_os2_readdir_error(PRInt32 err) { switch (err) { @@ -671,73 +709,17 @@ void _MD_os2_map_send_error(PRInt32 err) void _MD_os2_map_sendto_error(PRInt32 err) { - switch (err) { - case EWOULDBLOCK: - PR_SetError(PR_WOULD_BLOCK_ERROR, err); - break; - case EBADF: - PR_SetError(PR_BAD_DESCRIPTOR_ERROR, err); - break; - case ENOTSOCK: - PR_SetError(PR_NOT_SOCKET_ERROR, err); - break; - case EMSGSIZE: - case EINVAL: - PR_SetError(PR_INVALID_ARGUMENT_ERROR, err); - break; - case ENOBUFS: - PR_SetError(PR_INSUFFICIENT_RESOURCES_ERROR, err); - break; - case ECONNREFUSED: - PR_SetError(PR_CONNECT_REFUSED_ERROR, err); - break; - case EISCONN: - PR_SetError(PR_IS_CONNECTED_ERROR, err); - break; -#ifdef SOCEFAULT - case SOCEFAULT: - PR_SetError(PR_ACCESS_FAULT_ERROR, err); - break; -#endif - case ERROR_NETNAME_DELETED: - PR_SetError(PR_CONNECT_RESET_ERROR, err); - break; - default: - PR_SetError(PR_UNKNOWN_ERROR, err); - break; - } + _MD_os2_map_default_error(err); +} + +void _MD_os2_map_writev_error(int err) +{ + _MD_os2_map_default_error(err); } void _MD_os2_map_accept_error(PRInt32 err) { - switch (err) { - case EWOULDBLOCK: - PR_SetError(PR_WOULD_BLOCK_ERROR, err); - break; - case EBADF: - PR_SetError(PR_BAD_DESCRIPTOR_ERROR, err); - break; - case ENOTSOCK: - PR_SetError(PR_NOT_SOCKET_ERROR, err); - break; - case EOPNOTSUPP: - PR_SetError(PR_NOT_TCP_SOCKET_ERROR, err); - break; -#ifdef SOCEFAULT - case SOCEFAULT: - PR_SetError(PR_ACCESS_FAULT_ERROR, err); - break; -#endif - case EMFILE: - PR_SetError(PR_PROC_DESC_TABLE_FULL_ERROR, err); - break; - case ENOBUFS: - PR_SetError(PR_OUT_OF_MEMORY_ERROR, err); - break; - default: - PR_SetError(PR_UNKNOWN_ERROR, err); - break; - } + _MD_os2_map_default_error(err); } void _MD_os2_map_acceptex_error(PRInt32 err) @@ -759,6 +741,21 @@ void _MD_os2_map_acceptex_error(PRInt32 err) } } +/* + * An error code of 0 means that the nonblocking connect succeeded. + */ + +int _MD_os2_get_nonblocking_connect_error(int osfd) +{ + int err; + int len = sizeof(err); + if (getsockopt(osfd, SOL_SOCKET, SO_ERROR, (char *) &err, &len) == -1) { + return sock_errno(); + } else { + return err; + } +} + void _MD_os2_map_connect_error(PRInt32 err) { switch (err) { diff --git a/pr/src/md/os2/os2cv.c b/pr/src/md/os2/os2cv.c index 1a2d9399..76c96330 100644 --- a/pr/src/md/os2/os2cv.c +++ b/pr/src/md/os2/os2cv.c @@ -48,6 +48,38 @@ #include "primpl.h" +#ifdef USE_RAMSEM +ULONG _Far16 _Pascal Dos16GetInfoSeg(PSEL pselGlobal, PSEL pselLocal); + +typedef struct _LINFOSEG +{ + USHORT pidCurrent; + USHORT pidParent; + USHORT prtyCurrent; + USHORT tidCurrent; + USHORT sgCurrent; + UCHAR rfProcStatus; + UCHAR dummy1; + BOOL16 fForeground; + UCHAR typProcess; + UCHAR dummy2; + SEL selEnvironment; + USHORT offCmdLine; + USHORT cbDataSegment; + USHORT cbStack; + USHORT cbHeap; + USHORT hmod; + SEL selDS; + SEL selPack; + SEL selPackShr; + SEL selPackPck; + ULONG ulReserved; +} LINFOSEG; +typedef LINFOSEG FAR *PLINFOSEG; + +PLINFOSEG plisCurrent = NULL; +#endif + /* * AddThreadToCVWaitQueueInternal -- * @@ -82,7 +114,7 @@ AddThreadToCVWaitQueueInternal(PRThread *thred, struct _MDCVar *cv) * This function is called by _PR_MD_WAIT_CV and _PR_MD_UNLOCK, * the two places where a lock is unlocked. */ -static void +void md_UnlockAndPostNotifies( _MDLock *lock, PRThread *waitThred, @@ -163,7 +195,11 @@ md_UnlockAndPostNotifies( } /* Release the lock before notifying */ - DosReleaseMutexSem(lock->mutex); +#ifdef USE_RAMSEM + SemReleasex86(&lock->mutex, 0); +#else + DosReleaseMutexSem(lock->mutex); +#endif notified = &post; /* this is where we start */ do { @@ -270,7 +306,11 @@ _PR_MD_WAIT_CV(_MDCVar *cv, _MDLock *lock, PRIntervalTime timeout ) md_UnlockAndPostNotifies(lock, thred, cv); } else { AddThreadToCVWaitQueueInternal(thred, cv); +#ifdef USE_RAMSEM + SemReleasex86( &lock->mutex, 0 ); +#else DosReleaseMutexSem(lock->mutex); +#endif } /* Wait for notification or timeout; don't really care which */ @@ -279,7 +319,11 @@ _PR_MD_WAIT_CV(_MDCVar *cv, _MDLock *lock, PRIntervalTime timeout ) DosResetEventSem(thred->md.blocked_sema, &count); } +#ifdef USE_RAMSEM + SemRequest486(&(lock->mutex), -1); +#else DosRequestMutexSem((lock->mutex), SEM_INDEFINITE_WAIT); +#endif PR_ASSERT(rv == NO_ERROR || rv == ERROR_TIMEOUT); @@ -336,28 +380,41 @@ _PR_MD_NOTIFY_CV(_MDCVar *cv, _MDLock *lock) PRStatus _PR_MD_NEW_LOCK(_MDLock *lock) { +#ifdef USE_RAMSEM + // It's better if this API traps when pCriticalSect is not a valid + // pointer, because we can't return an error code and if we just return + // the API caller will have nasty bugs that are hard to find. + + PRAMSEM pramsem = (PRAMSEM)(&(lock->mutex)); + /* First time, set up addresses of processor specific functions + */ + if (plisCurrent == NULL) + { + SEL selGlobal = 0, selLocal = 0; + + /* Convert 16 bit global information segment to 32 bit address + * by performing CRMA on the 16 bit address: "shift" operation + * to convert sel to flat, "and" operation to mask the address + * to 32-bit + */ + Dos16GetInfoSeg(&selGlobal, &selLocal); + plisCurrent = (PLINFOSEG)(((ULONG)selLocal << 13) & + (ULONG)0x1fff0000); + + } + + memset(pramsem, 0, sizeof(pramsem)); + DosCreateEventSem(0, &pramsem->hevSem, DC_SEM_SHARED, 0); + + lock->notified.length=0; + lock->notified.link=NULL; + return PR_SUCCESS; +#else DosCreateMutexSem(0, &(lock->mutex), 0, 0); (lock)->notified.length=0; (lock)->notified.link=NULL; return PR_SUCCESS; -} - -void -_PR_MD_FREE_LOCK(_MDLock *lock) -{ - DosCloseMutexSem(lock->mutex); -} - -void _PR_MD_LOCK(_MDLock *lock) -{ - DosRequestMutexSem(lock->mutex, SEM_INDEFINITE_WAIT); -} - -PRIntn -_PR_MD_TEST_AND_LOCK(_MDLock *lock) -{ - DosRequestMutexSem(lock->mutex, SEM_INDEFINITE_WAIT); - return 0; +#endif } void @@ -366,14 +423,3 @@ _PR_MD_NOTIFYALL_CV(_MDCVar *cv, _MDLock *lock) md_PostNotifyToCvar(cv, lock, PR_TRUE); return; } - -void -_PR_MD_UNLOCK(_MDLock *lock) -{ - if (0 != lock->notified.length) { - md_UnlockAndPostNotifies(lock, NULL, NULL); - } else { - DosReleaseMutexSem(lock->mutex); - } - return; -} diff --git a/pr/src/md/os2/os2inrval.c b/pr/src/md/os2/os2inrval.c index 469da314..5c112531 100644 --- a/pr/src/md/os2/os2inrval.c +++ b/pr/src/md/os2/os2inrval.c @@ -39,57 +39,22 @@ #include "primpl.h" -ULONG _os2_ticksPerSec = -1; -PRIntn _os2_bitShift = 0; -PRInt32 _os2_highMask = 0; - - void _PR_MD_INTERVAL_INIT() { - if (DosTmrQueryFreq(&_os2_ticksPerSec) == NO_ERROR) - { - while(_os2_ticksPerSec > PR_INTERVAL_MAX) { - _os2_ticksPerSec >>= 1; - _os2_bitShift++; - _os2_highMask = (_os2_highMask << 1)+1; - } - } - else - _os2_ticksPerSec = -1; - - PR_ASSERT(_os2_ticksPerSec > PR_INTERVAL_MIN && _os2_ticksPerSec < PR_INTERVAL_MAX); } PRIntervalTime _PR_MD_GET_INTERVAL() { - QWORD count; - - /* Sadly; nspr requires the interval to range from 1000 ticks per second - * to only 100000 ticks per second; Counter is too high - * resolution... - */ - if (DosTmrQueryTime(&count) == NO_ERROR) { - PRInt32 top = count.ulHi & _os2_highMask; - top = top << (32 - _os2_bitShift); - count.ulLo = count.ulLo >> _os2_bitShift; - count.ulHi = count.ulLo + top; - return (PRUint32)count.ulLo; - } - else{ - ULONG msCount = PR_FAILURE; - DosQuerySysInfo(QSV_MS_COUNT, QSV_MS_COUNT, &msCount, sizeof(msCount)); - return msCount; - } + ULONG msCount = PR_FAILURE; + DosQuerySysInfo(QSV_MS_COUNT, QSV_MS_COUNT, &msCount, sizeof(msCount)); + return msCount; } PRIntervalTime _PR_MD_INTERVAL_PER_SEC() { - if(_os2_ticksPerSec != -1) - return _os2_ticksPerSec; - else - return 1000; + return 1000; } diff --git a/pr/src/md/os2/os2io.c b/pr/src/md/os2/os2io.c index 12e2f2a2..acccf6a6 100644 --- a/pr/src/md/os2/os2io.c +++ b/pr/src/md/os2/os2io.c @@ -253,6 +253,12 @@ _PR_MD_WRITE(PRFileDesc *fd, const void *buf, PRInt32 len) return -1; } + if (len != bytes) { + rv = ERROR_DISK_FULL; + _PR_MD_MAP_WRITE_ERROR(rv); + return -1; + } + return bytes; } /* --- end _PR_MD_WRITE() --- */ diff --git a/pr/src/md/os2/os2misc.c b/pr/src/md/os2/os2misc.c index be597fcd..c27b0614 100644 --- a/pr/src/md/os2/os2misc.c +++ b/pr/src/md/os2/os2misc.c @@ -118,107 +118,28 @@ PR_Now(void) static int assembleCmdLine(char *const *argv, char **cmdLine) { char *const *arg; - char *p, *q; int cmdLineSize; - int numBackslashes; - int i; - int argNeedQuotes; /* * Find out how large the command line buffer should be. */ cmdLineSize = 0; - for (arg = argv; *arg; arg++) { - /* - * \ and " need to be escaped by a \. In the worst case, - * every character is a \ or ", so the string of length - * may double. If we quote an argument, that needs two ". - * Finally, we need a space between arguments, a null between - * the EXE name and the arguments, and 2 nulls at the end - * of command line. - */ - cmdLineSize += 2 * strlen(*arg) /* \ and " need to be escaped */ - + 2 /* we quote every argument */ - + 4; /* space in between, or final nulls */ - } - p = *cmdLine = PR_MALLOC(cmdLineSize); - if (p == NULL) { + for (arg = argv+1; *arg; arg++) { + cmdLineSize += strlen(*arg) + 1; /* space in between, or final null */ + } + *cmdLine = PR_MALLOC(cmdLineSize); + if (*cmdLine == NULL) { return -1; } - for (arg = argv; *arg; arg++) { - /* Add a space to separates the arguments */ - if (arg > argv + 1) { - *p++ = ' '; - } - q = *arg; - numBackslashes = 0; - argNeedQuotes = 0; - - /* If the argument contains white space, it needs to be quoted. */ - if (strpbrk(*arg, " \f\n\r\t\v")) { - argNeedQuotes = 1; - } - - if (argNeedQuotes) { - *p++ = '"'; - } - while (*q) { - if (*q == '\\') { - numBackslashes++; - q++; - } else if (*q == '"') { - if (numBackslashes) { - /* - * Double the backslashes since they are followed - * by a quote - */ - for (i = 0; i < 2 * numBackslashes; i++) { - *p++ = '\\'; - } - numBackslashes = 0; - } - /* To escape the quote */ - *p++ = '\\'; - *p++ = *q++; - } else { - if (numBackslashes) { - /* - * Backslashes are not followed by a quote, so - * don't need to double the backslashes. - */ - for (i = 0; i < numBackslashes; i++) { - *p++ = '\\'; - } - numBackslashes = 0; - } - *p++ = *q++; - } - } + (*cmdLine)[0] = '\0'; - /* Now we are at the end of this argument */ - if (numBackslashes) { - /* - * Double the backslashes if we have a quote string - * delimiter at the end. - */ - if (argNeedQuotes) { - numBackslashes *= 2; - } - for (i = 0; i < numBackslashes; i++) { - *p++ = '\\'; - } + for (arg = argv+1; *arg; arg++) { + if (arg > argv +1) { + strcat(*cmdLine, " "); } - if (argNeedQuotes) { - *p++ = '"'; - } - if(arg == argv) - *p++ = '\0'; + strcat(*cmdLine, *arg); } - - /* Add 2 nulls at the end */ - *p++ = '\0'; - *p = '\0'; return 0; } @@ -308,129 +229,154 @@ static int compare(const void *arg1, const void *arg2) { return stricmp(* (char**)arg1, * (char**)arg2); } + PRProcess * _PR_CreateOS2Process( const char *path, char *const *argv, char *const *envp, const PRProcessAttr *attr) { - char szFailed[CCHMAXPATH]; - RESULTCODES procInfo; - APIRET retVal; - char *cmdLine = NULL; - char *envBlock = NULL; - char **newEnvp; - PRProcess *proc = NULL; - HFILE hStdIn = 0, - hStdOut = 0, - hStdErr = 0; - HFILE hStdInSave = -1, - hStdOutSave = -1, - hStdErrSave = -1; - - proc = PR_NEW(PRProcess); - if (!proc) { - PR_SetError(PR_OUT_OF_MEMORY_ERROR, 0); - goto errorExit; - } - - if (assembleCmdLine(argv, &cmdLine) == -1) { - PR_SetError(PR_OUT_OF_MEMORY_ERROR, 0); - goto errorExit; - } - - if (envp == NULL) { - newEnvp = NULL; - } else { - int i; - int numEnv = 0; - while (envp[numEnv]) { - numEnv++; - } - newEnvp = (char **) PR_MALLOC((numEnv+1) * sizeof(char *)); - for (i = 0; i <= numEnv; i++) { - newEnvp[i] = envp[i]; - } - qsort((void *) newEnvp, (size_t) numEnv, sizeof(char *), compare); - } - if (assembleEnvBlock(newEnvp, &envBlock) == -1) { - PR_SetError(PR_OUT_OF_MEMORY_ERROR, 0); - goto errorExit; - } - - if (attr) { - /* On OS/2, there is really no way to pass file handles for stdin, stdout, - * and stderr to a new process. Instead, we can make it a child process - * and make the given file handles a copy of our stdin, stdout, and stderr. - * The child process then inherits ours, and we set ours back. Twisted - * and gross I know. If you know a better way, please use it. - */ - if (attr->stdinFd) { - hStdIn = 0; - DosDupHandle(hStdIn, &hStdInSave); - DosDupHandle((HFILE) attr->stdinFd->secret->md.osfd, &hStdIn); - } - if (attr->stdoutFd) { - hStdOut = 1; - DosDupHandle(hStdOut, &hStdOutSave); - DosDupHandle((HFILE) attr->stdoutFd->secret->md.osfd, &hStdOut); + PRProcess *proc = NULL; + char *cmdLine = NULL; + char **newEnvp; + char *envBlock = NULL; + + STARTDATA startData = {0}; + APIRET rc; + ULONG ulAppType = 0; + PID pid = 0; + char *pEnvWPS = NULL; + char *pszComSpec; + char pszEXEName[CCHMAXPATH] = ""; + char pszFormatString[CCHMAXPATH]; + char pszObjectBuffer[CCHMAXPATH]; + char *pszFormatResult = NULL; + + proc = PR_NEW(PRProcess); + if (!proc) { + PR_SetError(PR_OUT_OF_MEMORY_ERROR, 0); + goto errorExit; + } + + if (assembleCmdLine(argv, &cmdLine) == -1) { + PR_SetError(PR_OUT_OF_MEMORY_ERROR, 0); + goto errorExit; + } + + if (envp == NULL) { + newEnvp = NULL; + } else { + int i; + int numEnv = 0; + while (envp[numEnv]) { + numEnv++; } - if (attr->stderrFd) { - hStdErr = 2; - DosDupHandle(hStdErr, &hStdErrSave); - DosDupHandle((HFILE) attr->stderrFd->secret->md.osfd, &hStdErr); + newEnvp = (char **) PR_MALLOC((numEnv+1) * sizeof(char *)); + for (i = 0; i <= numEnv; i++) { + newEnvp[i] = envp[i]; } - } - - retVal = DosExecPgm(szFailed, - CCHMAXPATH, - EXEC_ASYNCRESULT, - cmdLine, - envBlock, - &procInfo, - argv[0]); - - /* Restore our old values. Hope this works */ - if(hStdInSave != -1){ - DosDupHandle(hStdInSave, &hStdIn); - DosClose(hStdInSave); - } - if(hStdOutSave != -1){ - DosDupHandle(hStdOutSave, &hStdOut); - DosClose(hStdOutSave); - } - if(hStdErrSave != -1){ - DosDupHandle(hStdErrSave, &hStdErr); - DosClose(hStdErrSave); - } + qsort((void *) newEnvp, (size_t) numEnv, sizeof(char *), compare); + } + if (assembleEnvBlock(newEnvp, &envBlock) == -1) { + PR_SetError(PR_OUT_OF_MEMORY_ERROR, 0); + goto errorExit; + } + + if (attr) { + PR_ASSERT(!"Not implemented"); + } - if (retVal != NO_ERROR) { - /* XXX what error code? */ - PR_SetError(PR_UNKNOWN_ERROR, retVal); + rc = DosQueryAppType(path, &ulAppType); + if (rc != NO_ERROR) { + char *pszDot = strrchr(path, '.'); + if (pszDot) { + /* If it is a CMD file, launch the users command processor */ + if (!stricmp(pszDot, ".cmd")) { + rc = DosScanEnv("COMSPEC", &pszComSpec); + if (!rc) { + strcpy(pszFormatString, "/C %s %s"); + strcpy(pszEXEName, pszComSpec); + ulAppType = FAPPTYP_WINDOWCOMPAT; + } + } + } + } + if (ulAppType == 0) { + PR_SetError(PR_UNKNOWN_ERROR, 0); goto errorExit; - } - - proc->md.pid = procInfo.codeTerminate; + } + + if ((ulAppType & FAPPTYP_WINDOWAPI) == FAPPTYP_WINDOWAPI) { + startData.SessionType = SSF_TYPE_PM; + } + else if (ulAppType & FAPPTYP_WINDOWCOMPAT) { + startData.SessionType = SSF_TYPE_WINDOWABLEVIO; + } + else { + startData.SessionType = SSF_TYPE_DEFAULT; + } + + if (ulAppType & (FAPPTYP_WINDOWSPROT31 | FAPPTYP_WINDOWSPROT | FAPPTYP_WINDOWSREAL)) + { + strcpy(pszEXEName, "WINOS2.COM"); + startData.SessionType = PROG_31_STDSEAMLESSVDM; + strcpy(pszFormatString, "/3 %s %s"); + } + + startData.InheritOpt = SSF_INHERTOPT_PARENT; + + if (pszEXEName[0]) { + pszFormatResult = PR_MALLOC(strlen(pszFormatString)+strlen(path)+strlen(cmdLine)); + sprintf(pszFormatResult, pszFormatString, path, cmdLine); + startData.PgmInputs = pszFormatResult; + } else { + strcpy(pszEXEName, path); + startData.PgmInputs = cmdLine; + } + startData.PgmName = pszEXEName; + + startData.Length = sizeof(startData); + startData.Related = SSF_RELATED_INDEPENDENT; + startData.ObjectBuffer = pszObjectBuffer; + startData.ObjectBuffLen = CCHMAXPATH; + startData.Environment = envBlock; + + rc = DosStartSession(&startData, &ulAppType, &pid); + + if ((rc != NO_ERROR) && (rc != ERROR_SMG_START_IN_BACKGROUND)) { + PR_SetError(PR_UNKNOWN_ERROR, 0); + } + + proc->md.pid = pid; - PR_DELETE(cmdLine); - if (envBlock) { - PR_DELETE(envBlock); - } - return proc; + if (pszFormatResult) { + PR_DELETE(pszFormatResult); + } + + PR_DELETE(cmdLine); + if (newEnvp) { + PR_DELETE(newEnvp); + } + if (envBlock) { + PR_DELETE(envBlock); + } + return proc; errorExit: - if (cmdLine) { - PR_DELETE(cmdLine); - } - if (envBlock) { - PR_DELETE(envBlock); - } - if (proc) { - PR_DELETE(proc); - } - return NULL; - -} /* _PR_CreateWindowsProcess */ + if (cmdLine) { + PR_DELETE(cmdLine); + } + if (newEnvp) { + PR_DELETE(newEnvp); + } + if (envBlock) { + PR_DELETE(envBlock); + } + if (proc) { + PR_DELETE(proc); + } + return NULL; +} /* _PR_CreateOS2Process */ PRStatus _PR_DetachOS2Process(PRProcess *process) { diff --git a/pr/src/md/os2/os2poll.c b/pr/src/md/os2/os2poll.c index 12f199f6..da477b1b 100644 --- a/pr/src/md/os2/os2poll.c +++ b/pr/src/md/os2/os2poll.c @@ -37,54 +37,64 @@ */ #ifdef XP_OS2_EMX - #include /* For timeval. */ + #include /* For timeval. */ #endif #include "primpl.h" -PRInt32 _PR_MD_PR_POLL( - PRPollDesc *pds, PRIntn npds, PRIntervalTime timeout) +#ifndef BSD_SELECT +/* Utility functions called when using OS/2 select */ + +PRBool IsSocketSet( PRInt32 osfd, int* socks, int start, int count ) +{ + int i; + PRBool isSet = PR_FALSE; + + for( i = start; i < start+count; i++ ) + { + if( socks[i] == osfd ) + isSet = PR_TRUE; + } + + return isSet; +} +#endif + +PRInt32 _PR_MD_PR_POLL(PRPollDesc *pds, PRIntn npds, PRIntervalTime timeout) { - PRInt32 osfd; - int maxfd = -1; +#ifdef BSD_SELECT fd_set rd, wt, ex; +#else + int rd, wt, ex; + int* socks; + unsigned long msecs; + int i, j; +#endif PRFileDesc *bottom; PRPollDesc *pd, *epd; - PRInt32 ready, err; - PRThread *me = _PR_MD_CURRENT_THREAD(); - struct timeval tv, *tvp = NULL; + PRInt32 maxfd = -1, ready, err; + PRIntervalTime remaining, elapsed, start; - /* - * For restarting _MD_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, elapsed, remaining; +#ifdef BSD_SELECT + struct timeval tv, *tvp = NULL; - if (_PR_PENDING_INTERRUPT(me)) + FD_ZERO(&rd); + FD_ZERO(&wt); + FD_ZERO(&ex); +#else + rd = 0; + wt = 0; + ex = 0; + socks = (int) PR_MALLOC( npds * 3 * sizeof(int) ); + + if (!socks) { - me->flags &= ~_PR_INTERRUPT; - PR_SetError(PR_PENDING_INTERRUPT_ERROR, 0); + PR_SetError(PR_OUT_OF_MEMORY_ERROR, 0); return -1; } +#endif - /* - ** Is it an empty set? If so, just sleep for the timeout and return - */ - if (0 == npds) - { - PR_Sleep(timeout); - return 0; - } - - remaining = timeout; - start = PR_IntervalNow(); - - FD_ZERO(&rd); - FD_ZERO(&wt); - FD_ZERO(&ex); - - ready = 0; + ready = 0; for (pd = pds, epd = pd + npds; pd < epd; pd++) { PRInt16 in_flags_read = 0, in_flags_write = 0; @@ -95,19 +105,17 @@ PRInt32 _PR_MD_PR_POLL( if (pd->in_flags & PR_POLL_READ) { in_flags_read = (pd->fd->methods->poll)( - pd->fd, (PRInt16)(pd->in_flags & ~PR_POLL_WRITE), - &out_flags_read); + pd->fd, pd->in_flags & ~PR_POLL_WRITE, &out_flags_read); } if (pd->in_flags & PR_POLL_WRITE) { in_flags_write = (pd->fd->methods->poll)( - pd->fd, (PRInt16)(pd->in_flags & ~PR_POLL_READ), - &out_flags_write); + pd->fd, pd->in_flags & ~PR_POLL_READ, &out_flags_write); } - if ((0 != (in_flags_read & out_flags_read)) - || (0 != (in_flags_write & out_flags_write))) + if ((0 != (in_flags_read & out_flags_read)) || + (0 != (in_flags_write & out_flags_write))) { - /* this one's ready right now (buffered input) */ + /* this one's ready right now */ if (0 == ready) { /* @@ -128,37 +136,67 @@ PRInt32 _PR_MD_PR_POLL( else { pd->out_flags = 0; /* pre-condition */ + /* make sure this is an NSPR supported stack */ bottom = PR_GetIdentitiesLayer(pd->fd, PR_NSPR_IO_LAYER); PR_ASSERT(NULL != bottom); /* what to do about that? */ - if ((NULL != bottom) - && (_PR_FILEDESC_OPEN == bottom->secret->state)) + if ((NULL != bottom) && + (_PR_FILEDESC_OPEN == bottom->secret->state)) { if (0 == ready) { - osfd = bottom->secret->md.osfd; - if (osfd > maxfd) maxfd = osfd; + PRInt32 osfd = bottom->secret->md.osfd; + if (osfd > maxfd) + maxfd = osfd; if (in_flags_read & PR_POLL_READ) { pd->out_flags |= _PR_POLL_READ_SYS_READ; +#ifdef BSD_SELECT FD_SET(osfd, &rd); +#else + socks[rd] = osfd; + rd++; +#endif } if (in_flags_read & PR_POLL_WRITE) { pd->out_flags |= _PR_POLL_READ_SYS_WRITE; +#ifdef BSD_SELECT FD_SET(osfd, &wt); +#else + socks[npds+wt] = osfd; + wt++; +#endif } if (in_flags_write & PR_POLL_READ) { pd->out_flags |= _PR_POLL_WRITE_SYS_READ; +#ifdef BSD_SELECT FD_SET(osfd, &rd); +#else + socks[rd] = osfd; + rd++; +#endif } if (in_flags_write & PR_POLL_WRITE) { pd->out_flags |= _PR_POLL_WRITE_SYS_WRITE; +#ifdef BSD_SELECT FD_SET(osfd, &wt); +#else + socks[npds+wt] = osfd; + wt++; +#endif + } + if (pd->in_flags & PR_POLL_EXCEPT) + { +#ifdef BSD_SELECT + FD_SET(osfd, &ex); +#else + socks[npds*2+ex] = osfd; + ex++; +#endif } - if (pd->in_flags & PR_POLL_EXCEPT) FD_SET(osfd, &ex); } } else @@ -178,9 +216,19 @@ PRInt32 _PR_MD_PR_POLL( } } - if (0 != ready) return ready; /* no need to block */ + if (0 != ready) + { +#ifndef BSD_SELECT + free(socks); +#endif + return ready; /* no need to block */ + } + + remaining = timeout; + start = PR_IntervalNow(); retry: +#ifdef BSD_SELECT if (timeout != PR_INTERVAL_NO_TIMEOUT) { PRInt32 ticksPerSecond = PR_TicksPerSecond(); @@ -191,21 +239,50 @@ retry: } ready = _MD_SELECT(maxfd + 1, &rd, &wt, &ex, tvp); - if (ready == -1 && errno == EINTR) +#else + switch (timeout) + { + case PR_INTERVAL_NO_WAIT: + msecs = 0; + break; + case PR_INTERVAL_NO_TIMEOUT: + msecs = -1; + break; + default: + msecs = PR_IntervalToMilliseconds(remaining); + } + + /* compact array */ + for( i = rd, j = npds; j < npds+wt; i++,j++ ) + socks[i] = socks[j]; + for( i = rd+wt, j = npds*2; j < npds*2+ex; i++,j++ ) + socks[i] = socks[j]; + + ready = _MD_SELECT(socks, rd, wt, ex, msecs); +#endif + + if (ready == -1 && errno == SOCEINTR) { - if (timeout == PR_INTERVAL_NO_TIMEOUT) goto retry; - else + if (timeout == PR_INTERVAL_NO_TIMEOUT) + goto retry; + else { - elapsed = (PRIntervalTime) (PR_IntervalNow() - start); - if (elapsed > timeout) ready = 0; /* timed out */ - else + elapsed = (PRIntervalTime) (PR_IntervalNow() - start); + if (elapsed > timeout) + ready = 0; /* timed out */ + else { - remaining = timeout - elapsed; - goto retry; + remaining = timeout - elapsed; + goto retry; } - } + } } + /* + ** Now to unravel the select sets back into the client's poll + ** descriptor list. Is this possibly an area for pissing away + ** a few cycles or what? + */ if (ready > 0) { ready = 0; @@ -214,26 +291,44 @@ retry: PRInt16 out_flags = 0; if ((NULL != pd->fd) && (0 != pd->in_flags)) { + PRInt32 osfd; bottom = PR_GetIdentitiesLayer(pd->fd, PR_NSPR_IO_LAYER); PR_ASSERT(NULL != bottom); osfd = bottom->secret->md.osfd; +#ifdef BSD_SELECT if (FD_ISSET(osfd, &rd)) +#else + if( IsSocketSet(osfd, socks, 0, rd) ) +#endif { if (pd->out_flags & _PR_POLL_READ_SYS_READ) out_flags |= PR_POLL_READ; if (pd->out_flags & _PR_POLL_WRITE_SYS_READ) out_flags |= PR_POLL_WRITE; - } + } + +#ifdef BSD_SELECT if (FD_ISSET(osfd, &wt)) +#else + if( IsSocketSet(osfd, socks, rd, wt) ) +#endif { if (pd->out_flags & _PR_POLL_READ_SYS_WRITE) out_flags |= PR_POLL_READ; if (pd->out_flags & _PR_POLL_WRITE_SYS_WRITE) out_flags |= PR_POLL_WRITE; + } + +#ifdef BSD_SELECT + if (FD_ISSET(osfd, &ex)) +#else + if( IsSocketSet(osfd, socks, rd+wt, ex) ) +#endif + { + out_flags |= PR_POLL_EXCEPT; } - if (FD_ISSET(osfd, &ex)) out_flags |= PR_POLL_EXCEPT; } pd->out_flags = out_flags; if (out_flags) ready++; @@ -242,39 +337,42 @@ retry: } else if (ready < 0) { - err = _MD_ERRNO(); - if (err == EBADF) + err = _MD_ERRNO(); + if (err == EBADF) { - /* Find the bad fds */ - ready = 0; - for (pd = pds, epd = pd + npds; pd < epd; pd++) + /* Find the bad fds */ + int optval; + int optlen = sizeof(optval); + ready = 0; + for (pd = pds, epd = pd + npds; pd < epd; pd++) { - int optval; - int optlen = sizeof(optval); - pd->out_flags = 0; - if ((NULL == pd->fd) || (pd->in_flags == 0)) continue; - bottom = PR_GetIdentitiesLayer(pd->fd, PR_NSPR_IO_LAYER); - if (getsockopt(bottom->secret->md.osfd, SOL_SOCKET, - SO_TYPE, (char *) &optval, &optlen) == -1) + pd->out_flags = 0; + if ((NULL != pd->fd) && (0 != pd->in_flags)) { - PR_ASSERT(_MD_ERRNO() == ENOTSOCK); - if (_MD_ERRNO() == ENOTSOCK) + bottom = PR_GetIdentitiesLayer(pd->fd, PR_NSPR_IO_LAYER); + if (getsockopt(bottom->secret->md.osfd, SOL_SOCKET, + SO_TYPE, (char *) &optval, &optlen) == -1) { - pd->out_flags = PR_POLL_NVAL; - ready++; + PR_ASSERT(sock_errno() == SOCENOTSOCK); + if (sock_errno() == SOCENOTSOCK) + { + pd->out_flags = PR_POLL_NVAL; + ready++; + } } } - } - PR_ASSERT(ready > 0); - } - else - { - PR_ASSERT(err != EINTR); /* should have been handled above */ - _PR_MD_MAP_SELECT_ERROR(err); + } + PR_ASSERT(ready > 0); } - } - return ready; - } + else + _PR_MD_MAP_SELECT_ERROR(err); + } + +#ifndef BSD_SELECT + free(socks); +#endif + return ready; +} #ifdef XP_OS2_EMX HMTX thread_select_mutex = 0; /* because EMX's select is not thread safe - duh! */ diff --git a/pr/src/md/os2/os2sock.c b/pr/src/md/os2/os2sock.c index 529e0e5a..ecdb31ff 100644 --- a/pr/src/md/os2/os2sock.c +++ b/pr/src/md/os2/os2sock.c @@ -46,9 +46,13 @@ #include "primpl.h" #ifdef XP_OS2_EMX - #include /* For timeval. */ + #include /* For timeval. */ #endif +#define _PR_INTERRUPT_CHECK_INTERVAL_SECS 5 +#define READ_FD 1 +#define WRITE_FD 2 + void _PR_MD_INIT_IO() { @@ -59,34 +63,19 @@ _PR_MD_INIT_IO() PRInt32 -_PR_MD_SOCKET(int af, int type, int flags) +_PR_MD_SOCKET(int domain, int type, int flags) { - int sock; - PRUint32 one = 1; - PRInt32 rv; - PRInt32 err; + PRInt32 osfd, err; - sock = socket(af, type, flags); - - if (sock == -1 ) - { - int rv = sock_errno(); - soclose(sock); - _PR_MD_MAP_SOCKET_ERROR(rv); - return (PRInt32) -1; - } + osfd = socket(domain, type, flags); - /* - ** Make the socket Non-Blocking - */ - rv = ioctl( sock, FIONBIO, (char *) &one, sizeof(one)); - if ( rv != 0 ) + if (osfd == -1) { err = sock_errno(); - return -1; + _PR_MD_MAP_SOCKET_ERROR(err); } - return (PRInt32)sock; + return(osfd); } /* @@ -96,12 +85,13 @@ _PR_MD_SOCKET(int af, int type, int flags) PRInt32 _MD_CloseSocket(PRInt32 osfd) { - PRInt32 rv = -1; - - rv = soclose((int) osfd ); - if (rv < 0) - _PR_MD_MAP_SOCKET_ERROR(sock_errno()); + PRInt32 rv, err; + rv = soclose(osfd); + if (rv == -1) { + err = sock_errno(); + _PR_MD_MAP_CLOSE_ERROR(err); + } return rv; } @@ -117,256 +107,276 @@ _MD_SocketAvailable(PRFileDesc *fd) return result; } -PRInt32 -_MD_Accept(PRFileDesc *fd, PRNetAddr *raddr, PRUint32 *rlen, - PRIntervalTime timeout ) +static PRInt32 +socket_io_wait( PRInt32 osfd, PRInt32 fd_type, PRIntervalTime timeout ) { - PRInt32 osfd = fd->secret->md.osfd; - PRInt32 rv, err; + PRInt32 rv = -1; + PRThread *me = _PR_MD_CURRENT_THREAD(); + PRIntervalTime epoch, now, elapsed, remaining; + PRBool wait_for_remaining; + PRInt32 syserror; #ifdef BSD_SELECT - fd_set rd; - struct timeval tv, *tvp; - - FD_ZERO(&rd); - FD_SET(osfd, &rd); + struct timeval tv; + fd_set rd_wr; #else int socks[1]; - socks[0] = osfd; + long lTimeout; #endif - if (timeout == PR_INTERVAL_NO_TIMEOUT) - { - while ((rv = accept(osfd, (struct sockaddr *) raddr, (int *) rlen)) == -1) - { - if (((err = sock_errno()) == EWOULDBLOCK) - && (!fd->secret->nonblocking)) - { + + switch (timeout) { + case PR_INTERVAL_NO_WAIT: + PR_SetError(PR_IO_TIMEOUT_ERROR, 0); + break; + case PR_INTERVAL_NO_TIMEOUT: + /* + * This is a special case of the 'default' case below. + * Please see the comments there. + */ #ifdef BSD_SELECT - if ((rv = _MD_SELECT(osfd + 1, &rd, NULL, NULL,NULL)) == -1) { + tv.tv_sec = _PR_INTERRUPT_CHECK_INTERVAL_SECS; + tv.tv_usec = 0; + FD_ZERO(&rd_wr); + do { + FD_SET(osfd, &rd_wr); + if (fd_type == READ_FD) + rv = _MD_SELECT(osfd + 1, &rd_wr, NULL, NULL, &tv); + else + rv = _MD_SELECT(osfd + 1, NULL, &rd_wr, NULL, &tv); #else - if ((rv = _MD_SELECT(socks, 1, 0, 0, -1)) == -1) { -#endif - _PR_MD_MAP_SELECT_ERROR(sock_errno()); + lTimeout = _PR_INTERRUPT_CHECK_INTERVAL_SECS * 1000; + do { + socks[0] = osfd; + if (fd_type == READ_FD) + rv = _MD_SELECT(socks, 1, 0, 0, lTimeout); + else + rv = _MD_SELECT(socks, 0, 1, 0, lTimeout); +#endif + if (rv == -1 && (syserror = sock_errno()) != SOCEINTR) { + _PR_MD_MAP_SELECT_ERROR(syserror); break; - } - } - else { - _PR_MD_MAP_ACCEPT_ERROR(err); - break; - } - } - return(rv); - } - else if (timeout == PR_INTERVAL_NO_WAIT) - { - if ((rv = accept(osfd, (struct sockaddr *) raddr, (int *) rlen)) == -1) - { - if (((err = sock_errno()) == EWOULDBLOCK) - && (!fd->secret->nonblocking)) - { - PR_SetError(PR_IO_TIMEOUT_ERROR, 0); - } - else - { - _PR_MD_MAP_ACCEPT_ERROR(err); - } - } - return(rv); - } - else - { -retry: - if ((rv = accept(osfd, (struct sockaddr *) raddr, (int *) rlen)) == -1) - { - if (((err = sock_errno()) == EWOULDBLOCK) - && (!fd->secret->nonblocking)) - { + } + if (_PR_PENDING_INTERRUPT(me)) { + me->flags &= ~_PR_INTERRUPT; + PR_SetError(PR_PENDING_INTERRUPT_ERROR, 0); + rv = -1; + break; + } + } while (rv == 0 || (rv == -1 && syserror == EINTR)); + break; + default: + now = epoch = PR_IntervalNow(); + remaining = timeout; #ifdef BSD_SELECT - tv.tv_sec = PR_IntervalToSeconds(timeout); - tv.tv_usec = PR_IntervalToMicroseconds(timeout - PR_SecondsToInterval(tv.tv_sec)); - tvp = &tv; - rv = _MD_SELECT(osfd + 1, &rd, NULL, NULL, tvp); + FD_ZERO(&rd_wr); +#endif + do { + /* + * We block in _MD_SELECT for at most + * _PR_INTERRUPT_CHECK_INTERVAL_SECS seconds, + * so that there is an upper limit on the delay + * before the interrupt bit is checked. + */ +#ifdef BSD_SELECT + wait_for_remaining = PR_TRUE; + tv.tv_sec = PR_IntervalToSeconds(remaining); + if (tv.tv_sec > _PR_INTERRUPT_CHECK_INTERVAL_SECS) { + wait_for_remaining = PR_FALSE; + tv.tv_sec = _PR_INTERRUPT_CHECK_INTERVAL_SECS; + tv.tv_usec = 0; + } else { + tv.tv_usec = PR_IntervalToMicroseconds( + remaining - + PR_SecondsToInterval(tv.tv_sec)); + } + FD_SET(osfd, &rd_wr); + if (fd_type == READ_FD) + rv = _MD_SELECT(osfd + 1, &rd_wr, NULL, NULL, &tv); + else + rv = _MD_SELECT(osfd + 1, NULL, &rd_wr, NULL, &tv); #else - long lTimeout = PR_IntervalToMilliseconds(timeout); - rv = _MD_SELECT(socks, 1, 0, 0, lTimeout); + wait_for_remaining = PR_TRUE; + lTimeout = PR_IntervalToMilliseconds(remaining); + if (lTimeout > _PR_INTERRUPT_CHECK_INTERVAL_SECS * 1000) { + wait_for_remaining = PR_FALSE; + lTimeout = _PR_INTERRUPT_CHECK_INTERVAL_SECS * 1000; + } + socks[0] = osfd; + if (fd_type == READ_FD) + rv = _MD_SELECT(socks, 1, 0, 0, lTimeout); + else + rv = _MD_SELECT(socks, 0, 1, 0, lTimeout); #endif - if (rv > 0) { - goto retry; - } - else if (rv == 0) - { - PR_SetError(PR_IO_TIMEOUT_ERROR, 0); + /* + * we don't consider EINTR a real error + */ + if (rv == -1 && (syserror = sock_errno()) != SOCEINTR) { + _PR_MD_MAP_SELECT_ERROR(syserror); + break; + } + if (_PR_PENDING_INTERRUPT(me)) { + me->flags &= ~_PR_INTERRUPT; + PR_SetError(PR_PENDING_INTERRUPT_ERROR, 0); rv = -1; - } else { - _PR_MD_MAP_SELECT_ERROR(sock_errno()); + break; } - } else { - _PR_MD_MAP_ACCEPT_ERROR(err); - } + /* + * We loop again if _MD_SELECT timed out or got interrupted + * by a signal, and the timeout deadline has not passed yet. + */ + if (rv == 0 || (rv == -1 && syserror == SOCEINTR)) { + /* + * If _MD_SELECT timed out, we know how much time + * we spent in blocking, so we can avoid a + * PR_IntervalNow() call. + */ + if (rv == 0) { + if (wait_for_remaining) { + now += remaining; + } else { +#ifdef BSD_SELECT + now += PR_SecondsToInterval(tv.tv_sec) + + PR_MicrosecondsToInterval(tv.tv_usec); +#else + now += PR_MillisecondsToInterval(lTimeout); +#endif + } + } else { + now = PR_IntervalNow(); + } + elapsed = (PRIntervalTime) (now - epoch); + if (elapsed >= timeout) { + PR_SetError(PR_IO_TIMEOUT_ERROR, 0); + rv = -1; + break; + } else { + remaining = timeout - elapsed; + } + } + } while (rv == 0 || (rv == -1 && syserror == SOCEINTR)); + break; } - } return(rv); -} /* end _MD_Accept() */ +} +PRInt32 +_MD_Accept(PRFileDesc *fd, PRNetAddr *addr, + PRUint32 *addrlen, PRIntervalTime timeout) +{ + PRInt32 osfd = fd->secret->md.osfd; + PRInt32 rv, err; + PRThread *me = _PR_MD_CURRENT_THREAD(); + while ((rv = accept(osfd, (struct sockaddr*) addr, (int*)addrlen)) == -1) + { + err = sock_errno(); + if ((err == SOCEWOULDBLOCK) || (err == SOCECONNABORTED)) + { + if (fd->secret->nonblocking) { + break; + } + if ((rv = socket_io_wait(osfd, READ_FD, timeout)) < 0) + goto done; + } else if ((err == SOCEINTR) && (!_PR_PENDING_INTERRUPT(me))){ + continue; + } else { + break; + } + } + if (rv < 0) { + _PR_MD_MAP_ACCEPT_ERROR(err); + } +done: + return(rv); +} PRInt32 _PR_MD_CONNECT(PRFileDesc *fd, const PRNetAddr *addr, PRUint32 addrlen, PRIntervalTime timeout) { + PRInt32 rv, err; + PRThread *me = _PR_MD_CURRENT_THREAD(); PRInt32 osfd = fd->secret->md.osfd; - PRInt32 rv; - int err, len; -#ifdef BSD_SELECT -#ifdef XP_OS2//_VACPP - fd_set wd; -#else - fd_set wd, ex; -#endif #vacpp - struct timeval tv, *tvp; -#else - int socks[1]; - long lTimeout = -1; -#endif - if ((rv = connect(osfd, (struct sockaddr *) addr, addrlen)) == -1) + /* + * We initiate the connection setup by making a nonblocking connect() + * call. If the connect() call fails, there are two cases we handle + * specially: + * 1. The connect() call was interrupted by a signal. In this case + * we simply retry connect(). + * 2. The NSPR socket is nonblocking and connect() fails with + * EINPROGRESS. We first wait until the socket becomes writable. + * Then we try to find out whether the connection setup succeeded + * or failed. + */ + +retry: + if ((rv = connect(osfd, (struct sockaddr *)addr, addrlen)) == -1) { err = sock_errno(); - if ((!fd->secret->nonblocking) && ((err == EINPROGRESS) || (err == EWOULDBLOCK))) - { -#ifdef BSD_SELECT - if (timeout == PR_INTERVAL_NO_TIMEOUT) - tvp = NULL; - else - { - tv.tv_sec = PR_IntervalToSeconds(timeout); - tv.tv_usec = PR_IntervalToMicroseconds(timeout - PR_SecondsToInterval(tv.tv_sec)); - tvp = &tv; + + if (err == SOCEINTR) { + if (_PR_PENDING_INTERRUPT(me)) { + me->flags &= ~_PR_INTERRUPT; + PR_SetError( PR_PENDING_INTERRUPT_ERROR, 0); + return -1; } + goto retry; + } - FD_ZERO(&wd); - FD_SET(osfd, &wd); -#ifdef XP_OS2//_VACPP - rv = _MD_SELECT(osfd + 1, NULL, &wd, NULL, tvp); -#else - FD_ZERO(&ex); - FD_SET(osfd, &ex); - rv = _MD_SELECT(osfd + 1, NULL, &wd, &ex, tvp); -#endif #vacpp -#else #!bsd_select - if (timeout == PR_INTERVAL_NO_TIMEOUT) - lTimeout = -1; - else - { - lTimeout = PR_IntervalToMilliseconds(timeout); + if (!fd->secret->nonblocking && (err == SOCEINPROGRESS)) + { + /* + * socket_io_wait() may return -1 or 1. + */ + + rv = socket_io_wait(osfd, WRITE_FD, timeout); + if (rv == -1) { + return -1; } - - socks[0] = osfd; -#ifdef XP_OS2//_VACPP - rv = _MD_SELECT(socks, 0, 1, 0, lTimeout); -#else - rv = _MD_SELECT(socks, 0, 1, 1, lTimeout); -#endif #vacpp -#endif - if (rv > 0) - { -#ifdef BSD_SELECT -#ifdef XP_OS2//_VACPP - if (FD_ISSET(osfd, &wd)) - { - //DosSleep(0); - len = sizeof(err); - if (getsockopt(osfd, SOL_SOCKET, SO_ERROR, - (char *) &err, &len) < 0) - { - _PR_MD_MAP_GETSOCKOPT_ERROR(sock_errno()); - return -1; - } - if (err != 0) - { - _PR_MD_MAP_CONNECT_ERROR(err); - return -1; - } - else - return 0; /* it's connected */ - } - else - return -1; -#else - if (FD_ISSET(osfd, &ex)) - { - DosSleep(0); - len = sizeof(err); - if (getsockopt(osfd, SOL_SOCKET, SO_ERROR, - (char *) &err, &len) < 0) - { - _PR_MD_MAP_GETSOCKOPT_ERROR(sock_errno()); - return -1; - } - if (err != 0) - _PR_MD_MAP_CONNECT_ERROR(err); - else - PR_SetError(PR_UNKNOWN_ERROR, 0); - return -1; - } - if (FD_ISSET(osfd, &wd)) - { - /* it's connected */ - return 0; - } -#endif #vacpp -#else #!bsd_select - if (socks[0] == osfd) - { - len = sizeof(err); - if (getsockopt(osfd, SOL_SOCKET, SO_ERROR, - (char *) &err, &len) < 0) - { - _PR_MD_MAP_GETSOCKOPT_ERROR(sock_errno()); - return -1; - } - - if (err != 0) - { - _PR_MD_MAP_CONNECT_ERROR(err); - return -1; - } - else - return 0; /* it's connected */ - } - else - return -1; -#endif + PR_ASSERT(rv == 1); + if (_PR_PENDING_INTERRUPT(me)) { + me->flags &= ~_PR_INTERRUPT; + PR_SetError( PR_PENDING_INTERRUPT_ERROR, 0); + return -1; } - else if (rv == 0) - { - PR_SetError(PR_IO_TIMEOUT_ERROR, 0); - return(-1); - } else if (rv < 0) - { - _PR_MD_MAP_SELECT_ERROR(sock_errno()); - return(-1); + err = _MD_os2_get_nonblocking_connect_error(osfd); + if (err != 0) { + _PR_MD_MAP_CONNECT_ERROR(err); + return -1; } - } + return 0; + } + _PR_MD_MAP_CONNECT_ERROR(err); } - return rv; -} + return rv; +} /* _MD_connect */ PRInt32 _PR_MD_BIND(PRFileDesc *fd, const PRNetAddr *addr, PRUint32 addrlen) { - PRInt32 rv; - - rv = bind(fd->secret->md.osfd, (struct sockaddr*) &(addr->inet), addrlen); + PRInt32 rv, err; + rv = bind(fd->secret->md.osfd, (struct sockaddr *) addr, (int )addrlen); + if (rv < 0) { + err = sock_errno(); + _PR_MD_MAP_BIND_ERROR(err); + } + return(rv); +} - if (rv == -1) { - _PR_MD_MAP_BIND_ERROR(sock_errno()); - return -1; - } - return 0; +PRInt32 +_PR_MD_LISTEN(PRFileDesc *fd, PRIntn backlog) +{ + PRInt32 rv, err; + rv = listen(fd->secret->md.osfd, backlog); + if (rv < 0) { + err = sock_errno(); + _PR_MD_MAP_DEFAULT_ERROR(err); + } + return(rv); } @@ -376,70 +386,27 @@ _PR_MD_RECV(PRFileDesc *fd, void *buf, PRInt32 amount, PRIntn flags, { PRInt32 osfd = fd->secret->md.osfd; PRInt32 rv, err; -#ifdef BSD_SELECT - struct timeval tv, *tvp; - fd_set rd; -#else - int socks[1]; - long lTimeout = -1; -#endif - int osflags; + PRThread *me = _PR_MD_CURRENT_THREAD(); - if (0 == flags) { - osflags = 0; - } else { - PR_ASSERT(PR_MSG_PEEK == flags); - osflags = MSG_PEEK; - } - while ((rv = recv( osfd, buf, amount, osflags)) == -1) + while ((rv = recv(osfd,buf,amount,flags)) == -1) { - if (((err = sock_errno()) == EWOULDBLOCK) - && (!fd->secret->nonblocking)) - { -#ifdef BSD_SELECT - FD_ZERO(&rd); - FD_SET(osfd, &rd); - if (timeout == PR_INTERVAL_NO_TIMEOUT) - { - tvp = NULL; - } - else - { - tv.tv_sec = PR_IntervalToSeconds(timeout); - tv.tv_usec = PR_IntervalToMicroseconds( - timeout - PR_SecondsToInterval(tv.tv_sec)); - tvp = &tv; - } - if ((rv = _MD_SELECT(osfd + 1, &rd, NULL, NULL, tvp)) == -1) -#else - socks[0] = osfd; - if (timeout == PR_INTERVAL_NO_TIMEOUT) - { - lTimeout = -1; - } - else - { - lTimeout = PR_IntervalToMilliseconds(timeout); - } - if ((rv = _MD_SELECT(socks, 1, 0, 0, lTimeout)) == -1) -#endif - { - _PR_MD_MAP_SELECT_ERROR(sock_errno()); - return -1; - } - else if (rv == 0) - { - PR_SetError(PR_IO_TIMEOUT_ERROR, 0); - rv = -1; + err = sock_errno(); + if ((err == SOCEWOULDBLOCK)) { + if (fd->secret->nonblocking) { break; } - } - else - { - _PR_MD_MAP_RECV_ERROR(err); + if ((rv = socket_io_wait(osfd, READ_FD, timeout)) < 0) + goto done; + } else if ((err == SOCEINTR) && (!_PR_PENDING_INTERRUPT(me))){ + continue; + } else { break; } - } /* end while() */ + } + if (rv < 0) { + _PR_MD_MAP_RECV_ERROR(err); + } +done: return(rv); } @@ -449,108 +416,42 @@ _PR_MD_SEND(PRFileDesc *fd, const void *buf, PRInt32 amount, PRIntn flags, { PRInt32 osfd = fd->secret->md.osfd; PRInt32 rv, err; -#ifdef BSD_SELECT - struct timeval tv, *tvp; - fd_set wd; -#else - int socks[1]; - long lTimeout = -1; -#endif - PRInt32 bytesSent = 0; + PRThread *me = _PR_MD_CURRENT_THREAD(); - while(bytesSent < amount ) + while ((rv = send(osfd,buf,amount,flags)) == -1) { - while ((rv = send( osfd, (char *) buf, amount, 0 )) == -1) - { - if (((err = sock_errno()) == EWOULDBLOCK) - && (!fd->secret->nonblocking)) - { -#ifdef BSD_SELECT - if ( timeout == PR_INTERVAL_NO_TIMEOUT ) - { - tvp = NULL; - } - else - { - tv.tv_sec = PR_IntervalToSeconds(timeout); - tv.tv_usec = PR_IntervalToMicroseconds( - timeout - PR_SecondsToInterval(tv.tv_sec)); - tvp = &tv; - } - FD_ZERO(&wd); - FD_SET(osfd, &wd); - if ((rv = _MD_SELECT( osfd + 1, NULL, &wd, NULL,tvp)) == -1) { -#else - if ( timeout == PR_INTERVAL_NO_TIMEOUT ) - { - lTimeout = -1; - } - else - { - lTimeout = PR_IntervalToMilliseconds(timeout); - } - socks[0] = osfd; - if ((rv = _MD_SELECT( socks, 0, 1, 0, lTimeout)) == -1) { -#endif - _PR_MD_MAP_SELECT_ERROR(sock_errno()); - break; - } - if (rv == 0) - { - PR_SetError(PR_IO_TIMEOUT_ERROR, 0); - return -1; - } - } - else { - _PR_MD_MAP_SEND_ERROR(err); - return -1; + err = sock_errno(); + if ((err == SOCEWOULDBLOCK)) { + if (fd->secret->nonblocking) { + break; } - } - bytesSent += rv; - if (fd->secret->nonblocking) - { + if ((rv = socket_io_wait(osfd, WRITE_FD, timeout)) < 0) + goto done; + } else if ((err == SOCEINTR) && (!_PR_PENDING_INTERRUPT(me))){ + continue; + } else { break; } - if ((rv >= 0) && (bytesSent < amount )) - { -#ifdef BSD_SELECT - if ( timeout == PR_INTERVAL_NO_TIMEOUT ) - { - tvp = NULL; - } - else - { - tv.tv_sec = PR_IntervalToSeconds(timeout); - tv.tv_usec = PR_IntervalToMicroseconds( - timeout - PR_SecondsToInterval(tv.tv_sec)); - tvp = &tv; - } - FD_ZERO(&wd); - FD_SET(osfd, &wd); - if ((rv = _MD_SELECT(osfd + 1, NULL, &wd, NULL,tvp)) == -1) { -#else - if ( timeout == PR_INTERVAL_NO_TIMEOUT ) - { - lTimeout = -1; - } - else - { - lTimeout = PR_IntervalToMilliseconds(timeout); - } - socks[0] = osfd; - if ((rv = _MD_SELECT(socks, 0, 1, 0,lTimeout)) == -1) { -#endif - _PR_MD_MAP_SELECT_ERROR(sock_errno()); - break; - } - if (rv == 0) - { - PR_SetError(PR_IO_TIMEOUT_ERROR, 0); - return -1; - } + } + + /* + * optimization; if bytes sent is less than "amount" call + * select before returning. This is because it is likely that + * the next send() call will return EWOULDBLOCK. + */ + if ((!fd->secret->nonblocking) && (rv > 0) && (rv < amount) + && (timeout != PR_INTERVAL_NO_WAIT)) + { + if (socket_io_wait(osfd, WRITE_FD, timeout)< 0) { + rv = -1; + goto done; } } - return bytesSent; + if (rv < 0) { + _PR_MD_MAP_SEND_ERROR(err); + } +done: + return(rv); } PRInt32 @@ -559,109 +460,29 @@ _PR_MD_SENDTO(PRFileDesc *fd, const void *buf, PRInt32 amount, PRIntn flags, { PRInt32 osfd = fd->secret->md.osfd; PRInt32 rv, err; - PRInt32 bytesSent = 0; -#ifdef BSD_SELECT - struct timeval tv, *tvp; - fd_set wd; -#else - int socks[1]; - long lTimeout = -1; -#endif - - while(bytesSent < amount) + PRThread *me = _PR_MD_CURRENT_THREAD(); + while ((rv = sendto(osfd, buf, amount, flags, + (struct sockaddr *) addr, addrlen)) == -1) { - while ((rv = sendto( osfd, (char *) buf, amount, 0, (struct sockaddr *) addr, - addrlen)) == -1) - { - if (((err = sock_errno()) == EWOULDBLOCK) - && (!fd->secret->nonblocking)) - { -#ifdef BSD_SELECT - if ( timeout == PR_INTERVAL_NO_TIMEOUT ) - { - tvp = NULL; - } - else - { - tv.tv_sec = PR_IntervalToSeconds(timeout); - tv.tv_usec = PR_IntervalToMicroseconds( - timeout - PR_SecondsToInterval(tv.tv_sec)); - tvp = &tv; - } - FD_ZERO(&wd); - FD_SET(osfd, &wd); - if ((rv = _MD_SELECT(osfd + 1, NULL, &wd, NULL, tvp)) == -1) { -#else - if ( timeout == PR_INTERVAL_NO_TIMEOUT ) - { - lTimeout = -1; - } - else - { - lTimeout = PR_IntervalToMilliseconds(timeout); - } - socks[0] = osfd; - if ((rv = _MD_SELECT(socks, 0, 1, 0, lTimeout)) == -1) { -#endif - _PR_MD_MAP_SELECT_ERROR(sock_errno()); - break; - } - if (rv == 0) - { - PR_SetError(PR_IO_TIMEOUT_ERROR, 0); - return -1; - } - } - else { - _PR_MD_MAP_SENDTO_ERROR(err); - return -1; - } - } - bytesSent += rv; - if (fd->secret->nonblocking) - { - break; - } - if ((rv >= 0) && (bytesSent < amount )) + err = sock_errno(); + if ((err == SOCEWOULDBLOCK)) { -#ifdef BSD_SELECT - if ( timeout == PR_INTERVAL_NO_TIMEOUT ) - { - tvp = NULL; - } - else - { - tv.tv_sec = PR_IntervalToSeconds(timeout); - tv.tv_usec = PR_IntervalToMicroseconds( - timeout - PR_SecondsToInterval(tv.tv_sec)); - tvp = &tv; - } - FD_ZERO(&wd); - FD_SET(osfd, &wd); - if ((rv = _MD_SELECT( osfd + 1, NULL, &wd, NULL, tvp)) == -1) { -#else - if ( timeout == PR_INTERVAL_NO_TIMEOUT ) - { - lTimeout = -1; - } - else - { - lTimeout = PR_IntervalToMilliseconds(timeout); - } - socks[0] = osfd; - if ((rv = _MD_SELECT( socks, 0, 1, 0, lTimeout)) == -1) { -#endif - _PR_MD_MAP_SELECT_ERROR(sock_errno()); + if (fd->secret->nonblocking) { break; } - if (rv == 0) - { - PR_SetError(PR_IO_TIMEOUT_ERROR, 0); - return -1; - } + if ((rv = socket_io_wait(osfd, WRITE_FD, timeout)) < 0) + goto done; + } else if ((err == EINTR) && (!_PR_PENDING_INTERRUPT(me))){ + continue; + } else { + break; } } - return bytesSent; + if (rv < 0) { + _PR_MD_MAP_SENDTO_ERROR(err); + } +done: + return(rv); } PRInt32 @@ -670,103 +491,86 @@ _PR_MD_RECVFROM(PRFileDesc *fd, void *buf, PRInt32 amount, PRIntn flags, { PRInt32 osfd = fd->secret->md.osfd; PRInt32 rv, err; - PRUint32 addrlen_temp = *addrlen; -#ifdef BSD_SELECT - struct timeval tv, *tvp; - fd_set rd; -#else - int socks[1]; - long lTimeout = -1; -#endif + PRThread *me = _PR_MD_CURRENT_THREAD(); - while ((rv = recvfrom( osfd, (char *) buf, amount, 0, (struct sockaddr *) addr, - (int *) addrlen)) == -1) + while( (*addrlen = PR_NETADDR_SIZE(addr)), + ((rv = recvfrom(osfd, buf, amount, flags, + (struct sockaddr *) addr, (int *)addrlen)) == -1)) { - if (((err = sock_errno()) == EWOULDBLOCK) - && (!fd->secret->nonblocking)) - { -#ifdef BSD_SELECT - if (timeout == PR_INTERVAL_NO_TIMEOUT) - { - tvp = NULL; - } - else - { - tv.tv_sec = PR_IntervalToSeconds(timeout); - tv.tv_usec = PR_IntervalToMicroseconds( - timeout - PR_SecondsToInterval(tv.tv_sec)); - tvp = &tv; - } - FD_ZERO(&rd); - FD_SET(osfd, &rd); - if ((rv = _MD_SELECT(osfd + 1, &rd, NULL, NULL, tvp)) == -1) -#else - if (timeout == PR_INTERVAL_NO_TIMEOUT) - { - lTimeout = -1; - } - else - { - lTimeout = PR_IntervalToMilliseconds(timeout); - } - socks[0] = osfd; - if ((rv = _MD_SELECT(socks, 1, 0, 0, lTimeout)) == -1) -#endif - { - _PR_MD_MAP_SELECT_ERROR(sock_errno()); - return -1; - } else if (rv == 0) - { - PR_SetError(PR_IO_TIMEOUT_ERROR, 0); - rv = -1; + err = sock_errno(); + if ((err == SOCEWOULDBLOCK)) { + if (fd->secret->nonblocking) { break; } - - /* recvfrom blows this value away if it fails first time */ - *addrlen = addrlen_temp; - } - else - { - _PR_MD_MAP_RECVFROM_ERROR(err); + if ((rv = socket_io_wait(osfd, READ_FD, timeout)) < 0) + goto done; + } else if ((err == SOCEINTR) && (!_PR_PENDING_INTERRUPT(me))){ + continue; + } else { break; } } + if (rv < 0) { + _PR_MD_MAP_RECVFROM_ERROR(err); + } +done: return(rv); } PRInt32 -_PR_MD_WRITEV(PRFileDesc *fd, const PRIOVec *iov, PRInt32 iov_size, PRIntervalTime timeout) +_PR_MD_WRITEV(PRFileDesc *fd, const PRIOVec *iov, PRInt32 iov_size, + PRIntervalTime timeout) { - int index; - int sent = 0; - int rv; + PRInt32 rv, err; + PRThread *me = _PR_MD_CURRENT_THREAD(); + PRInt32 index, amount = 0; + PRInt32 osfd = fd->secret->md.osfd; - for (index=0; index < iov_size; index++) - { - rv = _PR_MD_SEND(fd, iov[index].iov_base, iov[index].iov_len, 0, timeout); - if (rv > 0) - sent += rv; - if ( rv != iov[index].iov_len ) - { - if (rv < 0) - { - if (fd->secret->nonblocking - && (PR_GetError() == PR_WOULD_BLOCK_ERROR) - && (sent > 0)) - { - return sent; - } - else - { - return -1; - } + /* + * Calculate the total number of bytes to be sent; needed for + * optimization later. + * We could avoid this if this number was passed in; but it is + * probably not a big deal because iov_size is usually small (less than + * 3) + */ + if (!fd->secret->nonblocking) { + for (index=0; indexsecret->nonblocking) { + break; } - /* Only a nonblocking socket can have partial sends */ - PR_ASSERT(fd->secret->nonblocking); - return sent; + if ((rv = socket_io_wait(osfd, WRITE_FD, timeout))<0) + goto done; + } else if ((err == EINTR) && (!_PR_PENDING_INTERRUPT(me))){ + continue; + } else { + break; + } + } + + /* + * optimization; if bytes sent is less than "amount" call + * select before returning. This is because it is likely that + * the next writev() call will return EWOULDBLOCK. + */ + if ((!fd->secret->nonblocking) && (rv > 0) && (rv < amount) + && (timeout != PR_INTERVAL_NO_WAIT)) { + if (socket_io_wait(osfd, WRITE_FD, timeout) < 0) { + rv = -1; + goto done; } } - return sent; + if (rv < 0) { + _PR_MD_MAP_WRITEV_ERROR(err); + } +done: + return(rv); } PRInt32 @@ -781,63 +585,77 @@ _PR_MD_SHUTDOWN(PRFileDesc *fd, PRIntn how) } PRStatus -_PR_MD_GETSOCKNAME(PRFileDesc *fd, PRNetAddr *addr, PRUint32 *len) +_PR_MD_GETSOCKNAME(PRFileDesc *fd, PRNetAddr *addr, PRUint32 *addrlen) { - PRInt32 rv; + PRInt32 rv, err; - rv = getsockname((int)fd->secret->md.osfd, (struct sockaddr *)addr, (int *) len); - if (rv==0) - return PR_SUCCESS; - else { - _PR_MD_MAP_GETSOCKNAME_ERROR(sock_errno()); - return PR_FAILURE; + rv = getsockname(fd->secret->md.osfd, + (struct sockaddr *) addr, (int *)addrlen); + if (rv < 0) { + err = sock_errno(); + _PR_MD_MAP_GETSOCKNAME_ERROR(err); } + return rv==0?PR_SUCCESS:PR_FAILURE; } PRStatus -_PR_MD_GETPEERNAME(PRFileDesc *fd, PRNetAddr *addr, PRUint32 *len) +_PR_MD_GETPEERNAME(PRFileDesc *fd, PRNetAddr *addr, PRUint32 *addrlen) { - PRInt32 rv; + PRInt32 rv, err; - rv = getpeername((int)fd->secret->md.osfd, (struct sockaddr *)addr, (int *) len); - if (rv==0) - return PR_SUCCESS; - else { - _PR_MD_MAP_GETPEERNAME_ERROR(sock_errno()); - return PR_FAILURE; + rv = getpeername(fd->secret->md.osfd, + (struct sockaddr *) addr, (int *)addrlen); + if (rv < 0) { + err = sock_errno(); + _PR_MD_MAP_GETPEERNAME_ERROR(err); } + return rv==0?PR_SUCCESS:PR_FAILURE; } PRStatus -_PR_MD_GETSOCKOPT(PRFileDesc *fd, PRInt32 level, PRInt32 optname, char* optval, PRInt32* optlen) +_PR_MD_GETSOCKOPT(PRFileDesc *fd, PRInt32 level, PRInt32 optname, + char* optval, PRInt32* optlen) { - PRInt32 rv; + PRInt32 rv, err; - rv = getsockopt((int)fd->secret->md.osfd, level, optname, optval, optlen); - if (rv==0) - return PR_SUCCESS; - else { - _PR_MD_MAP_GETSOCKOPT_ERROR(sock_errno()); - return PR_FAILURE; + rv = getsockopt(fd->secret->md.osfd, level, optname, optval, (int *)optlen); + if (rv < 0) { + err = sock_errno(); + _PR_MD_MAP_GETSOCKOPT_ERROR(err); } + return rv==0?PR_SUCCESS:PR_FAILURE; } PRStatus -_PR_MD_SETSOCKOPT(PRFileDesc *fd, PRInt32 level, PRInt32 optname, const char* optval, PRInt32 optlen) +_PR_MD_SETSOCKOPT(PRFileDesc *fd, PRInt32 level, PRInt32 optname, + const char* optval, PRInt32 optlen) { - PRInt32 rv; + PRInt32 rv, err; - rv = setsockopt((int)fd->secret->md.osfd, level, optname, (char *) optval, optlen); - if (rv==0) - return PR_SUCCESS; - else { - _PR_MD_MAP_SETSOCKOPT_ERROR(sock_errno()); - return PR_FAILURE; + rv = setsockopt(fd->secret->md.osfd, level, optname, optval, optlen); + if (rv < 0) { + err = sock_errno(); + _PR_MD_MAP_SETSOCKOPT_ERROR(err); } + return rv==0?PR_SUCCESS:PR_FAILURE; } void -_MD_MakeNonblock(PRFileDesc *f) +_MD_MakeNonblock(PRFileDesc *fd) { - return; /* do nothing! */ + PRInt32 osfd = fd->secret->md.osfd; + PRInt32 err; + PRUint32 one = 1; + + if (osfd <= 2) { + /* Don't mess around with stdin, stdout or stderr */ + return; + } + + err = ioctl( osfd, FIONBIO, (char *) &one, sizeof(one)); + if ( err != 0 ) + { + err = sock_errno(); + _PR_MD_MAP_SOCKET_ERROR(err); + } } diff --git a/pr/src/md/os2/os2thred.c b/pr/src/md/os2/os2thred.c index d64ae0b9..f05be463 100644 --- a/pr/src/md/os2/os2thred.c +++ b/pr/src/md/os2/os2thred.c @@ -127,7 +127,15 @@ _PR_MD_CREATE_THREAD(PRThread *thread, if(thread->md.handle == -1) { return PR_FAILURE; } - _PR_MD_SET_PRIORITY(&(thread->md), priority); + + /* + * On OS/2, a thread is created with a thread priority of + * THREAD_PRIORITY_NORMAL + */ + + if (priority != PR_PRIORITY_NORMAL) { + _PR_MD_SET_PRIORITY(&(thread->md), priority); + } return PR_SUCCESS; } diff --git a/pr/src/md/os2/os2vacpp.asm b/pr/src/md/os2/os2vacpp.asm index 2581323b..6b49e407 100644 --- a/pr/src/md/os2/os2vacpp.asm +++ b/pr/src/md/os2/os2vacpp.asm @@ -30,59 +30,230 @@ COMMENT | -*- Mode: asm; tab-width: 8; c-basic-offset: 4 -*- GPL. Windows uses inline assembly for their atomic functions, so we have - created an assembly file for VACPP on OS/2 + created an assembly file for VACPP on OS/2. + + This assembly file also contains an implementation of RAM semaphores. + + Notes: + The ulTIDPID element of the RAMSEM structure is overloaded in the 386 + implementation to hold the TID:PID in the lower 31 bits and the lock + bit in the high bit | + page ,132 .486P - .MODEL FLAT, OPTLINK - .STACK + ASSUME CS:FLAT, DS:FLAT, SS:FLAT, ES:FLAT, FS:FLAT + + EXTRN Dos32PostEventSem:PROC + EXTRN Dos32WaitEventSem:PROC + EXTRN Dos32ResetEventSem:PROC + +ramsem STRUC + ramsem_ulTIDPID DD ? + ramsem_hevSem DD ? + ramsem_cLocks DD ? + ramsem_cWaiting DW ? + ramsem_cPosts DW ? +ramsem ENDS + +ERROR_SEM_TIMEOUT equ 121 +ERROR_NOT_OWNER equ 288 +SEM_RELEASE_UNOWNED equ 1 +SEM_RELEASE_ALL equ 2 +TS_LOCKBIT equ 31 + + +DATA SEGMENT DWORD USE32 PUBLIC 'DATA' + + EXTRN plisCurrent:DWORD + +DATA ENDS + +CODE32 SEGMENT USE32 PUBLIC 'CODE' + + PUBLIC SemRequest486 + PUBLIC SemReleasex86 + + PUBLIC _PR_MD_ATOMIC_SET + PUBLIC _PR_MD_ATOMIC_ADD + PUBLIC _PR_MD_ATOMIC_INCREMENT + PUBLIC _PR_MD_ATOMIC_DECREMENT + +;;;--------------------------------------------------------------------------- +;;; APIRET _Optlink SemRequest(PRAMSEM pramsem, ULONG ulTimeout); +;;; +;;; Registers: +;;; EAX - packed TID:PID word +;;; ECX - address of RAMSEM structure +;;; EDX - length of timeout in milli-seconds +;;;--------------------------------------------------------------------------- + + ALIGN 10H +SemRequest486 PROC + push ebx ; Save ebx (volatile) + mov ecx, eax ; PRAMSEM must be in ecx, + ; not eax, for cmpxchg + + mov ebx, dword ptr [plisCurrent] + mov eax, dword ptr [ebx+4] ; Place thread id in high + ; word, process id in low + mov ax, word ptr [ebx] ; word + mov ebx,eax + +req486_test: + xor eax,eax + cmp (ramsem PTR [ecx]).ramsem_ulTIDPID, ebx ; If we own the sem, just + jz short req486_inc_exit ; increment the use count + + lock inc (ramsem PTR [ecx]).ramsem_cWaiting ; inc waiting flag + +; lock ; Uncomment for SMP + DB 0F0h +; cmpxchg (ramsem PTR [ecx]).ramsem_ulTIDPID, ebx +; (byte 3 is the offset of ulProcessThread into the RAMSEM structure) + DB 00Fh + DB 0B1h + DB 019h + jnz short req486_sleep + +req486_inc_exit: + lock inc (ramsem PTR [ecx]).ramsem_cLocks + +req486_exit: + pop ebx ; Restore ebx + ret + +req486_sleep: + push ecx ; Save ecx (volatile) + push edx ; Save edx (volatile) + push edx ; timeout + push (ramsem PTR [ecx]).ramsem_hevSem + call Dos32WaitEventSem + add esp, 8 + pop edx ; restore edx + pop ecx ; restore ecx + or eax, eax + jne req486_exit ; Exit, if error - .CODE + push ecx ; Save ecx (volatile) + push edx ; Save edx (volatile) + sub esp, 4 ; Use stack space for + push esp ; dummy pulPostCt + push (ramsem PTR [ecx]).ramsem_hevSem + call Dos32ResetEventSem + add esp, 12 + pop edx ; restore edx + pop ecx ; restore ecx + jmp req486_test ; Retry the semaphore + +SemRequest486 ENDP + +;;;--------------------------------------------------------------------- +;;; APIRET _Optlink SemReleasex86(PRAMSEM pramsem, ULONG flFlags); +;;; +;;; Registers: +;;; EAX - address of RAMSEM structure +;;; ECX - temporary variable +;;; EDX - flags +;;;--------------------------------------------------------------------- + + ALIGN 10H +SemReleasex86 PROC + test edx, SEM_RELEASE_UNOWNED ; If set, don't bother + jnz short rel_ownerok ; getting/checking PID/TID + + push ebx ; Save ebx (volatile) + mov ebx, dword ptr [plisCurrent] + mov ecx, dword ptr [ebx+4] ; Place thread id in high + ; word, process id in low + mov cx, word ptr [ebx] ; word + pop ebx ; Restore ebx + + sub ecx, (ramsem PTR [eax]).ramsem_ulTIDPID ; This thread the owner? + shl ecx,1 ; Don't compare top bit + jnz short rel_notowner + +rel_ownerok: + test edx, SEM_RELEASE_ALL + jnz short rel_clear + + lock dec (ramsem PTR [eax]).ramsem_cLocks + jnz short rel_exit + +rel_disown: + mov (ramsem PTR [eax]).ramsem_ulTIDPID, 0 + + lock inc (ramsem PTR [eax]).ramsem_cPosts + mov cx, (ramsem PTR [eax]).ramsem_cWaiting + cmp (ramsem PTR [eax]).ramsem_cPosts, cx + jne short rel_post + +rel_exit: + xor eax, eax + ret + +rel_clear: + lock mov (ramsem PTR [eax]).ramsem_cLocks,0 + jmp rel_disown + +rel_notowner: + mov eax, ERROR_NOT_OWNER + ret + +rel_post: + mov (ramsem PTR [eax]).ramsem_cPosts, cx + push (ramsem PTR [eax]).ramsem_hevSem + call Dos32PostEventSem + add esp,4 + xor eax,eax + ret +SemReleasex86 ENDP ;;;--------------------------------------------------------------------- ;;; PRInt32 _Optlink _PR_MD_ATOMIC_SET(PRInt32* val, PRInt32 newval) ;;;--------------------------------------------------------------------- -_PR_MD_ATOMIC_SET PROC OPTLINK EXPORT - lock xchg dword ptr [eax],edx + ALIGN 10H +_PR_MD_ATOMIC_SET proc + lock xchg dword ptr [eax],edx mov eax, edx; - ret _PR_MD_ATOMIC_SET endp ;;;--------------------------------------------------------------------- ;;; PRInt32 _Optlink _PR_MD_ATOMIC_ADD(PRInt32* ptr, PRInt32 val) ;;;--------------------------------------------------------------------- -_PR_MD_ATOMIC_ADD PROC OPTLINK EXPORT + ALIGN 10H +_PR_MD_ATOMIC_ADD proc mov ecx, edx lock xadd dword ptr [eax], edx mov eax, edx add eax, ecx - ret _PR_MD_ATOMIC_ADD endp ;;;--------------------------------------------------------------------- ;;; PRInt32 _Optlink _PR_MD_ATOMIC_INCREMENT(PRInt32* val) ;;;--------------------------------------------------------------------- -_PR_MD_ATOMIC_INCREMENT PROC OPTLINK EXPORT + ALIGN 10H +_PR_MD_ATOMIC_INCREMENT proc mov edx, 1 lock xadd dword ptr [eax], edx mov eax, edx inc eax - ret _PR_MD_ATOMIC_INCREMENT endp ;;;--------------------------------------------------------------------- ;;; PRInt32 _Optlink _PR_MD_ATOMIC_DECREMENT(PRInt32* val) ;;;--------------------------------------------------------------------- -_PR_MD_ATOMIC_DECREMENT PROC OPTLINK EXPORT + ALIGN 10H +_PR_MD_ATOMIC_DECREMENT proc mov edx, 0ffffffffh lock xadd dword ptr [eax], edx mov eax, edx dec eax - ret _PR_MD_ATOMIC_DECREMENT endp - END +CODE32 ENDS +END diff --git a/pr/src/md/unix/darwin.c b/pr/src/md/unix/darwin.c index 43988b8d..90179feb 100644 --- a/pr/src/md/unix/darwin.c +++ b/pr/src/md/unix/darwin.c @@ -103,32 +103,5 @@ _MD_CREATE_THREAD( } #endif /* ! _PR_PTHREADS */ -#if defined(_PR_PTHREADS) - -/* -** Stubs for unimplemented functions -*/ - -int pthread_condattr_init(pthread_condattr_t *attr) -{ - return 0; -} - -int pthread_kill(pthread_t thread, int sig) -{ - 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 */ - /* darwin.c */ diff --git a/pr/src/md/unix/irix.c b/pr/src/md/unix/irix.c index 7ba079f8..f3d52f01 100644 --- a/pr/src/md/unix/irix.c +++ b/pr/src/md/unix/irix.c @@ -1451,7 +1451,7 @@ void _MD_EarlyInit(void) _MD_IrixIntervalInit(); } /* _MD_EarlyInit */ -void _MD_IrixInit() +void _MD_IrixInit(void) { #if !defined(_PR_PTHREADS) struct sigaction sigact; @@ -1567,7 +1567,7 @@ static PRUint32 pr_ticks_per_second = 0; extern PRIntervalTime _PR_UNIX_GetInterval(void); extern PRIntervalTime _PR_UNIX_TicksPerSecond(void); -static void _MD_IrixIntervalInit() +static void _MD_IrixIntervalInit(void) { /* * As much as I would like, the service available through this @@ -1634,12 +1634,12 @@ static void _MD_IrixIntervalInit() } } /* _MD_IrixIntervalInit */ -PRIntervalTime _MD_IrixIntervalPerSec() +PRIntervalTime _MD_IrixIntervalPerSec(void) { return pr_ticks_per_second; } -PRIntervalTime _MD_IrixGetInterval() +PRIntervalTime _MD_IrixGetInterval(void) { if (mmem_fd != -1) { diff --git a/pr/src/md/unix/unix.c b/pr/src/md/unix/unix.c index 69153f27..704fa11a 100644 --- a/pr/src/md/unix/unix.c +++ b/pr/src/md/unix/unix.c @@ -514,6 +514,7 @@ static PRInt32 socket_io_wait(PRInt32 osfd, PRInt32 fd_type, struct timeval tv; PRThread *me = _PR_MD_CURRENT_THREAD(); PRIntervalTime epoch, now, elapsed, remaining; + PRBool wait_for_remaining; PRInt32 syserror; fd_set rd_wr; @@ -558,8 +559,10 @@ static PRInt32 socket_io_wait(PRInt32 osfd, PRInt32 fd_type, * so that there is an upper limit on the delay * before the interrupt bit is checked. */ + wait_for_remaining = PR_TRUE; tv.tv_sec = PR_IntervalToSeconds(remaining); if (tv.tv_sec > _PR_INTERRUPT_CHECK_INTERVAL_SECS) { + wait_for_remaining = PR_FALSE; tv.tv_sec = _PR_INTERRUPT_CHECK_INTERVAL_SECS; tv.tv_usec = 0; } else { @@ -596,8 +599,12 @@ static PRInt32 socket_io_wait(PRInt32 osfd, PRInt32 fd_type, * PR_IntervalNow() call. */ if (rv == 0) { - now += PR_SecondsToInterval(tv.tv_sec) - + PR_MicrosecondsToInterval(tv.tv_usec); + if (wait_for_remaining) { + now += remaining; + } else { + now += PR_SecondsToInterval(tv.tv_sec) + + PR_MicrosecondsToInterval(tv.tv_usec); + } } else { now = PR_IntervalNow(); } @@ -625,6 +632,7 @@ static PRInt32 socket_io_wait(PRInt32 osfd, PRInt32 fd_type, int msecs; PRThread *me = _PR_MD_CURRENT_THREAD(); PRIntervalTime epoch, now, elapsed, remaining; + PRBool wait_for_remaining; PRInt32 syserror; struct pollfd pfd; @@ -682,8 +690,10 @@ static PRInt32 socket_io_wait(PRInt32 osfd, PRInt32 fd_type, * so that there is an upper limit on the delay * before the interrupt bit is checked. */ + wait_for_remaining = PR_TRUE; msecs = PR_IntervalToMilliseconds(remaining); if (msecs > _PR_INTERRUPT_CHECK_INTERVAL_SECS * 1000) { + wait_for_remaining = PR_FALSE; msecs = _PR_INTERRUPT_CHECK_INTERVAL_SECS * 1000; } rv = _MD_POLL(&pfd, 1, msecs); @@ -719,7 +729,11 @@ static PRInt32 socket_io_wait(PRInt32 osfd, PRInt32 fd_type, * PR_IntervalNow() call. */ if (rv == 0) { - now += PR_MillisecondsToInterval(msecs); + if (wait_for_remaining) { + now += remaining; + } else { + now += PR_MillisecondsToInterval(msecs); + } } else { now = PR_IntervalNow(); } @@ -2713,6 +2727,28 @@ static void* _MD_Unix_mmap64( } /* _MD_Unix_mmap64 */ #endif /* defined(_PR_NO_LARGE_FILES) || defined(SOLARIS2_5) */ +#if defined(OSF1) && defined(__GNUC__) + +/* + * On OSF1 V5.0A, defines stat and fstat as + * macros when compiled under gcc, so it is rather tricky to + * take the addresses of the real functions the macros expend + * to. A simple solution is to define forwarder functions + * and take the addresses of the forwarder functions instead. + */ + +static int stat_forwarder(const char *path, struct stat *buffer) +{ + return stat(path, buffer); +} + +static int fstat_forwarder(int filedes, struct stat *buffer) +{ + return fstat(filedes, buffer); +} + +#endif + static void _PR_InitIOV(void) { #if defined(SOLARIS2_5) @@ -2757,8 +2793,13 @@ static void _PR_InitIOV(void) #elif defined(_PR_HAVE_LARGE_OFF_T) _md_iovector._open64 = open; _md_iovector._mmap64 = mmap; +#if defined(OSF1) && defined(__GNUC__) + _md_iovector._fstat64 = fstat_forwarder; + _md_iovector._stat64 = stat_forwarder; +#else _md_iovector._fstat64 = fstat; _md_iovector._stat64 = stat; +#endif _md_iovector._lseek64 = lseek; #else #error "I don't know yet" @@ -3221,9 +3262,6 @@ int _MD_unix_get_nonblocking_connect_error(int osfd) int err; _PRSockLen_t optlen = sizeof(err); - printf("_MD_unix_get_nonblocking_connect_error: " - "Assuming Large TCP/IP Stack -REVISIT- Never Tested!\n"); - if (getsockopt(osfd, SOL_SOCKET, SO_ERROR, (char *) &err, &optlen) == -1) { return errno; diff --git a/pr/src/md/unix/unix_errors.c b/pr/src/md/unix/unix_errors.c index 1ce52e68..15b423cb 100644 --- a/pr/src/md/unix/unix_errors.c +++ b/pr/src/md/unix/unix_errors.c @@ -847,3 +847,10 @@ void _MD_solaris_map_sendfile_error(int err) _MD_unix_map_default_error(err) ; } #endif /* SOLARIS */ + +#ifdef LINUX +void _MD_linux_map_sendfile_error(int err) +{ + _MD_unix_map_default_error(err) ; +} +#endif /* LINUX */ diff --git a/pr/src/md/unix/uxproces.c b/pr/src/md/unix/uxproces.c index 58b5ab8a..d469f1c4 100644 --- a/pr/src/md/unix/uxproces.c +++ b/pr/src/md/unix/uxproces.c @@ -802,7 +802,7 @@ static void pr_InstallSigchldHandler() #endif /* !defined(_PR_NATIVE_THREADS) */ -static PRStatus _MD_InitProcesses() +static PRStatus _MD_InitProcesses(void) { #if !defined(_PR_NATIVE_THREADS) int rv; diff --git a/pr/src/md/unix/uxrng.c b/pr/src/md/unix/uxrng.c index 64358289..6add3bf1 100644 --- a/pr/src/md/unix/uxrng.c +++ b/pr/src/md/unix/uxrng.c @@ -64,6 +64,18 @@ GetHighResClock(void *buf, size_t maxbytes) #elif defined(HPUX) +#ifdef __ia64 +#include + +static size_t +GetHighResClock(void *buf, size_t maxbytes) +{ + PRUint64 t; + + t = _Asm_mov_from_ar(_AREG44); + return _pr_CopyLowBits(buf, maxbytes, &t, sizeof(t)); +} +#else static size_t GetHighResClock(void *buf, size_t maxbytes) { @@ -73,6 +85,7 @@ GetHighResClock(void *buf, size_t maxbytes) cr16val = ret_cr16(); return(_pr_CopyLowBits(buf, maxbytes, &cr16val, sizeof(cr16val))); } +#endif #elif defined(OSF1) @@ -88,7 +101,11 @@ GetHighResClock(void *buf, size_t maxbytes) { unsigned long t; +#ifdef __GNUC__ + __asm__("rpcc %0" : "=r" (t)); +#else t = asm("rpcc %v0"); +#endif return _pr_CopyLowBits(buf, maxbytes, &t, sizeof(t)); } @@ -210,7 +227,7 @@ static size_t GetHighResClock(void *buf, size_t maxbuf) } iotimer_addr = (unsigned *) mmap(0, pgoffmask, PROT_READ, MAP_PRIVATE, mfd, (int)raddr); - if (iotimer_addr == (void*)-1) { + if (iotimer_addr == (unsigned*)-1) { close(mfd); iotimer_addr = NULL; return 0; diff --git a/pr/src/md/unix/uxshm.c b/pr/src/md/unix/uxshm.c index 888cbe04..81aa7487 100644 --- a/pr/src/md/unix/uxshm.c +++ b/pr/src/md/unix/uxshm.c @@ -118,7 +118,7 @@ extern PRSharedMemory * _MD_OpenSharedMemory( PR_DELETE( shm ); return( NULL ); } - if ( close(osfd == -1 )) { + if ( close(osfd) == -1 ) { _PR_MD_MAP_CLOSE_ERROR( errno ); PR_FREEIF( shm->ipcname ); PR_DELETE( shm ); @@ -243,7 +243,7 @@ extern PRStatus _MD_DeleteSharedMemory( const char *name ) _PR_MD_MAP_OPEN_ERROR( errno ); return( PR_FAILURE ); } - if ( close(osfd == -1 )) { + if ( close(osfd) == -1 ) { _PR_MD_MAP_CLOSE_ERROR( errno ); return( PR_FAILURE ); } @@ -311,7 +311,6 @@ extern PRSharedMemory * _MD_OpenSharedMemory( ) { PRStatus rc = PR_SUCCESS; - PRIntn id; PRInt32 end; PRSharedMemory *shm; char ipcname[PR_IPC_NAME_SIZE]; diff --git a/pr/src/md/windows/Makefile.in b/pr/src/md/windows/Makefile.in index 283fa4a4..d9dce1d0 100644 --- a/pr/src/md/windows/Makefile.in +++ b/pr/src/md/windows/Makefile.in @@ -105,3 +105,11 @@ include $(topsrcdir)/config/rules.mk export:: $(TARGETS) +# Bug 122433 workaround: disable global optimization (-Og-) on ntio.c. +ifdef BUILD_OPT +ifeq ($(OS_TARGET), WINNT) +$(OBJDIR)/ntio.$(OBJ_SUFFIX): ntio.c + @$(MAKE_OBJDIR) + $(CC) -Fo$@ -c $(CFLAGS) -Og- $< +endif +endif diff --git a/pr/src/md/windows/ntthread.c b/pr/src/md/windows/ntthread.c index 9c3e2baf..1c3fb531 100644 --- a/pr/src/md/windows/ntthread.c +++ b/pr/src/md/windows/ntthread.c @@ -238,6 +238,13 @@ _PR_MD_CREATE_THREAD(PRThread *thread, } thread->md.id = thread->id; + /* + * On windows, a thread is created with a thread priority of + * THREAD_PRIORITY_NORMAL. + */ + if (priority != PR_PRIORITY_NORMAL) { + _PR_MD_SET_PRIORITY(&(thread->md), priority); + } /* Activate the thread */ if ( ResumeThread( thread->md.handle ) != -1) diff --git a/pr/src/md/windows/w95sock.c b/pr/src/md/windows/w95sock.c index d36ffdcd..58944703 100644 --- a/pr/src/md/windows/w95sock.c +++ b/pr/src/md/windows/w95sock.c @@ -168,7 +168,6 @@ PRInt32 _PR_MD_BIND(PRFileDesc *fd, const PRNetAddr *addr, PRUint32 addrlen) { PRInt32 rv; - int one = 1; rv = bind(fd->secret->md.osfd, (const struct sockaddr *)&(addr->inet), addrlen); @@ -180,6 +179,20 @@ _PR_MD_BIND(PRFileDesc *fd, const PRNetAddr *addr, PRUint32 addrlen) return 0; } +PRInt32 +_PR_MD_LISTEN(PRFileDesc *fd, PRIntn backlog) +{ + PRInt32 rv; + + rv = listen(fd->secret->md.osfd, backlog); + + if (rv == SOCKET_ERROR) { + _PR_MD_MAP_DEFAULT_ERROR(WSAGetLastError()); + return -1; + } + + return 0; +} PRInt32 _PR_MD_RECV(PRFileDesc *fd, void *buf, PRInt32 amount, PRIntn flags, @@ -461,6 +474,7 @@ static PRInt32 socket_io_wait( struct timeval tv; PRThread *me = _PR_MD_CURRENT_THREAD(); PRIntervalTime elapsed, remaining; + PRBool wait_for_remaining; fd_set rd_wr, ex; int err, len; @@ -547,8 +561,10 @@ static PRInt32 socket_io_wait( * so that there is an upper limit on the delay * before the interrupt bit is checked. */ + wait_for_remaining = PR_TRUE; tv.tv_sec = PR_IntervalToSeconds(remaining); if (tv.tv_sec > _PR_INTERRUPT_CHECK_INTERVAL_SECS) { + wait_for_remaining = PR_FALSE; tv.tv_sec = _PR_INTERRUPT_CHECK_INTERVAL_SECS; tv.tv_usec = 0; } else { @@ -618,8 +634,12 @@ static PRInt32 socket_io_wait( */ if (rv == 0 ) { - elapsed = PR_SecondsToInterval(tv.tv_sec) - + PR_MicrosecondsToInterval(tv.tv_usec); + if (wait_for_remaining) { + elapsed = remaining; + } else { + elapsed = PR_SecondsToInterval(tv.tv_sec) + + PR_MicrosecondsToInterval(tv.tv_usec); + } if (elapsed >= remaining) { PR_SetError(PR_IO_TIMEOUT_ERROR, 0); rv = -1; diff --git a/pr/src/md/windows/w95thred.c b/pr/src/md/windows/w95thred.c index a70f1620..f8a70043 100644 --- a/pr/src/md/windows/w95thred.c +++ b/pr/src/md/windows/w95thred.c @@ -131,7 +131,13 @@ _PR_MD_CREATE_THREAD(PRThread *thread, } thread->md.id = thread->id; - _PR_MD_SET_PRIORITY(&(thread->md), priority); + /* + * On windows, a thread is created with a thread priority of + * THREAD_PRIORITY_NORMAL. + */ + if (priority != PR_PRIORITY_NORMAL) { + _PR_MD_SET_PRIORITY(&(thread->md), priority); + } /* Activate the thread */ if ( ResumeThread( thread->md.handle ) != -1) diff --git a/pr/src/misc/pralarm.c b/pr/src/misc/pralarm.c index 488ce5a4..90c06442 100644 --- a/pr/src/misc/pralarm.c +++ b/pr/src/misc/pralarm.c @@ -180,7 +180,7 @@ static void PR_CALLBACK pr_alarmNotifier(void *arg) } /* pr_alarm_notifier */ -PR_IMPLEMENT(PRAlarm*) PR_CreateAlarm() +PR_IMPLEMENT(PRAlarm*) PR_CreateAlarm(void) { PRAlarm *alarm = PR_NEWZAP(PRAlarm); if (alarm != NULL) diff --git a/pr/src/misc/prdtoa.c b/pr/src/misc/prdtoa.c index e2e715fe..7f0b9cf6 100644 --- a/pr/src/misc/prdtoa.c +++ b/pr/src/misc/prdtoa.c @@ -1180,6 +1180,16 @@ void _PR_InitDtoa(void) p5s_lock = PR_NewLock(); } +void _PR_CleanupDtoa(void) +{ + PR_DestroyLock(freelist_lock); + freelist_lock = NULL; + PR_DestroyLock(p5s_lock); + p5s_lock = NULL; + + /* FIXME: deal with freelist and p5s. */ +} + #if defined(HAVE_WATCOM_BUG_1) PRFloat64 __pascal __loadds __export #else diff --git a/pr/src/misc/prenv.c b/pr/src/misc/prenv.c index 75af10fb..fdcfb017 100644 --- a/pr/src/misc/prenv.c +++ b/pr/src/misc/prenv.c @@ -59,7 +59,7 @@ static PRLock *_pr_envLock = NULL; /************************************************************************/ -void _PR_InitEnv() +void _PR_InitEnv(void) { _PR_NEW_LOCK_ENV(); } diff --git a/pr/src/misc/prerr.c b/pr/src/misc/prerr.c index 68bcc6ce..be24aff7 100644 --- a/pr/src/misc/prerr.c +++ b/pr/src/misc/prerr.c @@ -119,6 +119,6 @@ static const struct PRErrorMessage text[] = { static const struct PRErrorTable et = { text, "prerr", -6000L, 75 }; -void nspr_InitializePRErrorTable() { +void nspr_InitializePRErrorTable(void) { PR_ErrorInstallTable(&et); } diff --git a/pr/src/misc/prerror.c b/pr/src/misc/prerror.c index 8456d9d2..6e0d5f19 100644 --- a/pr/src/misc/prerror.c +++ b/pr/src/misc/prerror.c @@ -37,13 +37,13 @@ #include #include -PR_IMPLEMENT(PRErrorCode) PR_GetError() +PR_IMPLEMENT(PRErrorCode) PR_GetError(void) { PRThread *thread = PR_GetCurrentThread(); return thread->errorCode; } -PR_IMPLEMENT(PRInt32) PR_GetOSError() +PR_IMPLEMENT(PRInt32) PR_GetOSError(void) { PRThread *thread = PR_GetCurrentThread(); return thread->osErrorCode; diff --git a/pr/src/misc/prinit.c b/pr/src/misc/prinit.c index 6da27fa0..e512f1e0 100644 --- a/pr/src/misc/prinit.c +++ b/pr/src/misc/prinit.c @@ -161,7 +161,7 @@ static void _pr_SetNativeThreadsOnlyMode(void) #endif #if !defined(_PR_INET6) || defined(_PR_INET6_PROBE) -extern PRStatus _pr_init_ipv6(); +extern PRStatus _pr_init_ipv6(void); #endif static void _PR_InitStuff(void) @@ -169,6 +169,9 @@ static void _PR_InitStuff(void) if (_pr_initialized) return; _pr_initialized = PR_TRUE; +#ifdef _PR_ZONE_ALLOCATOR + _PR_InitZones(); +#endif #ifdef WINNT _pr_SetNativeThreadsOnlyMode(); #endif @@ -220,10 +223,6 @@ static void _PR_InitStuff(void) _PR_InitCPUs(); #endif -#ifdef _PR_ZONE_ALLOCATOR - _PR_InitZones(); -#endif - /* * XXX: call _PR_InitMem only on those platforms for which nspr implements * malloc, for now. @@ -251,7 +250,7 @@ static void _PR_InitStuff(void) _PR_MD_FINAL_INIT(); } -void _PR_ImplicitInitialization() +void _PR_ImplicitInitialization(void) { _PR_InitStuff(); @@ -417,9 +416,10 @@ PR_IMPLEMENT(PRStatus) PR_Cleanup() PR_ASSERT((_PR_IS_NATIVE_THREAD(me)) || (me->cpu->id == 0)); #endif -#if defined(WIN16) + _PR_CleanupMW(); + _PR_CleanupDtoa(); + _PR_CleanupCallOnce(); _PR_ShutdownLinker(); -#endif /* Release the primordial thread's private data, etc. */ _PR_CleanupThread(me); @@ -449,6 +449,7 @@ PR_IMPLEMENT(PRStatus) PR_Cleanup() * Ideally, for each _PR_InitXXX(), there should be a corresponding * _PR_XXXCleanup() that we can call here. */ + _PR_CleanupNet(); _PR_CleanupIO(); _PR_CleanupThreads(); PR_DestroyLock(_pr_sleeplock); @@ -776,13 +777,20 @@ static struct { PRCondVar *cv; } mod_init; -static void _PR_InitCallOnce() { +static void _PR_InitCallOnce(void) { mod_init.ml = PR_NewLock(); PR_ASSERT(NULL != mod_init.ml); mod_init.cv = PR_NewCondVar(mod_init.ml); PR_ASSERT(NULL != mod_init.cv); } +void _PR_CleanupCallOnce() +{ + PR_DestroyLock(mod_init.ml); + mod_init.ml = NULL; + PR_DestroyCondVar(mod_init.cv); + mod_init.cv = NULL; +} PR_IMPLEMENT(PRStatus) PR_CallOnce( PRCallOnceType *once, diff --git a/pr/src/misc/prinrval.c b/pr/src/misc/prinrval.c index d0af3977..a319e8cb 100644 --- a/pr/src/misc/prinrval.c +++ b/pr/src/misc/prinrval.c @@ -68,13 +68,13 @@ void _PR_InitClock(void) * 2) The units here are milliseconds. That's not appropriate for our use. */ -PR_IMPLEMENT(PRIntervalTime) PR_IntervalNow() +PR_IMPLEMENT(PRIntervalTime) PR_IntervalNow(void) { if (!_pr_initialized) _PR_ImplicitInitialization(); return _PR_MD_GET_INTERVAL(); } /* PR_IntervalNow */ -PR_EXTERN(PRUint32) PR_TicksPerSecond() +PR_EXTERN(PRUint32) PR_TicksPerSecond(void) { if (!_pr_initialized) _PR_ImplicitInitialization(); return _PR_MD_INTERVAL_PER_SEC(); diff --git a/pr/src/misc/prnetdb.c b/pr/src/misc/prnetdb.c index b40ca804..58342292 100644 --- a/pr/src/misc/prnetdb.c +++ b/pr/src/misc/prnetdb.c @@ -83,6 +83,12 @@ PRLock *_pr_dnsLock = NULL; * Some return a pointer to struct protoent, others return * an int. */ +#if defined(XP_BEOS) && defined(BONE_VERSION) +#include /* pick up define for inet_addr */ +#include +#define _PR_HAVE_GETPROTO_R +#define _PR_HAVE_GETPROTO_R_POINTER +#endif #if defined(SOLARIS) || (defined(BSDI) && defined(_REENTRANT)) \ || (defined(LINUX) && defined(_REENTRANT) \ @@ -157,6 +163,175 @@ const PRIPv6Addr _pr_in6addr_loopback = {{{ 0, 0, 0, 0, #define _PR_IN6_V4MAPPED_TO_IPADDR(a) ((a)->pr_s6_addr32[3]) +#if defined(_PR_INET6) && defined(_PR_HAVE_GETHOSTBYNAME2) + +/* + * The _pr_QueryNetIfs() function finds out if the system has + * IPv4 or IPv6 source addresses configured and sets _pr_have_inet_if + * and _pr_have_inet6_if accordingly. + * + * We have an implementation using SIOCGIFCONF ioctl and a + * default implementation that simply sets _pr_have_inet_if + * and _pr_have_inet6_if to true. A better implementation + * would be to use the routing sockets (see Chapter 17 of + * W. Richard Stevens' Unix Network Programming, Vol. 1, 2nd. Ed.) + */ + +static PRBool _pr_have_inet_if = PR_FALSE; +static PRBool _pr_have_inet6_if = PR_FALSE; + +#undef DEBUG_QUERY_IFS + +#if defined(AIX) + +/* + * Use SIOCGIFCONF ioctl on platforms that don't have routing + * sockets. Warning: whether SIOCGIFCONF ioctl returns AF_INET6 + * network interfaces is not portable. + * + * The _pr_QueryNetIfs() function is derived from the code in + * src/lib/libc/net/getifaddrs.c in BSD Unix and the code in + * Section 16.6 of W. Richard Stevens' Unix Network Programming, + * Vol. 1, 2nd. Ed. + */ + +#include +#include +#include +#include + +#ifdef DEBUG_QUERY_IFS +static void +_pr_PrintIfreq(struct ifreq *ifr) +{ + PRNetAddr addr; + struct sockaddr *sa; + const char* family; + char addrstr[64]; + + sa = &ifr->ifr_addr; + if (sa->sa_family == AF_INET) { + struct sockaddr_in *sin = (struct sockaddr_in *)sa; + family = "inet"; + memcpy(&addr.inet.ip, &sin->sin_addr, sizeof(sin->sin_addr)); + } else if (sa->sa_family == AF_INET6) { + struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)sa; + family = "inet6"; + memcpy(&addr.ipv6.ip, &sin6->sin6_addr, sizeof(sin6->sin6_addr)); + } else { + return; /* skip if not AF_INET or AF_INET6 */ + } + addr.raw.family = sa->sa_family; + PR_NetAddrToString(&addr, addrstr, sizeof(addrstr)); + printf("%s: %s %s\n", ifr->ifr_name, family, addrstr); +} +#endif + +static void +_pr_QueryNetIfs(void) +{ + int sock; + int rv; + struct ifconf ifc; + struct ifreq *ifr; + struct ifreq *lifr; + PRUint32 len, lastlen; + char *buf; + + if ((sock = socket(AF_INET, SOCK_STREAM, 0)) == -1) { + return; + } + + /* Issue SIOCGIFCONF request in a loop. */ + lastlen = 0; + len = 100 * sizeof(struct ifreq); /* initial buffer size guess */ + for (;;) { + buf = PR_Malloc(len); + if (NULL == buf) { + close(sock); + return; + } + ifc.ifc_buf = buf; + ifc.ifc_len = len; + rv = ioctl(sock, SIOCGIFCONF, &ifc); + if (rv < 0) { + if (errno != EINVAL || lastlen != 0) { + close(sock); + PR_Free(buf); + return; + } + } else { + if (ifc.ifc_len == lastlen) + break; /* success, len has not changed */ + lastlen = ifc.ifc_len; + } + len += 10 * sizeof(struct ifreq); /* increment */ + PR_Free(buf); + } + close(sock); + + ifr = ifc.ifc_req; + lifr = (struct ifreq *)&ifc.ifc_buf[ifc.ifc_len]; + + while (ifr < lifr) { + struct sockaddr *sa; + int sa_len; + +#ifdef DEBUG_QUERY_IFS + _pr_PrintIfreq(ifr); +#endif + sa = &ifr->ifr_addr; + if (sa->sa_family == AF_INET) { + struct sockaddr_in *sin = (struct sockaddr_in *) sa; + if (sin->sin_addr.s_addr != htonl(INADDR_LOOPBACK)) { + _pr_have_inet_if = PR_TRUE; + } + } else if (sa->sa_family == AF_INET6) { + struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *) sa; + if (!IN6_IS_ADDR_LOOPBACK(&sin6->sin6_addr)) { + _pr_have_inet6_if = PR_TRUE; + } + } + +#ifdef _PR_HAVE_SOCKADDR_LEN + sa_len = PR_MAX(sa->sa_len, sizeof(struct sockaddr)); +#else + switch (sa->sa_family) { +#ifdef AF_LINK + case AF_LINK: + sa_len = sizeof(struct sockaddr_dl); + break; +#endif + case AF_INET6: + sa_len = sizeof(struct sockaddr_in6); + break; + default: + sa_len = sizeof(struct sockaddr); + break; + } +#endif + ifr = (struct ifreq *)(((char *)sa) + sa_len); + } + PR_Free(buf); +} + +#else /* default */ + +/* + * Emulate the code in NSPR 4.2 or older. PR_GetIPNodeByName behaves + * as if the system had both IPv4 and IPv6 source addresses configured. + */ +static void +_pr_QueryNetIfs(void) +{ + _pr_have_inet_if = PR_TRUE; + _pr_have_inet6_if = PR_TRUE; +} + +#endif + +#endif /* _PR_INET6 && _PR_HAVE_GETHOSTBYNAME2 */ + void _PR_InitNet(void) { #if defined(XP_UNIX) @@ -174,6 +349,31 @@ void _PR_InitNet(void) #if !defined(_PR_HAVE_GETPROTO_R) _getproto_lock = PR_NewLock(); #endif +#if defined(_PR_INET6) && defined(_PR_HAVE_GETHOSTBYNAME2) + _pr_QueryNetIfs(); +#ifdef DEBUG_QUERY_IFS + if (_pr_have_inet_if) + printf("Have IPv4 source address\n"); + if (_pr_have_inet6_if) + printf("Have IPv6 source address\n"); +#endif +#endif +} + +void _PR_CleanupNet(void) +{ +#if !defined(_PR_NO_DNS_LOCK) + if (_pr_dnsLock) { + PR_DestroyLock(_pr_dnsLock); + _pr_dnsLock = NULL; + } +#endif +#if !defined(_PR_HAVE_GETPROTO_R) + if (_getproto_lock) { + PR_DestroyLock(_getproto_lock); + _getproto_lock = NULL; + } +#endif } /* @@ -215,7 +415,6 @@ static void MakeIPv4MappedAddr(const char *v4, char *v6) memset(v6, 0, 10); memset(v6 + 10, 0xff, 2); memcpy(v6 + 12, v4, 4); - PR_ASSERT(_PR_IN6_IS_ADDR_V4MAPPED(((PRIPv6Addr *) v6))); } /* @@ -225,7 +424,6 @@ static void MakeIPv4CompatAddr(const char *v4, char *v6) { memset(v6, 0, 12); memcpy(v6 + 12, v4, 4); - PR_ASSERT(_PR_IN6_IS_ADDR_V4COMPAT(((PRIPv6Addr *) v6))); } /* @@ -553,11 +751,15 @@ PR_IMPLEMENT(PRStatus) PR_GetIPNodeByName( LOCK_DNS(); if (af == PR_AF_INET6) { + if ((flags & PR_AI_ADDRCONFIG) == 0 || _pr_have_inet6_if) + { #ifdef _PR_INET6_PROBE - if (_pr_ipv6_is_present == PR_TRUE) + if (_pr_ipv6_is_present == PR_TRUE) #endif - h = GETHOSTBYNAME2(name, AF_INET6); - if ((NULL == h) && (flags & PR_AI_V4MAPPED)) + h = GETHOSTBYNAME2(name, AF_INET6); + } + if ((NULL == h) && (flags & PR_AI_V4MAPPED) + && ((flags & PR_AI_ADDRCONFIG) == 0 || _pr_have_inet_if)) { did_af_inet = PR_TRUE; h = GETHOSTBYNAME2(name, AF_INET); @@ -565,8 +767,11 @@ PR_IMPLEMENT(PRStatus) PR_GetIPNodeByName( } else { - did_af_inet = PR_TRUE; - h = GETHOSTBYNAME2(name, af); + if ((flags & PR_AI_ADDRCONFIG) == 0 || _pr_have_inet_if) + { + did_af_inet = PR_TRUE; + h = GETHOSTBYNAME2(name, af); + } } #elif defined(_PR_HAVE_GETIPNODEBYNAME) h = getipnodebyname(name, md_af, tmp_flags, &error_num); @@ -619,7 +824,8 @@ PR_IMPLEMENT(PRStatus) PR_GetIPNodeByName( #endif #if defined(_PR_INET6) && defined(_PR_HAVE_GETHOSTBYNAME2) if ((PR_SUCCESS == rv) && (flags & PR_AI_V4MAPPED) - && (flags & (PR_AI_ALL|PR_AI_ADDRCONFIG)) + && ((flags & PR_AI_ALL) + || ((flags & PR_AI_ADDRCONFIG) && _pr_have_inet_if)) && !did_af_inet && (h = GETHOSTBYNAME2(name, AF_INET)) != 0) { rv = AppendV4AddrsToHostent(h, &buf, &bufsize, hp); if (PR_SUCCESS != rv) diff --git a/pr/src/misc/prsystem.c b/pr/src/misc/prsystem.c index bb786766..5c84e5e7 100644 --- a/pr/src/misc/prsystem.c +++ b/pr/src/misc/prsystem.c @@ -58,7 +58,7 @@ #endif #if defined(HPUX) -#include +#include #endif #if defined(XP_UNIX) @@ -66,7 +66,7 @@ #include #endif -PR_IMPLEMENT(char) PR_GetDirectorySeparator() +PR_IMPLEMENT(char) PR_GetDirectorySeparator(void) { return PR_DIRECTORY_SEPARATOR; } /* PR_GetDirectorySeparator */ @@ -74,7 +74,7 @@ PR_IMPLEMENT(char) PR_GetDirectorySeparator() /* ** OBSOLETE -- the function name is misspelled. */ -PR_IMPLEMENT(char) PR_GetDirectorySepartor() +PR_IMPLEMENT(char) PR_GetDirectorySepartor(void) { #if defined(DEBUG) static PRBool warn = PR_TRUE; @@ -97,6 +97,12 @@ PR_IMPLEMENT(PRStatus) PR_GetSystemInfo(PRSysInfo cmd, char *buf, PRUint32 bufle case PR_SI_HOSTNAME: if (PR_FAILURE == _PR_MD_GETHOSTNAME(buf, (PRUintn)buflen)) return PR_FAILURE; + /* + * On some platforms a system does not have a hostname and + * its IP address is returned instead. The following code + * should be skipped on those platforms. + */ +#ifndef _PR_GET_HOST_ADDR_AS_NAME /* Return the unqualified hostname */ while (buf[len] && (len < buflen)) { if (buf[len] == '.') { @@ -105,6 +111,7 @@ PR_IMPLEMENT(PRStatus) PR_GetSystemInfo(PRSysInfo cmd, char *buf, PRUint32 bufle } len += 1; } +#endif break; case PR_SI_SYSNAME: @@ -150,7 +157,6 @@ PR_IMPLEMENT(PRStatus) PR_GetSystemInfo(PRSysInfo cmd, char *buf, PRUint32 bufle default: PR_SetError(PR_INVALID_ARGUMENT_ERROR, 0); return PR_FAILURE; - break; } return PR_SUCCESS; } diff --git a/pr/src/misc/prtime.c b/pr/src/misc/prtime.c index 0aa6e46c..a107d1d4 100644 --- a/pr/src/misc/prtime.c +++ b/pr/src/misc/prtime.c @@ -774,7 +774,7 @@ PR_IMPLEMENT(PRTimeParameters) PR_USPacificTimeParameters(const PRExplodedTime *gmt) { PRTimeParameters retVal; - PRExplodedTime std; + PRExplodedTime st; /* * Based on geographic location and GMT, figure out offset of @@ -789,32 +789,32 @@ PR_USPacificTimeParameters(const PRExplodedTime *gmt) * is ignored. */ - std.tm_usec = gmt->tm_usec; - std.tm_sec = gmt->tm_sec; - std.tm_min = gmt->tm_min; - std.tm_hour = gmt->tm_hour; - std.tm_mday = gmt->tm_mday; - std.tm_month = gmt->tm_month; - std.tm_year = gmt->tm_year; - std.tm_wday = gmt->tm_wday; - std.tm_yday = gmt->tm_yday; + st.tm_usec = gmt->tm_usec; + st.tm_sec = gmt->tm_sec; + st.tm_min = gmt->tm_min; + st.tm_hour = gmt->tm_hour; + st.tm_mday = gmt->tm_mday; + st.tm_month = gmt->tm_month; + st.tm_year = gmt->tm_year; + st.tm_wday = gmt->tm_wday; + st.tm_yday = gmt->tm_yday; /* Apply the offset to GMT to obtain the local standard time */ - ApplySecOffset(&std, retVal.tp_gmt_offset); + ApplySecOffset(&st, retVal.tp_gmt_offset); /* * Apply the rules on standard time or GMT to obtain daylight saving * time offset. In this implementation, we use the US DST rule. */ - if (std.tm_month < 3) { + if (st.tm_month < 3) { retVal.tp_dst_offset = 0L; - } else if (std.tm_month == 3) { - if (std.tm_wday == 0) { + } else if (st.tm_month == 3) { + if (st.tm_wday == 0) { /* A Sunday */ - if (std.tm_mday <= 7) { + if (st.tm_mday <= 7) { /* First Sunday */ /* 01:59:59 PST -> 03:00:00 PDT */ - if (std.tm_hour < 2) { + if (st.tm_hour < 2) { retVal.tp_dst_offset = 0L; } else { retVal.tp_dst_offset = 3600L; @@ -825,7 +825,7 @@ PR_USPacificTimeParameters(const PRExplodedTime *gmt) } } else { /* Not a Sunday. See if before first Sunday or after */ - if (std.tm_wday + 1 <= std.tm_mday) { + if (st.tm_wday + 1 <= st.tm_mday) { /* After first Sunday */ retVal.tp_dst_offset = 3600L; } else { @@ -833,14 +833,14 @@ PR_USPacificTimeParameters(const PRExplodedTime *gmt) retVal.tp_dst_offset = 0L; } } - } else if (std.tm_month < 9) { + } else if (st.tm_month < 9) { retVal.tp_dst_offset = 3600L; - } else if (std.tm_month == 9) { - if (std.tm_wday == 0) { - if (31 - std.tm_mday < 7) { + } else if (st.tm_month == 9) { + if (st.tm_wday == 0) { + if (31 - st.tm_mday < 7) { /* Last Sunday */ /* 01:59:59 PDT -> 01:00:00 PST */ - if (std.tm_hour < 1) { + if (st.tm_hour < 1) { retVal.tp_dst_offset = 3600L; } else { retVal.tp_dst_offset = 0L; @@ -851,7 +851,7 @@ PR_USPacificTimeParameters(const PRExplodedTime *gmt) } } else { /* See if before or after last Sunday */ - if (7 - std.tm_wday <= 31 - std.tm_mday) { + if (7 - st.tm_wday <= 31 - st.tm_mday) { /* before last Sunday */ retVal.tp_dst_offset = 3600L; } else { diff --git a/pr/src/misc/prtpool.c b/pr/src/misc/prtpool.c index 2f43c676..acf6ec77 100644 --- a/pr/src/misc/prtpool.c +++ b/pr/src/misc/prtpool.c @@ -166,7 +166,7 @@ struct PRJob { PR_END_MACRO static void delete_job(PRJob *jobp); -static PRThreadPool * alloc_threadpool(); +static PRThreadPool * alloc_threadpool(void); static PRJob * alloc_job(PRBool joinable, PRThreadPool *tp); static void notify_ioq(PRThreadPool *tp); static void notify_timerq(PRThreadPool *tp); @@ -599,7 +599,7 @@ delete_threadpool(PRThreadPool *tp) } static PRThreadPool * -alloc_threadpool() +alloc_threadpool(void) { PRThreadPool *tp; diff --git a/pr/src/pthreads/Makefile.in b/pr/src/pthreads/Makefile.in index a43fd6ac..8eb237d4 100644 --- a/pr/src/pthreads/Makefile.in +++ b/pr/src/pthreads/Makefile.in @@ -63,6 +63,11 @@ INCLUDES = -I$(dist_includedir) -I$(topsrcdir)/pr/include -I$(topsrcdir)/pr/incl DEFINES += -D_NSPR_BUILD_ +ifeq ($(OS_ARCH),Linux) +# for pthread_mutexattr_settype +DEFINES += -D_XOPEN_SOURCE=500 +endif + include $(topsrcdir)/config/rules.mk export:: $(TARGETS) diff --git a/pr/src/pthreads/ptio.c b/pr/src/pthreads/ptio.c index ce263217..29344491 100644 --- a/pr/src/pthreads/ptio.c +++ b/pr/src/pthreads/ptio.c @@ -173,11 +173,18 @@ static ssize_t (*pt_aix_sendfile_fptr)() = NULL; #endif /* HAVE_SEND_FILE */ #endif /* AIX */ +#ifdef LINUX +#include +#endif + #include "primpl.h" -/* On Alpha Linux, these are already defined in sys/socket.h */ -#if !(defined(LINUX) && defined(__alpha)) #include /* TCP_NODELAY, TCP_MAXSEG */ +#ifdef LINUX +/* TCP_CORK is not defined in on Red Hat Linux 6.0 */ +#ifndef TCP_CORK +#define TCP_CORK 3 +#endif #endif #if defined(SOLARIS) @@ -281,11 +288,9 @@ static PRBool IsValidNetAddrLen(const PRNetAddr *addr, PRInt32 addr_len) * most current systems. */ #if defined(HAVE_SOCKLEN_T) \ - || (defined(LINUX) && defined(__GLIBC__) && __GLIBC__ >= 2 \ - && !defined(__alpha)) + || (defined(LINUX) && defined(__GLIBC__) && __GLIBC__ >= 2) typedef socklen_t pt_SockLen; #elif (defined(AIX) && !defined(AIX4_1)) \ - || (defined(LINUX) && defined(__alpha)) \ || defined(VMS) typedef PRSize pt_SockLen; #else @@ -338,6 +343,15 @@ struct pt_Continuation */ int nbytes_to_send; /* size of header and file */ #endif /* SOLARIS */ + +#ifdef LINUX + /* + * For sendfile() + */ + int in_fd; /* descriptor of file to send */ + off_t offset; + size_t count; +#endif /* LINUX */ PRIntervalTime timeout; /* client (relative) timeout */ @@ -406,6 +420,7 @@ static void pt_poll_now_with_select(pt_Continuation *op) 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); @@ -485,9 +500,12 @@ static void pt_poll_now_with_select(pt_Continuation *op) } else wrp = NULL; + wait_for_remaining = PR_TRUE; msecs = (PRInt32)PR_IntervalToMilliseconds(remaining); - if (msecs > PT_DEFAULT_POLL_MSEC) + 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); @@ -514,9 +532,12 @@ static void pt_poll_now_with_select(pt_Continuation *op) } else if ((rv == 0) || ((errno == EINTR) || (errno == EAGAIN))) { - if (rv == 0) /* select timed out */ - now += PR_MillisecondsToInterval(msecs); - else + 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) { @@ -542,6 +563,7 @@ static void pt_poll_now(pt_Continuation *op) { PRInt32 msecs; PRIntervalTime epoch, now, elapsed, remaining; + PRBool wait_for_remaining; PRThread *self = PR_GetCurrentThread(); PR_ASSERT(PR_INTERVAL_NO_WAIT != op->timeout); @@ -618,9 +640,13 @@ static void pt_poll_now(pt_Continuation *op) tmp_pfd.fd = op->arg1.osfd; tmp_pfd.events = op->event; + 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; + } rv = poll(&tmp_pfd, 1, msecs); if (self->state & PT_THREAD_ABORTED) @@ -654,7 +680,12 @@ static void pt_poll_now(pt_Continuation *op) } else if ((rv == 0) || ((errno == EINTR) || (errno == EAGAIN))) { if (rv == 0) /* poll timed out */ - now += PR_MillisecondsToInterval(msecs); + { + if (wait_for_remaining) + now += remaining; + else + now += PR_MillisecondsToInterval(msecs); + } else now = PR_IntervalNow(); elapsed = (PRIntervalTime) (now - epoch); @@ -1024,17 +1055,18 @@ static PRBool pt_solaris_sendfile_cont(pt_Continuation *op, PRInt16 revents) ssize_t count; count = SOLARIS_SENDFILEV(op->arg1.osfd, vec, op->arg3.amount, &xferred); - PR_ASSERT((count == -1) || (count == xferred)); - PR_ASSERT(xferred <= op->nbytes_to_send); op->syserrno = errno; + PR_ASSERT((count == -1) || (count == xferred)); if (count == -1) { - if (op->syserrno != EWOULDBLOCK && op->syserrno != EAGAIN) { + if (op->syserrno != EWOULDBLOCK && op->syserrno != EAGAIN + && op->syserrno != EINTR) { op->result.code = -1; return PR_TRUE; } count = xferred; } + PR_ASSERT(count <= op->nbytes_to_send); op->result.code += count; if (count < op->nbytes_to_send) { @@ -1059,7 +1091,34 @@ static PRBool pt_solaris_sendfile_cont(pt_Continuation *op, PRInt16 revents) } #endif /* SOLARIS */ -void _PR_InitIO() +#ifdef LINUX +static PRBool pt_linux_sendfile_cont(pt_Continuation *op, PRInt16 revents) +{ + ssize_t rv; + off_t oldoffset; + + oldoffset = op->offset; + rv = sendfile(op->arg1.osfd, op->in_fd, &op->offset, op->count); + op->syserrno = errno; + + if (rv == -1) { + if (op->syserrno != EWOULDBLOCK && op->syserrno != EAGAIN) { + op->result.code = -1; + return PR_TRUE; + } + rv = 0; + } + PR_ASSERT(rv == op->offset - oldoffset); + op->result.code += rv; + if (rv < op->count) { + op->count -= rv; + return PR_FALSE; + } + return PR_TRUE; +} +#endif /* LINUX */ + +void _PR_InitIO(void) { #if defined(DEBUG) memset(&pt_debug, 0, sizeof(PTDebug)); @@ -1569,6 +1628,18 @@ static PRFileDesc* pt_Accept( if (pt_TestAbort()) return newfd; +#ifdef _PR_STRICT_ADDR_LEN + if (addr) + { + /* + * Set addr->raw.family just so that we can use the + * PR_NETADDR_SIZE macro. + */ + addr->raw.family = fd->secret->af; + addr_len = PR_NETADDR_SIZE(addr); + } +#endif + osfd = accept(fd->secret->md.osfd, (struct sockaddr*)addr, &addr_len); syserrno = errno; @@ -1614,6 +1685,14 @@ static PRFileDesc* pt_Accept( { PR_ASSERT(IsValidNetAddr(addr) == PR_TRUE); PR_ASSERT(IsValidNetAddrLen(addr, addr_len) == PR_TRUE); +#ifdef LINUX + /* + * On Linux, experiments showed that the accepted sockets + * inherit the TCP_NODELAY socket option of the listening + * socket. + */ + newfd->secret->md.tcp_nodelay = fd->secret->md.tcp_nodelay; +#endif } return newfd; @@ -2107,7 +2186,7 @@ static PRInt32 pt_AIXSendFile(PRFileDesc *sd, PRSendFileData *sfd, } if (count == -1) { - _MD_aix_map_sendfile_error(syserrno); + pt_MapError(_MD_aix_map_sendfile_error, syserrno); return -1; } if (flags & PR_TRANSMITFILE_CLOSE_SOCKET) { @@ -2146,14 +2225,16 @@ static PRInt32 pt_HPUXSendFile(PRFileDesc *sd, PRSendFileData *sfd, PRInt32 count; int syserrno; - /* Get file size */ - if (fstat(sfd->fd->secret->md.osfd, &statbuf) == -1) { - _PR_MD_MAP_FSTAT_ERROR(errno); - return -1; + if (sfd->file_nbytes == 0) { + /* Get file size */ + if (fstat(sfd->fd->secret->md.osfd, &statbuf) == -1) { + _PR_MD_MAP_FSTAT_ERROR(errno); + return -1; + } + file_nbytes_to_send = statbuf.st_size - sfd->file_offset; + } else { + file_nbytes_to_send = sfd->file_nbytes; } - file_nbytes_to_send = (sfd->file_nbytes == 0) ? - statbuf.st_size - sfd->file_offset : - sfd->file_nbytes; nbytes_to_send = sfd->hlen + sfd->tlen + file_nbytes_to_send; hdtrl[0].iov_base = (void *) sfd->header; /* cast away the 'const' */ @@ -2228,7 +2309,7 @@ static PRInt32 pt_HPUXSendFile(PRFileDesc *sd, PRSendFileData *sfd, } if (count == -1) { - _MD_hpux_map_sendfile_error(syserrno); + pt_MapError(_MD_hpux_map_sendfile_error, syserrno); return -1; } if (flags & PR_TRANSMITFILE_CLOSE_SOCKET) { @@ -2358,7 +2439,7 @@ static PRInt32 pt_SolarisSendFile(PRFileDesc *sd, PRSendFileData *sfd, done: if (count == -1) { - _MD_solaris_map_sendfile_error(syserrno); + pt_MapError(_MD_solaris_map_sendfile_error, syserrno); return -1; } if (flags & PR_TRANSMITFILE_CLOSE_SOCKET) { @@ -2425,6 +2506,140 @@ static PRInt32 pt_SolarisDispatchSendFile(PRFileDesc *sd, PRSendFileData *sfd, #endif /* SOLARIS */ +#ifdef LINUX +/* + * pt_LinuxSendFile + * + * Send file sfd->fd across socket sd. If specified, header and trailer + * buffers are sent before and after the file, respectively. + * + * PR_TRANSMITFILE_CLOSE_SOCKET flag - close socket after sending file + * + * return number of bytes sent or -1 on error + * + * This implementation takes advantage of the sendfile() system + * call available in Linux kernel 2.2 or higher. + */ + +static PRInt32 pt_LinuxSendFile(PRFileDesc *sd, PRSendFileData *sfd, + PRTransmitFileFlags flags, PRIntervalTime timeout) +{ + struct stat statbuf; + size_t file_nbytes_to_send; + PRInt32 count = 0; + ssize_t rv; + int syserrno; + off_t offset; + PRBool tcp_cork_enabled = PR_FALSE; + int tcp_cork; + + if (sfd->file_nbytes == 0) { + /* Get file size */ + if (fstat(sfd->fd->secret->md.osfd, &statbuf) == -1) { + _PR_MD_MAP_FSTAT_ERROR(errno); + return -1; + } + file_nbytes_to_send = statbuf.st_size - sfd->file_offset; + } else { + file_nbytes_to_send = sfd->file_nbytes; + } + + if ((sfd->hlen != 0 || sfd->tlen != 0) + && sd->secret->md.tcp_nodelay == 0) { + tcp_cork = 1; + if (setsockopt(sd->secret->md.osfd, SOL_TCP, TCP_CORK, + &tcp_cork, sizeof tcp_cork) == 0) { + tcp_cork_enabled = PR_TRUE; + } else { + syserrno = errno; + if (syserrno != EINVAL) { + _PR_MD_MAP_SETSOCKOPT_ERROR(syserrno); + return -1; + } + /* + * The most likely reason for the EINVAL error is that + * TCP_NODELAY is set (with a function other than + * PR_SetSocketOption). This is not fatal, so we keep + * on going. + */ + PR_LOG(_pr_io_lm, PR_LOG_WARNING, + ("pt_LinuxSendFile: " + "setsockopt(TCP_CORK) failed with EINVAL\n")); + } + } + + if (sfd->hlen != 0) { + count = PR_Send(sd, sfd->header, sfd->hlen, 0, timeout); + if (count == -1) { + goto failed; + } + } + + if (file_nbytes_to_send != 0) { + offset = sfd->file_offset; + do { + rv = sendfile(sd->secret->md.osfd, sfd->fd->secret->md.osfd, + &offset, file_nbytes_to_send); + } while (rv == -1 && (syserrno = errno) == EINTR); + if (rv == -1) { + if (syserrno != EAGAIN && syserrno != EWOULDBLOCK) { + _MD_linux_map_sendfile_error(syserrno); + count = -1; + goto failed; + } + rv = 0; + } + PR_ASSERT(rv == offset - sfd->file_offset); + count += rv; + + if (rv < file_nbytes_to_send) { + pt_Continuation op; + + op.arg1.osfd = sd->secret->md.osfd; + op.in_fd = sfd->fd->secret->md.osfd; + op.offset = offset; + op.count = file_nbytes_to_send - rv; + op.result.code = count; + op.timeout = timeout; + op.function = pt_linux_sendfile_cont; + op.event = POLLOUT | POLLPRI; + count = pt_Continue(&op); + syserrno = op.syserrno; + if (count == -1) { + pt_MapError(_MD_linux_map_sendfile_error, syserrno); + goto failed; + } + } + } + + if (sfd->tlen != 0) { + rv = PR_Send(sd, sfd->trailer, sfd->tlen, 0, timeout); + if (rv == -1) { + count = -1; + goto failed; + } + count += rv; + } + +failed: + if (tcp_cork_enabled) { + tcp_cork = 0; + if (setsockopt(sd->secret->md.osfd, SOL_TCP, TCP_CORK, + &tcp_cork, sizeof tcp_cork) == -1 && count != -1) { + _PR_MD_MAP_SETSOCKOPT_ERROR(errno); + count = -1; + } + } + if (count != -1) { + if (flags & PR_TRANSMITFILE_CLOSE_SOCKET) { + PR_Close(sd); + } + PR_ASSERT(count == sfd->hlen + sfd->tlen + file_nbytes_to_send); + } + return count; +} +#endif /* LINUX */ + #ifdef AIX extern int _pr_aix_send_file_use_disabled; #endif @@ -2465,6 +2680,8 @@ static PRInt32 pt_SendFile( #else return(pt_SolarisDispatchSendFile(sd, sfd, flags, timeout)); #endif /* HAVE_SENDFILEV */ +#elif defined(LINUX) + return(pt_LinuxSendFile(sd, sfd, flags, timeout)); #else return(PR_EmulateSendFile(sd, sfd, flags, timeout)); #endif @@ -2728,6 +2945,12 @@ static PRStatus pt_SetSocketOption(PRFileDesc *fd, const PRSocketOptionData *dat rv = setsockopt( fd->secret->md.osfd, level, name, (char*)&value, sizeof(PRIntn)); +#ifdef LINUX + /* for pt_LinuxSendFile */ + if (name == TCP_NODELAY && rv == 0) { + fd->secret->md.tcp_nodelay = value; + } +#endif break; } case PR_SockOpt_McastLoopback: @@ -3086,27 +3309,27 @@ static PRFileDesc *pt_SetMethods( return fd; } /* pt_SetMethods */ -PR_IMPLEMENT(const PRIOMethods*) PR_GetFileMethods() +PR_IMPLEMENT(const PRIOMethods*) PR_GetFileMethods(void) { return &_pr_file_methods; } /* PR_GetFileMethods */ -PR_IMPLEMENT(const PRIOMethods*) PR_GetPipeMethods() +PR_IMPLEMENT(const PRIOMethods*) PR_GetPipeMethods(void) { return &_pr_pipe_methods; } /* PR_GetPipeMethods */ -PR_IMPLEMENT(const PRIOMethods*) PR_GetTCPMethods() +PR_IMPLEMENT(const PRIOMethods*) PR_GetTCPMethods(void) { return &_pr_tcp_methods; } /* PR_GetTCPMethods */ -PR_IMPLEMENT(const PRIOMethods*) PR_GetUDPMethods() +PR_IMPLEMENT(const PRIOMethods*) PR_GetUDPMethods(void) { return &_pr_udp_methods; } /* PR_GetUDPMethods */ -static const PRIOMethods* PR_GetSocketPollFdMethods() +static const PRIOMethods* PR_GetSocketPollFdMethods(void) { return &_pr_socketpollfd_methods; } /* PR_GetSocketPollFdMethods */ @@ -3206,6 +3429,9 @@ PR_IMPLEMENT(PRFileDesc*) PR_Socket(PRInt32 domain, PRInt32 type, PRInt32 proto) fd = pt_SetMethods(osfd, ftype, PR_FALSE, PR_FALSE); if (fd == NULL) close(osfd); } +#ifdef _PR_STRICT_ADDR_LEN + if (fd != NULL) fd->secret->af = domain; +#endif #if defined(_PR_INET6_PROBE) || !defined(_PR_INET6) if (fd != NULL) { /* @@ -4017,14 +4243,14 @@ PR_IMPLEMENT(PRDirEntry*) PR_ReadDir(PRDir *dir, PRDirFlags flags) return &dir->d; } /* PR_ReadDir */ -PR_IMPLEMENT(PRFileDesc*) PR_NewUDPSocket() +PR_IMPLEMENT(PRFileDesc*) PR_NewUDPSocket(void) { PRIntn domain = PF_INET; return PR_Socket(domain, SOCK_DGRAM, 0); } /* PR_NewUDPSocket */ -PR_IMPLEMENT(PRFileDesc*) PR_NewTCPSocket() +PR_IMPLEMENT(PRFileDesc*) PR_NewTCPSocket(void) { PRIntn domain = PF_INET; @@ -4122,7 +4348,7 @@ PR_IMPLEMENT(PRStatus) PR_SetFDInheritable( { return PR_FAILURE; } - fd->secret->inheritable = inheritable; + fd->secret->inheritable = (_PRTriStateBool) inheritable; } return PR_SUCCESS; } @@ -4158,6 +4384,9 @@ PR_IMPLEMENT(PRFileDesc*) PR_ImportTCPSocket(PRInt32 osfd) if (!_pr_initialized) _PR_ImplicitInitialization(); fd = pt_SetMethods(osfd, PR_DESC_SOCKET_TCP, PR_FALSE, PR_TRUE); if (NULL == fd) close(osfd); +#ifdef _PR_STRICT_ADDR_LEN + if (NULL != fd) fd->secret->af = PF_INET; +#endif return fd; } /* PR_ImportTCPSocket */ diff --git a/pr/src/pthreads/ptsynch.c b/pr/src/pthreads/ptsynch.c index 4400e8df..17334af3 100644 --- a/pr/src/pthreads/ptsynch.c +++ b/pr/src/pthreads/ptsynch.c @@ -71,6 +71,13 @@ void _PR_InitLocks(void) rv = _PT_PTHREAD_MUTEXATTR_INIT(&_pt_mattr); PR_ASSERT(0 == rv); +#ifdef LINUX +#if (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2) + rv = pthread_mutexattr_settype(&_pt_mattr, PTHREAD_MUTEX_ADAPTIVE_NP); + PR_ASSERT(0 == rv); +#endif +#endif + rv = _PT_PTHREAD_CONDATTR_INIT(&_pt_cvar_attr); PR_ASSERT(0 == rv); } @@ -1041,7 +1048,7 @@ PR_IMPLEMENT(PRStatus) PRP_TryLock(PRLock *lock) return (PT_TRYLOCK_SUCCESS == rv) ? PR_SUCCESS : PR_FAILURE; } /* PRP_TryLock */ -PR_IMPLEMENT(PRCondVar*) PRP_NewNakedCondVar() +PR_IMPLEMENT(PRCondVar*) PRP_NewNakedCondVar(void) { PRCondVar *cv; diff --git a/pr/src/pthreads/ptthread.c b/pr/src/pthreads/ptthread.c index dc8cc127..070a887c 100644 --- a/pr/src/pthreads/ptthread.c +++ b/pr/src/pthreads/ptthread.c @@ -607,9 +607,9 @@ PR_IMPLEMENT(PRStatus) PR_JoinThread(PRThread *thred) return (0 == rv) ? PR_SUCCESS : PR_FAILURE; } /* PR_JoinThread */ -PR_IMPLEMENT(void) PR_DetachThread() { } /* PR_DetachThread */ +PR_IMPLEMENT(void) PR_DetachThread(void) { } /* PR_DetachThread */ -PR_IMPLEMENT(PRThread*) PR_GetCurrentThread() +PR_IMPLEMENT(PRThread*) PR_GetCurrentThread(void) { void *thred; @@ -724,25 +724,25 @@ PR_IMPLEMENT(PRStatus) PR_Interrupt(PRThread *thred) return PR_SUCCESS; } /* PR_Interrupt */ -PR_IMPLEMENT(void) PR_ClearInterrupt() +PR_IMPLEMENT(void) PR_ClearInterrupt(void) { PRThread *me = PR_CurrentThread(); me->state &= ~PT_THREAD_ABORTED; } /* PR_ClearInterrupt */ -PR_IMPLEMENT(void) PR_BlockInterrupt() +PR_IMPLEMENT(void) PR_BlockInterrupt(void) { PRThread *me = PR_CurrentThread(); _PT_THREAD_BLOCK_INTERRUPT(me); } /* PR_BlockInterrupt */ -PR_IMPLEMENT(void) PR_UnblockInterrupt() +PR_IMPLEMENT(void) PR_UnblockInterrupt(void) { PRThread *me = PR_CurrentThread(); _PT_THREAD_UNBLOCK_INTERRUPT(me); } /* PR_UnblockInterrupt */ -PR_IMPLEMENT(PRStatus) PR_Yield() +PR_IMPLEMENT(PRStatus) PR_Yield(void) { static PRBool warning = PR_TRUE; if (warning) warning = _PR_Obsolete( @@ -908,7 +908,7 @@ void _PR_InitThreads( PR_SetThreadPriority(thred, priority); } /* _PR_InitThreads */ -PR_IMPLEMENT(PRStatus) PR_Cleanup() +PR_IMPLEMENT(PRStatus) PR_Cleanup(void) { PRThread *me = PR_CurrentThread(); PR_LOG(_pr_thread_lm, PR_LOG_MIN, ("PR_Cleanup: shutting down NSPR")); @@ -920,7 +920,12 @@ PR_IMPLEMENT(PRStatus) PR_Cleanup() PR_WaitCondVar(pt_book.cv, PR_INTERVAL_NO_TIMEOUT); PR_Unlock(pt_book.ml); + _PR_CleanupMW(); + _PR_CleanupDtoa(); + _PR_CleanupCallOnce(); + _PR_ShutdownLinker(); _PR_LogCleanup(); + _PR_CleanupNet(); /* Close all the fd's before calling _PR_CleanupIO */ _PR_CleanupIO(); @@ -1026,7 +1031,7 @@ static void null_signal_handler(PRIntn sig); * conflict with the use of these two signals in our GC support. * So we don't know how to support GC on Linux pthreads. */ -static void init_pthread_gc_support() +static void init_pthread_gc_support(void) { PRIntn rv; @@ -1066,14 +1071,14 @@ static void init_pthread_gc_support() #endif /* defined(_PR_DCETHREADS) */ } -PR_IMPLEMENT(void) PR_SetThreadGCAble() +PR_IMPLEMENT(void) PR_SetThreadGCAble(void) { PR_Lock(pt_book.ml); PR_CurrentThread()->state |= PT_THREAD_GCABLE; PR_Unlock(pt_book.ml); } -PR_IMPLEMENT(void) PR_ClearThreadGCAble() +PR_IMPLEMENT(void) PR_ClearThreadGCAble(void) { PR_Lock(pt_book.ml); PR_CurrentThread()->state &= (~PT_THREAD_GCABLE); @@ -1215,7 +1220,7 @@ static void suspend_signal_handler(PRIntn sig) while (me->suspend & PT_THREAD_SUSPENDED) { #if !defined(FREEBSD) && !defined(NETBSD) && !defined(OPENBSD) \ - && !defined(BSDI) && !defined(VMS) && !defined(UNIXWARE) /*XXX*/ + && !defined(BSDI) && !defined(VMS) && !defined(UNIXWARE) && !defined(DARWIN) /*XXX*/ PRIntn rv; sigwait(&sigwait_set, &rv); #endif @@ -1356,7 +1361,7 @@ PR_IMPLEMENT(void) PR_ResumeTest(PRThread *thred) static pthread_once_t pt_gc_support_control = PTHREAD_ONCE_INIT; -PR_IMPLEMENT(void) PR_SuspendAll() +PR_IMPLEMENT(void) PR_SuspendAll(void) { #ifdef DEBUG PRIntervalTime stime, etime; @@ -1402,7 +1407,7 @@ PR_IMPLEMENT(void) PR_SuspendAll() #endif } /* PR_SuspendAll */ -PR_IMPLEMENT(void) PR_ResumeAll() +PR_IMPLEMENT(void) PR_ResumeAll(void) { #ifdef DEBUG PRIntervalTime stime, etime; diff --git a/pr/src/threads/combined/prucpu.c b/pr/src/threads/combined/prucpu.c index d9159b52..be4203d6 100644 --- a/pr/src/threads/combined/prucpu.c +++ b/pr/src/threads/combined/prucpu.c @@ -59,7 +59,8 @@ static PRUintn _pr_cpuID; static void PR_CALLBACK _PR_CPU_Idle(void *); -static _PRCPU *_PR_CreateCPU(PRThread *thread, PRBool needQueue); +static _PRCPU *_PR_CreateCPU(void); +static PRStatus _PR_StartCPU(_PRCPU *cpu, PRThread *thread); #if !defined(_PR_LOCAL_THREADS_ONLY) static void _PR_RunCPU(void *arg); @@ -69,6 +70,9 @@ void _PR_InitCPUs() { PRThread *me = _PR_MD_CURRENT_THREAD(); + if (_native_threads_only) + return; + _pr_cpuID = 0; _MD_NEW_LOCK( &_pr_cpuLock); #if !defined(_PR_LOCAL_THREADS_ONLY) && !defined(_PR_GLOBAL_THREADS_ONLY) @@ -80,13 +84,13 @@ void _PR_InitCPUs() #ifdef _PR_LOCAL_THREADS_ONLY #ifdef HAVE_CUSTOM_USER_THREADS - if (!_native_threads_only) - _PR_MD_CREATE_PRIMORDIAL_USER_THREAD(me); + _PR_MD_CREATE_PRIMORDIAL_USER_THREAD(me); #endif /* Now start the first CPU. */ - _pr_primordialCPU = _PR_CreateCPU(me, PR_TRUE); + _pr_primordialCPU = _PR_CreateCPU(); _pr_numCPU = 1; + _PR_StartCPU(_pr_primordialCPU, me); _PR_MD_SET_CURRENT_CPU(_pr_primordialCPU); @@ -97,15 +101,16 @@ void _PR_InitCPUs() #else /* Combined MxN model */ + _pr_primordialCPU = _PR_CreateCPU(); + _pr_numCPU = 1; _PR_CreateThread(PR_SYSTEM_THREAD, _PR_RunCPU, - me, + _pr_primordialCPU, PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD, PR_UNJOINABLE_THREAD, 0, _PR_IDLE_THREAD); - _PR_MD_WAIT(me, PR_INTERVAL_NO_TIMEOUT); #endif /* _PR_LOCAL_THREADS_ONLY */ @@ -137,89 +142,113 @@ static _PRCPUQueue *_PR_CreateCPUQueue(void) /* * Create a new CPU. + * + * This function initializes enough of the _PRCPU structure so + * that it can be accessed safely by a global thread or another + * CPU. This function does not create the native thread that + * will run the CPU nor does it initialize the parts of _PRCPU + * that must be initialized by that native thread. + * + * The reason we cannot simply have the native thread create + * and fully initialize a new CPU is that we need to be able to + * create a usable _pr_primordialCPU in _PR_InitCPUs without + * assuming that the primordial CPU thread we created can run + * during NSPR initialization. For example, on Windows while + * new threads can be created by DllMain, they won't be able + * to run during DLL initialization. If NSPR is initialized + * by DllMain, the primordial CPU thread won't run until DLL + * initialization is finished. */ -static _PRCPU *_PR_CreateCPU(PRThread *thread, PRBool needQueue) +static _PRCPU *_PR_CreateCPU(void) { _PRCPU *cpu; - /* - ** Create a new cpu. The assumption this code makes is that the - ** underlying operating system creates a stack to go with the new - ** native thread. That stack will be used by the cpu when pausing. - */ cpu = PR_NEWZAP(_PRCPU); if (cpu) { - cpu->last_clock = PR_IntervalNow(); - - if (needQueue == PR_TRUE) - cpu->queue = _PR_CreateCPUQueue(); - else - cpu->queue = _PR_MD_CURRENT_CPU()->queue; - + cpu->queue = _PR_CreateCPUQueue(); if (!cpu->queue) { PR_DELETE(cpu); return NULL; } - - /* Before we create any threads on this CPU we have to - * set the current CPU - */ - _PR_MD_SET_CURRENT_CPU(cpu); - _PR_MD_INIT_RUNNING_CPU(cpu); - thread->cpu = cpu; - - if (!_native_threads_only) { - - cpu->idle_thread = _PR_CreateThread(PR_SYSTEM_THREAD, - _PR_CPU_Idle, - (void *)cpu, - PR_PRIORITY_NORMAL, - PR_LOCAL_THREAD, - PR_UNJOINABLE_THREAD, - 0, - _PR_IDLE_THREAD); - - if (!cpu->idle_thread) { - /* didn't clean up CPU queue XXXMB */ - PR_DELETE(cpu); - return NULL; - } - cpu->idle_thread->cpu = cpu; - - cpu->idle_thread->no_sched = 0; - } - - cpu->thread = thread; - - if (_pr_cpu_affinity_mask) - PR_SetThreadAffinityMask(thread, _pr_cpu_affinity_mask); - - /* Created a new CPU */ - _PR_CPU_LIST_LOCK(); - cpu->id = _pr_cpuID++; - PR_APPEND_LINK(&cpu->links, &_PR_CPUQ()); - _PR_CPU_LIST_UNLOCK(); - } + } return cpu; } +/* + * Start a new CPU. + * + * 'cpu' is a _PRCPU structure created by _PR_CreateCPU(). + * 'thread' is the native thread that will run the CPU. + * + * If this function fails, 'cpu' is destroyed. + */ +static PRStatus _PR_StartCPU(_PRCPU *cpu, PRThread *thread) +{ + /* + ** Start a new cpu. The assumption this code makes is that the + ** underlying operating system creates a stack to go with the new + ** native thread. That stack will be used by the cpu when pausing. + */ + + PR_ASSERT(!_native_threads_only); + + cpu->last_clock = PR_IntervalNow(); + + /* Before we create any threads on this CPU we have to + * set the current CPU + */ + _PR_MD_SET_CURRENT_CPU(cpu); + _PR_MD_INIT_RUNNING_CPU(cpu); + thread->cpu = cpu; + + cpu->idle_thread = _PR_CreateThread(PR_SYSTEM_THREAD, + _PR_CPU_Idle, + (void *)cpu, + PR_PRIORITY_NORMAL, + PR_LOCAL_THREAD, + PR_UNJOINABLE_THREAD, + 0, + _PR_IDLE_THREAD); + + if (!cpu->idle_thread) { + /* didn't clean up CPU queue XXXMB */ + PR_DELETE(cpu); + return PR_FAILURE; + } + PR_ASSERT(cpu->idle_thread->cpu == cpu); + + cpu->idle_thread->no_sched = 0; + + cpu->thread = thread; + + if (_pr_cpu_affinity_mask) + PR_SetThreadAffinityMask(thread, _pr_cpu_affinity_mask); + + /* Created and started a new CPU */ + _PR_CPU_LIST_LOCK(); + cpu->id = _pr_cpuID++; + PR_APPEND_LINK(&cpu->links, &_PR_CPUQ()); + _PR_CPU_LIST_UNLOCK(); + + return PR_SUCCESS; +} + #if !defined(_PR_GLOBAL_THREADS_ONLY) && !defined(_PR_LOCAL_THREADS_ONLY) /* ** This code is used during a cpu's initial creation. */ static void _PR_RunCPU(void *arg) { - _PRCPU *cpu; + _PRCPU *cpu = (_PRCPU *)arg; PRThread *me = _PR_MD_CURRENT_THREAD(); - PRThread *waiter = (PRThread *) arg; PR_ASSERT(NULL != me); /* - * _PR_CreateCPU calls _PR_CreateThread to create the + * _PR_StartCPU calls _PR_CreateThread to create the * idle thread. Because _PR_CreateThread calls PR_Lock, * the current thread has to remain a global thread - * during the _PR_CreateCPU call so that it can wait for + * during the _PR_StartCPU call so that it can wait for * the lock if the lock is held by another thread. If * we clear the _PR_GLOBAL_SCOPE flag in * _PR_MD_CREATE_PRIMORDIAL_THREAD, the current thread @@ -227,7 +256,7 @@ static void _PR_RunCPU(void *arg) * waiting for the lock because the CPU is not fully * constructed yet. * - * After the CPU is created, it is safe to mark the + * After the CPU is started, it is safe to mark the * current thread as a local thread. */ @@ -236,7 +265,7 @@ static void _PR_RunCPU(void *arg) #endif me->no_sched = 1; - cpu = _PR_CreateCPU(me, PR_TRUE); + _PR_StartCPU(cpu, me); #ifdef HAVE_CUSTOM_USER_THREADS me->flags &= (~_PR_GLOBAL_SCOPE); @@ -246,12 +275,6 @@ static void _PR_RunCPU(void *arg) _PR_MD_SET_CURRENT_THREAD(cpu->thread); me->cpu = cpu; - if (waiter) { - _pr_primordialCPU = cpu; - _pr_numCPU = 1; - _PR_MD_WAKEUP_WAITER(waiter); - } - while(1) { PRInt32 is; if (!_PR_IS_NATIVE_THREAD(me)) _PR_INTSOFF(is); @@ -344,7 +367,8 @@ PR_IMPLEMENT(void) PR_SetConcurrency(PRUintn numCPUs) #else /* combined, MxN thread model */ PRUintn newCPU; - PRThread *cpu; + _PRCPU *cpu; + PRThread *thr; if (!_pr_initialized) _PR_ImplicitInitialization(); @@ -360,9 +384,10 @@ PR_IMPLEMENT(void) PR_SetConcurrency(PRUintn numCPUs) _PR_CPU_LIST_UNLOCK(); for (; newCPU; newCPU--) { - cpu = _PR_CreateThread(PR_SYSTEM_THREAD, + cpu = _PR_CreateCPU(); + thr = _PR_CreateThread(PR_SYSTEM_THREAD, _PR_RunCPU, - NULL, + cpu, PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD, PR_UNJOINABLE_THREAD, diff --git a/pr/src/threads/combined/pruthr.c b/pr/src/threads/combined/pruthr.c index 77236df1..1329bb66 100644 --- a/pr/src/threads/combined/pruthr.c +++ b/pr/src/threads/combined/pruthr.c @@ -85,7 +85,6 @@ PRThread *suspendAllThread = NULL; extern PRCList _pr_active_global_threadQ; extern PRCList _pr_active_local_threadQ; -extern _PRCPU *_pr_primordialCPU; static void _PR_DecrActiveThreadCount(PRThread *thread); static PRThread *_PR_AttachThread(PRThreadType, PRThreadPriority, PRThreadStack *); diff --git a/pr/src/threads/prtpd.c b/pr/src/threads/prtpd.c index 42139329..6d8fd416 100644 --- a/pr/src/threads/prtpd.c +++ b/pr/src/threads/prtpd.c @@ -88,7 +88,7 @@ static PRThreadPrivateDTOR *_pr_tpd_destructors = NULL; /* ** Initialize the thread private data manipulation */ -void _PR_InitTPD() +void _PR_InitTPD(void) { _pr_tpd_destructors = (PRThreadPrivateDTOR*) PR_CALLOC(_PR_TPD_LIMIT * sizeof(PRThreadPrivateDTOR*)); diff --git a/pr/tests/Makefile.in b/pr/tests/Makefile.in index 7e8dbaf7..64870a06 100644 --- a/pr/tests/Makefile.in +++ b/pr/tests/Makefile.in @@ -45,10 +45,6 @@ include $(topsrcdir)/config/config.mk DIRS = dll -ifeq ($(OS_TARGET),OS2) -OS_CFLAGS = $(OS_EXE_CFLAGS) -endif - CSRCS = \ accept.c \ acceptread.c \ @@ -296,8 +292,10 @@ endif ifeq ($(OS_ARCH), HP-UX) LDOPTS += -z -Wl,+s,+b,$(ABSOLUTE_LIB_DIR) ifeq ($(USE_64),1) - LDOPTS += +DA2.0W - EXTRA_LIBS = -lpthread + LDOPTS += +DD64 + endif + ifeq ($(USE_PTHREADS),1) + EXTRA_LIBS = $(LIBPTHREAD) endif endif @@ -484,7 +482,7 @@ ifeq ($(OS_ARCH), WINNT) link $(LDOPTS) $(EXTRA_LDOPTS) $< $(LIBPLC) $(LIBNSPR) $(EXTRA_LIBS) wsock32.lib -out:$@ else ifeq ($(OS_ARCH),OS2) - $(LINK) $(EXEFLAGS) $(LDOPTS) $< $(LIBPLC) $(LIBNSPR) $(OS_LIBS) $(EXTRA_LIBS) + $(LD) $(EXEFLAGS) $(LDOPTS) $< $(LIBPLC) $(LIBNSPR) $(OS_LIBS) $(EXTRA_LIBS) else $(PURE) $(CC) $(XCFLAGS) $< $(LDOPTS) $(LIBPLC) $(LIBNSPR) $(EXTRA_LIBS) -o $@ endif # OS/2 diff --git a/pr/tests/affinity.c b/pr/tests/affinity.c index 513775f7..ee78434a 100644 --- a/pr/tests/affinity.c +++ b/pr/tests/affinity.c @@ -40,6 +40,7 @@ #include #include +#ifndef XP_BEOS /* * Test PR_GetThreadAffinityMask @@ -109,3 +110,12 @@ int main(int argc, char **argv) return 0; } + +#else /* !XP_BEOS */ + +int main() +{ + printf( "This test is not supported on the BeOS\n" ); + return 0; +} +#endif /* !XP_BEOS */ diff --git a/pr/tests/sigpipe.c b/pr/tests/sigpipe.c index 2c708e29..28e7e251 100644 --- a/pr/tests/sigpipe.c +++ b/pr/tests/sigpipe.c @@ -69,7 +69,7 @@ int main(void) #endif #include -int main(void) +static void Test(void *arg) { #ifdef XP_OS2 HFILE pipefd[2]; @@ -79,9 +79,6 @@ int main(void) int rv; char c = '\0'; - /* This initializes NSPR. */ - PR_SetError(0, 0); - #ifdef XP_OS2 if (DosCreatePipe(&pipefd[0], &pipefd[1], 4096) != 0) { #else @@ -103,6 +100,27 @@ int main(void) } close(pipefd[1]); printf("write to broken pipe failed with EPIPE, as expected\n"); +} + +int main(void) +{ + PRThread *thread; + + /* This initializes NSPR. */ + PR_SetError(0, 0); + + thread = PR_CreateThread(PR_USER_THREAD, Test, NULL, PR_PRIORITY_NORMAL, + PR_GLOBAL_THREAD, PR_JOINABLE_THREAD, 0); + if (thread == NULL) { + fprintf(stderr, "PR_CreateThread failed\n"); + exit(1); + } + if (PR_JoinThread(thread) == PR_FAILURE) { + fprintf(stderr, "PR_JoinThread failed\n"); + exit(1); + } + Test(NULL); + printf("PASSED\n"); return 0; } diff --git a/pr/tests/vercheck.c b/pr/tests/vercheck.c index 4235a832..cf3da2e7 100644 --- a/pr/tests/vercheck.c +++ b/pr/tests/vercheck.c @@ -49,12 +49,12 @@ #include /* - * This release (4.2) is backward compatible with the - * 4.0.x and 4.1.x releases. It, of course, is compatible + * This release (4.2.1) is backward compatible with the + * 4.0.x, 4.1.x, and 4.2 releases. It, of course, is compatible * with itself. */ static char *compatible_version[] = { - "4.0", "4.0.1", "4.1", "4.1.1", "4.1.2", "4.1.3", PR_VERSION + "4.0", "4.0.1", "4.1", "4.1.1", "4.1.2", "4.1.3", "4.2", PR_VERSION }; /* @@ -69,7 +69,7 @@ static char *incompatible_version[] = { "3.0", "3.0.1", "3.1", "3.1.1", "3.1.2", "3.1.3", "3.5", "3.5.1", - "4.2.3", + "4.2.2", "4.2.3", "4.3", "4.3.1", "10.0", "11.1", "12.14.20" }; -- cgit v1.2.1