+++ /dev/null
-Makefile
-config-defs.h
-config.cache
-config.log
-config.status
+++ /dev/null
-repo: a4b34919bf34db2ee22acbbc305693c8980b6dc6
-node: 0f03651116c5b34ba48b5a5cd31234303d9806b6
-branch: default
-tag: NSPR_4_10_7_RTM
+++ /dev/null
-syntax: glob
-*~
-*OPT.OBJ/*
-*DBG.OBJ/*
-*DBG.OBJD/*
# other platforms do not.
#
ifeq (,$(filter-out WIN95 WINCE WINMO OS2,$(OS_TARGET)))
-LIBRARY = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION)_s.$(LIB_SUFFIX)
SHARED_LIBRARY = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION).$(DLL_SUFFIX)
-IMPORT_LIBRARY = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION).$(LIB_SUFFIX)
SHARED_LIB_PDB = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION).pdb
+ifdef MSC_VER
+LIBRARY = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION)_s.$(LIB_SUFFIX)
+IMPORT_LIBRARY = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION).$(LIB_SUFFIX)
+else
+LIBRARY = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION)_s.$(LIB_SUFFIX)
+IMPORT_LIBRARY = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION).$(LIB_SUFFIX)
+endif
else
-LIBRARY = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION)_s.$(LIB_SUFFIX)
SHARED_LIBRARY = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION).$(DLL_SUFFIX)
-IMPORT_LIBRARY = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION).$(LIB_SUFFIX)
SHARED_LIB_PDB = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION).pdb
+LIBRARY = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION)_s.$(LIB_SUFFIX)
+IMPORT_LIBRARY = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION).$(LIB_SUFFIX)
endif
else
ifdef MOZ_PROFILE_GENERATE
# Clean up profiling data during PROFILE_GENERATE phase
export::
-ifeq ($(OS_ARCH)_$(NS_USE_GCC), WINNT_)
+ifeq ($(NS_USE_GCC)_$(OS_ARCH),_WINNT)
$(foreach pgd,$(wildcard *.pgd),pgomgr -clear $(pgd);)
else
ifdef NS_USE_GCC
program_prefix=${target_alias}-
MOD_MAJOR_VERSION=4
-MOD_MINOR_VERSION=10
-MOD_PATCH_VERSION=7
+MOD_MINOR_VERSION=12
+MOD_PATCH_VERSION=0
NSPR_MODNAME=nspr20
_HAVE_PTHREADS=
USE_PTHREADS=
if test -n "$gonkdir" ; then
- if test -z "$HOST_CPPFLAGS" ; then
- HOST_CPPFLAGS=" "
- fi
- if test -z "$HOST_CFLAGS" ; then
- HOST_CFLAGS=" "
- fi
- if test -z "$HOST_CXXFLAGS" ; then
- HOST_CXXFLAGS=" "
- fi
- if test -z "$HOST_LDFLAGS" ; then
- HOST_LDFLAGS=" "
- fi
-
$as_echo "#define ANDROID 1" >>confdefs.h
else
CXXFLAGS="-mandroid -I$android_platform/usr/include -fpic -fno-short-enums -fno-exceptions $CXXFLAGS"
LDFLAGS="-mandroid -L$android_platform/usr/lib -Wl,-rpath-link=$android_platform/usr/lib --sysroot=$android_platform $LDFLAGS"
- if test -z "$HOST_CPPFLAGS" ; then
- HOST_CPPFLAGS=" "
- fi
- if test -z "$HOST_CFLAGS" ; then
- HOST_CFLAGS=" "
- fi
- if test -z "$HOST_CXXFLAGS" ; then
- HOST_CXXFLAGS=" "
- fi
- if test -z "$HOST_LDFLAGS" ; then
- HOST_LDFLAGS=" "
- fi
-
$as_echo "#define ANDROID 1" >>confdefs.h
;;
CFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk $CFLAGS"
CXXFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk $CXXFLAGS"
;;
- *:arm*-apple-darwin*)
- _SAVE_CFLAGS=$CFLAGS
- _SAVE_CXXFLAGS=$CXXFLAGS
- CFLAGS="-isysroot $MACOS_SDK_DIR $CFLAGS"
- CXXFLAGS="-isysroot $MACOS_SDK_DIR $CXXFLAGS"
- ;;
esac
for ac_prog in $CC "${target_alias}-gcc" "${target}-gcc"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $HOST_CC" >&5
$as_echo "$HOST_CC" >&6; }
- if test -z "$HOST_CFLAGS"; then
- HOST_CFLAGS="$CFLAGS"
- fi
- if test -z "$HOST_LDFLAGS"; then
- HOST_LDFLAGS="$LDFLAGS"
- fi
CC="$HOST_CC"
CFLAGS="$HOST_CFLAGS"
fi
ac_fn_c_check_header_mongrel "$LINENO" "crt_externs.h" "ac_cv_header_crt_externs_h" "$ac_includes_default"
if test "x$ac_cv_header_crt_externs_h" = xyes; then :
+ $as_echo "#define HAVE_CRT_EXTERNS_H 1" >>confdefs.h
fi
PR_MD_ASFILES=os_Linux_ppc.s
fi
;;
- m68k)
- CFLAGS="$CFLAGS -m68020-60"
- CXXFLAGS="$CXXFLAGS -m68020-60"
- ;;
esac
;;
_MSVC_VER_FILTER='s|.* \([0-9]\+\.[0-9]\+\.[0-9]\+\(\.[0-9]\+\)\?\).*|\1|p'
- CC_VERSION=`"${CC}" -v 2>&1 | sed -ne "$_MSVC_VER_FILTER"`
+ CC_VERSION=`${CC} -v 2>&1 | sed -ne "$_MSVC_VER_FILTER"`
+ if test -z "$CC_VERSION"; then
+ as_fn_error $? "Could not determine MSC version." "$LINENO" 5
+ fi
+
_CC_MAJOR_VERSION=`echo ${CC_VERSION} | awk -F\. '{ print $1 }'`
_CC_MINOR_VERSION=`echo ${CC_VERSION} | awk -F\. '{ print $2 }'`
_CC_RELEASE=`echo ${CC_VERSION} | awk -F\. '{ print $3 }'`
$as_echo "#define HAVE_BSD_FLOCK 1" >>confdefs.h
+ $as_echo "#define HAVE_SOCKLEN_T 1" >>confdefs.h
+
if test -z "$USE_NSPR_THREADS"; then
USE_PTHREADS=1
fi
if test -z "$USE_NSPR_THREADS"; then
USE_PTHREADS=1
fi
- DSO_LDOPTS='-shared -fPIC'
+ DSO_LDOPTS='-shared -fPIC -Wl,-soname,$(notdir $@)'
MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
;;
_SAVE_LIBS="$LIBS"
LIBS="$LIBS $OS_LIBS"
-for ac_func in dladdr gettid lchown setpriority strerror syscall
+for ac_func in dladdr gettid lchown setpriority strerror syscall secure_getenv __secure_getenv
do :
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
dnl = Defaults
dnl ========================================================
MOD_MAJOR_VERSION=4
-MOD_MINOR_VERSION=10
-MOD_PATCH_VERSION=7
+MOD_MINOR_VERSION=12
+MOD_PATCH_VERSION=0
NSPR_MODNAME=nspr20
_HAVE_PTHREADS=
USE_PTHREADS=
if test -n "$gonkdir" ; then
dnl Most things are directly configured by env vars when building for gonk
- dnl prevent cross compile section from using these flags as host flags
- if test -z "$HOST_CPPFLAGS" ; then
- HOST_CPPFLAGS=" "
- fi
- if test -z "$HOST_CFLAGS" ; then
- HOST_CFLAGS=" "
- fi
- if test -z "$HOST_CXXFLAGS" ; then
- HOST_CXXFLAGS=" "
- fi
- if test -z "$HOST_LDFLAGS" ; then
- HOST_LDFLAGS=" "
- fi
-
AC_DEFINE(ANDROID)
else
case "$target" in
CXXFLAGS="-mandroid -I$android_platform/usr/include -fpic -fno-short-enums -fno-exceptions $CXXFLAGS"
LDFLAGS="-mandroid -L$android_platform/usr/lib -Wl,-rpath-link=$android_platform/usr/lib --sysroot=$android_platform $LDFLAGS"
- dnl prevent cross compile section from using these flags as host flags
- if test -z "$HOST_CPPFLAGS" ; then
- HOST_CPPFLAGS=" "
- fi
- if test -z "$HOST_CFLAGS" ; then
- HOST_CFLAGS=" "
- fi
- if test -z "$HOST_CXXFLAGS" ; then
- HOST_CXXFLAGS=" "
- fi
- if test -z "$HOST_LDFLAGS" ; then
- HOST_LDFLAGS=" "
- fi
-
AC_DEFINE(ANDROID)
;;
esac
CFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk $CFLAGS"
CXXFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk $CXXFLAGS"
;;
- *:arm*-apple-darwin*)
- dnl The arm compiler doesn't appear to know about its root by default,
- dnl so explicitly pass it one here. Later on we'll put this in CFLAGS
- dnl anyway.
- _SAVE_CFLAGS=$CFLAGS
- _SAVE_CXXFLAGS=$CXXFLAGS
- CFLAGS="-isysroot $MACOS_SDK_DIR $CFLAGS"
- CXXFLAGS="-isysroot $MACOS_SDK_DIR $CXXFLAGS"
- ;;
esac
AC_CHECK_PROGS(CC, $CC "${target_alias}-gcc" "${target}-gcc", echo)
AC_MSG_ERROR([no acceptable cc found in \$PATH])
fi
AC_MSG_RESULT([$HOST_CC])
- if test -z "$HOST_CFLAGS"; then
- HOST_CFLAGS="$CFLAGS"
- fi
- if test -z "$HOST_LDFLAGS"; then
- HOST_LDFLAGS="$LDFLAGS"
- fi
CC="$HOST_CC"
CFLAGS="$HOST_CFLAGS"
if test "`echo $CC | grep -c '\-arch '`" = "0"; then
CC="$CC -arch $CPU_ARCH"
fi
- AC_CHECK_HEADER(crt_externs.h)
+ AC_CHECK_HEADER(crt_externs.h, AC_DEFINE(HAVE_CRT_EXTERNS_H))
DSO_CFLAGS=-fPIC
DSO_LDOPTS='-dynamiclib -compatibility_version 1 -current_version 1 -all_load -install_name @executable_path/$@ -headerpad_max_install_names'
_OPTIMIZE_FLAGS=-O2
PR_MD_ASFILES=os_Linux_ppc.s
fi
;;
- m68k)
- CFLAGS="$CFLAGS -m68020-60"
- CXXFLAGS="$CXXFLAGS -m68020-60"
- ;;
esac
;;
changequote(,)
_MSVC_VER_FILTER='s|.* \([0-9]\+\.[0-9]\+\.[0-9]\+\(\.[0-9]\+\)\?\).*|\1|p'
changequote([,])
- CC_VERSION=`"${CC}" -v 2>&1 | sed -ne "$_MSVC_VER_FILTER"`
+ CC_VERSION=`${CC} -v 2>&1 | sed -ne "$_MSVC_VER_FILTER"`
+ if test -z "$CC_VERSION"; then
+ AC_MSG_ERROR([Could not determine MSC version.])
+ fi
+
_CC_MAJOR_VERSION=`echo ${CC_VERSION} | awk -F\. '{ print $1 }'`
_CC_MINOR_VERSION=`echo ${CC_VERSION} | awk -F\. '{ print $2 }'`
_CC_RELEASE=`echo ${CC_VERSION} | awk -F\. '{ print $3 }'`
AC_DEFINE(XP_UNIX)
AC_DEFINE(NETBSD)
AC_DEFINE(HAVE_BSD_FLOCK)
+ AC_DEFINE(HAVE_SOCKLEN_T)
if test -z "$USE_NSPR_THREADS"; then
USE_PTHREADS=1
fi
if test -z "$USE_NSPR_THREADS"; then
USE_PTHREADS=1
fi
- DSO_LDOPTS='-shared -fPIC'
+ DSO_LDOPTS='-shared -fPIC -Wl,-soname,$(notdir $@)'
MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
;;
AC_PROG_GCC_TRADITIONAL
_SAVE_LIBS="$LIBS"
LIBS="$LIBS $OS_LIBS"
-AC_CHECK_FUNCS(dladdr gettid lchown setpriority strerror syscall)
+AC_CHECK_FUNCS(dladdr gettid lchown setpriority strerror syscall dnl
+ secure_getenv __secure_getenv)
LIBS="$_SAVE_LIBS"
dnl ========================================================
pool->mask = PR_BITMASK(PR_CeilingLog2(align));
pool->first.next = NULL;
+ /* Set all three addresses in pool->first to the same dummy value.
+ * These addresses are only compared with each other, but never
+ * dereferenced. */
pool->first.base = pool->first.avail = pool->first.limit =
(PRUword)PL_ARENA_ALIGN(pool, &pool->first + 1);
pool->current = &pool->first;
{
PLArena *a;
char *rp; /* returned pointer */
+ PRUint32 nbOld;
PR_ASSERT((nb & pool->mask) == 0);
+ nbOld = nb;
nb = (PRUword)PL_ARENA_ALIGN(pool, nb); /* force alignment */
+ if (nb < nbOld)
+ return NULL;
/* attempt to allocate from arenas at pool->current */
{
PL_MAKE_MEM_NOACCESS((void*)a->avail, a->limit - a->avail);
rp = (char *)a->avail;
a->avail += nb;
+ PR_ASSERT(a->avail <= a->limit);
/* the newly allocated arena is linked after pool->current
* and becomes pool->current */
a->next = pool->current->next;
{
void *newp;
+ if (PR_UINT32_MAX - size < incr)
+ return NULL;
PL_ARENA_ALLOCATE(newp, pool, size + incr);
if (newp)
memcpy(newp, p, size);
/* These definitions are usually provided through the
* sanitizer/asan_interface.h header installed by ASan.
- * See https://code.google.com/p/address-sanitizer/wiki/ManualPoisoning
+ * See https://github.com/google/sanitizers/wiki/AddressSanitizerManualPoisoning
*/
-void __asan_poison_memory_region(void const volatile *addr, size_t size);
-void __asan_unpoison_memory_region(void const volatile *addr, size_t size);
+PR_IMPORT(void) __asan_poison_memory_region(void const volatile *addr, size_t size);
+PR_IMPORT(void) __asan_unpoison_memory_region(void const volatile *addr, size_t size);
#define PL_MAKE_MEM_NOACCESS(addr, size) \
__asan_poison_memory_region((addr), (size))
#define PL_ARENA_ALLOCATE(p, pool, nb) \
PR_BEGIN_MACRO \
PLArena *_a = (pool)->current; \
- PRUint32 _nb = PL_ARENA_ALIGN(pool, nb); \
+ PRUint32 _nb = PL_ARENA_ALIGN(pool, (PRUint32)nb); \
PRUword _p = _a->avail; \
- PRUword _q = _p + _nb; \
- if (_q > _a->limit) { \
+ if (_nb < (PRUint32)nb) { \
+ _p = 0; \
+ } else if (_nb > (_a->limit - _a->avail)) { \
_p = (PRUword)PL_ArenaAllocate(pool, _nb); \
} else { \
- _a->avail = _q; \
+ _a->avail += _nb; \
} \
p = (void *)_p; \
- PL_MAKE_MEM_UNDEFINED(p, nb); \
- PL_ArenaCountAllocation(pool, nb); \
+ if (p) { \
+ PL_MAKE_MEM_UNDEFINED(p, (PRUint32)nb); \
+ PL_ArenaCountAllocation(pool, (PRUint32)nb); \
+ } \
PR_END_MACRO
#define PL_ARENA_GROW(p, pool, size, incr) \
PR_BEGIN_MACRO \
PLArena *_a = (pool)->current; \
- PRUint32 _incr = PL_ARENA_ALIGN(pool, incr); \
- PRUword _p = _a->avail; \
- PRUword _q = _p + _incr; \
- if (_p == (PRUword)(p) + PL_ARENA_ALIGN(pool, size) && \
- _q <= _a->limit) { \
- PL_MAKE_MEM_UNDEFINED((unsigned char *)(p) + size, incr); \
- _a->avail = _q; \
- PL_ArenaCountInplaceGrowth(pool, size, incr); \
+ PRUint32 _incr = PL_ARENA_ALIGN(pool, (PRUint32)incr); \
+ if (_incr < (PRUint32)incr) { \
+ p = NULL; \
+ } else if (_a->avail == (PRUword)(p) + PL_ARENA_ALIGN(pool, size) && \
+ _incr <= (_a->limit - _a->avail)) { \
+ PL_MAKE_MEM_UNDEFINED((unsigned char *)(p) + size, (PRUint32)incr); \
+ _a->avail += _incr; \
+ PL_ArenaCountInplaceGrowth(pool, size, (PRUint32)incr); \
} else { \
- p = PL_ArenaGrow(pool, p, size, incr); \
+ p = PL_ArenaGrow(pool, p, size, (PRUint32)incr); \
+ } \
+ if (p) {\
+ PL_ArenaCountGrowth(pool, size, (PRUint32)incr); \
} \
- PL_ArenaCountGrowth(pool, size, incr); \
PR_END_MACRO
#define PL_ARENA_MARK(pool) ((void *) (pool)->current->avail)
#define PR_ALIGN_OF_POINTER 8
#define PR_ALIGN_OF_WORD 8
+#elif defined(__powerpc64__)
+
+#undef IS_LITTLE_ENDIAN
+#define IS_BIG_ENDIAN 1
+#define IS_64
+
+#define PR_BYTES_PER_BYTE 1
+#define PR_BYTES_PER_SHORT 2
+#define PR_BYTES_PER_INT 4
+#define PR_BYTES_PER_INT64 8
+#define PR_BYTES_PER_LONG 8
+#define PR_BYTES_PER_FLOAT 4
+#define PR_BYTES_PER_DOUBLE 8
+#define PR_BYTES_PER_WORD 8
+#define PR_BYTES_PER_DWORD 8
+
+#define PR_BITS_PER_BYTE 8
+#define PR_BITS_PER_SHORT 16
+#define PR_BITS_PER_INT 32
+#define PR_BITS_PER_INT64 64
+#define PR_BITS_PER_LONG 64
+#define PR_BITS_PER_FLOAT 32
+#define PR_BITS_PER_DOUBLE 64
+#define PR_BITS_PER_WORD 64
+
+#define PR_BITS_PER_BYTE_LOG2 3
+#define PR_BITS_PER_SHORT_LOG2 4
+#define PR_BITS_PER_INT_LOG2 5
+#define PR_BITS_PER_INT64_LOG2 6
+#define PR_BITS_PER_LONG_LOG2 6
+#define PR_BITS_PER_FLOAT_LOG2 5
+#define PR_BITS_PER_DOUBLE_LOG2 6
+#define PR_BITS_PER_WORD_LOG2 6
+
+#define PR_ALIGN_OF_SHORT 2
+#define PR_ALIGN_OF_INT 4
+#define PR_ALIGN_OF_LONG 8
+#define PR_ALIGN_OF_INT64 8
+#define PR_ALIGN_OF_FLOAT 4
+#define PR_ALIGN_OF_DOUBLE 8
+#define PR_ALIGN_OF_POINTER 8
+#define PR_ALIGN_OF_WORD 8
+
+#define PR_BYTES_PER_WORD_LOG2 3
+#define PR_BYTES_PER_DWORD_LOG2 3
+
+#elif defined(__powerpc__)
+
+#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_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 8
+#define PR_ALIGN_OF_POINTER 4
+#define PR_ALIGN_OF_WORD 4
+
+#define PR_BYTES_PER_WORD_LOG2 2
+#define PR_BYTES_PER_DWORD_LOG2 3
+
+#elif defined(__aarch64__)
+
+#undef IS_BIG_ENDIAN
+#define IS_LITTLE_ENDIAN 1
+#define IS_64
+
+#define PR_BYTES_PER_BYTE 1
+#define PR_BYTES_PER_SHORT 2
+#define PR_BYTES_PER_INT 4
+#define PR_BYTES_PER_INT64 8
+#define PR_BYTES_PER_LONG 8
+#define PR_BYTES_PER_FLOAT 4
+#define PR_BYTES_PER_DOUBLE 8
+#define PR_BYTES_PER_WORD 8
+#define PR_BYTES_PER_DWORD 8
+
+#define PR_BITS_PER_BYTE 8
+#define PR_BITS_PER_SHORT 16
+#define PR_BITS_PER_INT 32
+#define PR_BITS_PER_INT64 64
+#define PR_BITS_PER_LONG 64
+#define PR_BITS_PER_FLOAT 32
+#define PR_BITS_PER_DOUBLE 64
+#define PR_BITS_PER_WORD 64
+
+#define PR_BITS_PER_BYTE_LOG2 3
+#define PR_BITS_PER_SHORT_LOG2 4
+#define PR_BITS_PER_INT_LOG2 5
+#define PR_BITS_PER_INT64_LOG2 6
+#define PR_BITS_PER_LONG_LOG2 6
+#define PR_BITS_PER_FLOAT_LOG2 5
+#define PR_BITS_PER_DOUBLE_LOG2 6
+#define PR_BITS_PER_WORD_LOG2 6
+
+#define PR_ALIGN_OF_SHORT 2
+#define PR_ALIGN_OF_INT 4
+#define PR_ALIGN_OF_LONG 8
+#define PR_ALIGN_OF_INT64 8
+#define PR_ALIGN_OF_FLOAT 4
+#define PR_ALIGN_OF_DOUBLE 8
+#define PR_ALIGN_OF_POINTER 8
+#define PR_ALIGN_OF_WORD 8
+
+#define PR_BYTES_PER_WORD_LOG2 3
+#define PR_BYTES_PER_DWORD_LOG2 3
+
+#elif defined(__arm__)
+
+#if defined(__ARMEB__) || defined(__ARM_BIG_ENDIAN__)
+#undef IS_LITTLE_ENDIAN
+#define IS_BIG_ENDIAN 1
+#else
+#undef IS_BIG_ENDIAN
+#define IS_LITTLE_ENDIAN 1
+#endif
+
+#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_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 8
+#define PR_ALIGN_OF_POINTER 4
+#define PR_ALIGN_OF_WORD 4
+
+#define PR_BYTES_PER_WORD_LOG2 2
+#define PR_BYTES_PER_DWORD_LOG2 3
+
+#elif defined(__mips64__)
+
+#if defined(__MIPSEB__) || defined(_MIPSEB)
+#undef IS_LITTLE_ENDIAN
+#define IS_BIG_ENDIAN 1
+#else
+#undef IS_BIG_ENDIAN
+#define IS_LITTLE_ENDIAN 1
+#endif
+
+#define IS_64
+
+#define PR_BYTES_PER_BYTE 1
+#define PR_BYTES_PER_SHORT 2
+#define PR_BYTES_PER_INT 4
+#define PR_BYTES_PER_INT64 8
+#define PR_BYTES_PER_LONG 8
+#define PR_BYTES_PER_FLOAT 4
+#define PR_BYTES_PER_DOUBLE 8
+#define PR_BYTES_PER_WORD 8
+#define PR_BYTES_PER_DWORD 8
+
+#define PR_BITS_PER_BYTE 8
+#define PR_BITS_PER_SHORT 16
+#define PR_BITS_PER_INT 32
+#define PR_BITS_PER_INT64 64
+#define PR_BITS_PER_LONG 64
+#define PR_BITS_PER_FLOAT 32
+#define PR_BITS_PER_DOUBLE 64
+#define PR_BITS_PER_WORD 64
+
+#define PR_BITS_PER_BYTE_LOG2 3
+#define PR_BITS_PER_SHORT_LOG2 4
+#define PR_BITS_PER_INT_LOG2 5
+#define PR_BITS_PER_INT64_LOG2 6
+#define PR_BITS_PER_LONG_LOG2 6
+#define PR_BITS_PER_FLOAT_LOG2 5
+#define PR_BITS_PER_DOUBLE_LOG2 6
+#define PR_BITS_PER_WORD_LOG2 6
+
+#define PR_ALIGN_OF_SHORT 2
+#define PR_ALIGN_OF_INT 4
+#define PR_ALIGN_OF_LONG 8
+#define PR_ALIGN_OF_INT64 8
+#define PR_ALIGN_OF_FLOAT 4
+#define PR_ALIGN_OF_DOUBLE 8
+#define PR_ALIGN_OF_POINTER 8
+#define PR_ALIGN_OF_WORD 8
+
+#define PR_BYTES_PER_WORD_LOG2 3
+#define PR_BYTES_PER_DWORD_LOG2 3
+
+#elif defined(__mips__)
+
+#if defined(__MIPSEB__) || defined(_MIPSEB)
+#undef IS_LITTLE_ENDIAN
+#define IS_BIG_ENDIAN 1
+#else
+#undef IS_BIG_ENDIAN
+#define IS_LITTLE_ENDIAN 1
+#endif
+
+#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_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 8
+#define PR_ALIGN_OF_POINTER 4
+#define PR_ALIGN_OF_WORD 4
+
+#define PR_BYTES_PER_WORD_LOG2 2
+#define PR_BYTES_PER_DWORD_LOG2 3
+
#else
#error "Unknown CPU architecture"
#define _PR_SI_ARCHITECTURE "ia64"
#elif defined(__amd64__)
#define _PR_SI_ARCHITECTURE "amd64"
+#elif defined(__powerpc64__)
+#define _PR_SI_ARCHITECTURE "powerpc64"
+#elif defined(__powerpc__)
+#define _PR_SI_ARCHITECTURE "powerpc"
+#elif defined(__aarch64__)
+#define _PR_SI_ARCHITECTURE "aarch64"
+#elif defined(__arm__)
+#define _PR_SI_ARCHITECTURE "arm"
+#elif defined(__mips64__)
+#define _PR_SI_ARCHITECTURE "mips64"
+#elif defined(__mips__)
+#define _PR_SI_ARCHITECTURE "mips"
#else
#error "Unknown CPU architecture"
#endif
#define _MD_EARLY_INIT _MD_EarlyInit
#define _MD_FINAL_INIT _PR_UnixInit
-#define _MD_INTERVAL_USE_GTOD
+#define _PR_HAVE_CLOCK_MONOTONIC
/*
* We wrapped the select() call. _MD_SELECT refers to the built-in,
#error "Unknown MIPS endianness."
#endif
+#if _MIPS_SIM == _ABI64
+
+#define IS_64
+
+#define PR_BYTES_PER_BYTE 1
+#define PR_BYTES_PER_SHORT 2
+#define PR_BYTES_PER_INT 4
+#define PR_BYTES_PER_INT64 8
+#define PR_BYTES_PER_LONG 8
+#define PR_BYTES_PER_FLOAT 4
+#define PR_BYTES_PER_DOUBLE 8
+#define PR_BYTES_PER_WORD 8
+#define PR_BYTES_PER_DWORD 8
+
+#define PR_BITS_PER_BYTE 8
+#define PR_BITS_PER_SHORT 16
+#define PR_BITS_PER_INT 32
+#define PR_BITS_PER_INT64 64
+#define PR_BITS_PER_LONG 64
+#define PR_BITS_PER_FLOAT 32
+#define PR_BITS_PER_DOUBLE 64
+#define PR_BITS_PER_WORD 64
+
+#define PR_BITS_PER_BYTE_LOG2 3
+#define PR_BITS_PER_SHORT_LOG2 4
+#define PR_BITS_PER_INT_LOG2 5
+#define PR_BITS_PER_INT64_LOG2 6
+#define PR_BITS_PER_LONG_LOG2 6
+#define PR_BITS_PER_FLOAT_LOG2 5
+#define PR_BITS_PER_DOUBLE_LOG2 6
+#define PR_BITS_PER_WORD_LOG2 6
+
+#define PR_ALIGN_OF_SHORT 2
+#define PR_ALIGN_OF_INT 4
+#define PR_ALIGN_OF_LONG 8
+#define PR_ALIGN_OF_INT64 8
+#define PR_ALIGN_OF_FLOAT 4
+#define PR_ALIGN_OF_DOUBLE 8
+#define PR_ALIGN_OF_POINTER 8
+#define PR_ALIGN_OF_WORD 8
+
+#define PR_BYTES_PER_WORD_LOG2 3
+#define PR_BYTES_PER_DWORD_LOG2 3
+
+#else /* _ABI64 */
+
#define PR_BYTES_PER_BYTE 1
#define PR_BYTES_PER_SHORT 2
#define PR_BYTES_PER_INT 4
#define PR_BYTES_PER_WORD_LOG2 2
#define PR_BYTES_PER_DWORD_LOG2 3
+#endif /* _ABI64 */
+
#elif defined(__arm__)
#ifdef __ARMEB__
#define PR_BYTES_PER_WORD_LOG2 2
#define PR_BYTES_PER_DWORD_LOG2 3
+#elif defined(__or1k__)
+
+#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_BITS_PER_BYTE 8
+#define PR_BITS_PER_SHORT 16
+#define PR_BITS_PER_INT 32
+#define PR_BITS_PER_INT64 64
+#define PR_BITS_PER_LONG 32
+#define PR_BITS_PER_FLOAT 32
+#define PR_BITS_PER_DOUBLE 64
+#define PR_BITS_PER_WORD 32
+
+#define PR_BITS_PER_BYTE_LOG2 3
+#define PR_BITS_PER_SHORT_LOG2 4
+#define PR_BITS_PER_INT_LOG2 5
+#define PR_BITS_PER_INT64_LOG2 6
+#define PR_BITS_PER_LONG_LOG2 5
+#define PR_BITS_PER_FLOAT_LOG2 5
+#define PR_BITS_PER_DOUBLE_LOG2 6
+#define PR_BITS_PER_WORD_LOG2 5
+
+#define PR_ALIGN_OF_SHORT 2
+#define PR_ALIGN_OF_INT 4
+#define PR_ALIGN_OF_LONG 4
+#define PR_ALIGN_OF_INT64 4
+#define PR_ALIGN_OF_FLOAT 4
+#define PR_ALIGN_OF_DOUBLE 4
+#define PR_ALIGN_OF_POINTER 4
+#define PR_ALIGN_OF_WORD 4
+
+#define PR_BYTES_PER_WORD_LOG2 2
+#define PR_BYTES_PER_DWORD_LOG2 3
+
#else
#error "Unknown CPU architecture"
#define _PR_SI_ARCHITECTURE "avr32"
#elif defined(__m32r__)
#define _PR_SI_ARCHITECTURE "m32r"
+#elif defined(__or1k__)
+#define _PR_SI_ARCHITECTURE "or1k"
#else
#error "Unknown CPU architecture"
#endif
#define _MD_DEFAULT_STACK_SIZE 65536L
#define _MD_MMAP_FLAGS MAP_PRIVATE
-#if defined(__aarch64__)
+#if defined(__aarch64__) || defined(__mips__)
#define _MD_MINIMUM_STACK_SIZE 0x20000
#endif
#define _MD_ATOMIC_SET _PR_x86_64_AtomicSet
#endif
+#if defined(__or1k__)
+#if defined(__GNUC__)
+/* Use GCC built-in functions */
+#define _PR_HAVE_ATOMIC_OPS
+#define _MD_INIT_ATOMIC()
+#define _MD_ATOMIC_INCREMENT(ptr) __sync_add_and_fetch(ptr, 1)
+#define _MD_ATOMIC_DECREMENT(ptr) __sync_sub_and_fetch(ptr, 1)
+#define _MD_ATOMIC_ADD(ptr, i) __sync_add_and_fetch(ptr, i)
+#define _MD_ATOMIC_SET(ptr, nv) __sync_lock_test_and_set(ptr, nv)
+#endif
+#endif
+
#if defined(__powerpc__) && !defined(__powerpc64__)
#define _PR_HAVE_ATOMIC_OPS
#define _MD_INIT_ATOMIC()
#endif
#endif
+#if defined(__mips__) && defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4)
+/* Use GCC built-in functions */
+#define _PR_HAVE_ATOMIC_OPS
+#define _MD_INIT_ATOMIC()
+#define _MD_ATOMIC_INCREMENT(ptr) __sync_add_and_fetch(ptr, 1)
+#define _MD_ATOMIC_DECREMENT(ptr) __sync_sub_and_fetch(ptr, 1)
+#define _MD_ATOMIC_ADD(ptr, i) __sync_add_and_fetch(ptr, i)
+#define _MD_ATOMIC_SET(ptr, nv) __sync_lock_test_and_set(ptr, nv)
+#endif
+
#if defined(__alpha)
#define _PR_HAVE_ATOMIC_OPS
#define _MD_INIT_ATOMIC()
#define _MD_EARLY_INIT _MD_EarlyInit
#define _MD_FINAL_INIT _PR_UnixInit
-#define HAVE_CLOCK_MONOTONIC
+#define _PR_HAVE_CLOCK_MONOTONIC
/*
* We wrapped the select() call. _MD_SELECT refers to the built-in,
#define _MD_EARLY_INIT _MD_EarlyInit
#define _MD_FINAL_INIT _PR_UnixInit
-#define _MD_INTERVAL_USE_GTOD
+#define _PR_HAVE_CLOCK_MONOTONIC
/*
* We wrapped the select() call. _MD_SELECT refers to the built-in,
#define _MD_EARLY_INIT _MD_EarlyInit
#define _MD_FINAL_INIT _PR_UnixInit
-#define _MD_INTERVAL_USE_GTOD
+#define _PR_HAVE_CLOCK_MONOTONIC
/*
* We wrapped the select() call. _MD_SELECT refers to the built-in,
#define _MD_INTERVAL_PER_SEC _PR_UNIX_TicksPerSecond
#endif
-#ifdef HAVE_CLOCK_MONOTONIC
+#ifdef _PR_HAVE_CLOCK_MONOTONIC
extern PRIntervalTime _PR_UNIX_GetInterval2(void);
extern PRIntervalTime _PR_UNIX_TicksPerSecond2(void);
#define _MD_INTERVAL_INIT()
defined(__powerpc__) || \
(defined(__arm__) && \
defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4)) || \
- defined(__aarch64__) || defined(__alpha))))
+ defined(__aarch64__) || defined(__alpha) || \
+ (defined(__mips__) && \
+ defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4)))))
/*
* Because the GCC manual warns that some processors may support
NSPR_API(char*) PR_GetEnv(const char *var);
/*
+** PR_GetEnvSecure() -- get a security-sensitive environment variable
+**
+** Description:
+**
+** PR_GetEnvSecure() is similar to PR_GetEnv(), but it returns NULL if
+** the program was run with elevated privilege (e.g., setuid or setgid
+** on Unix). This can be used for cases like log file paths which
+** could otherwise be used for privilege escalation. Note that some
+** platforms may have platform-specific privilege elevation mechanisms
+** not recognized by this function; see the implementation for details.
+*/
+NSPR_API(char*) PR_GetEnvSecure(const char *var);
+
+/*
** PR_SetEnv() -- set, unset or change an environment variable
**
** Description:
*/
NSPR_API(PRStatus) PR_SetEnv(const char *string);
+/*
+** PR_DuplicateEnvironment() -- Obtain a copy of the environment.
+**
+** Description:
+** PR_DuplicateEnvironment() copies the environment so that it can be
+** modified without changing the current process's environment, and
+** then passed to interfaces such as POSIX execve(). In particular,
+** this avoids needing to allocate memory or take locks in the child
+** after a fork(); neither of these is allowed by POSIX after a
+** multithreaded process calls fork(), and PR_SetEnv does both.
+**
+** Inputs:
+** none
+**
+** Returns:
+** A pointer to a null-terminated array of null-terminated strings,
+** like the traditional global variable "environ". The array and
+** the strings are allocated with PR_Malloc(), and it is the
+** caller's responsibility to free them.
+**
+** In case of memory allocation failure, or if the operating system
+** doesn't support reading the entire environment through the global
+** variable "environ" or similar, returns NULL instead.
+**
+** Restrictions:
+** Similarly to PR_GetEnv(), this function may not interoperate as
+** expected with the operating system's native environment accessors.
+*/
+NSPR_API(char **) PR_DuplicateEnvironment(void);
+
PR_END_EXTERN_C
#endif /* prenv_h___ */
** The format of the version string is
** "<major version>.<minor version>[.<patch level>] [<Beta>]"
*/
-#define PR_VERSION "4.10.7"
+#define PR_VERSION "4.12"
#define PR_VMAJOR 4
-#define PR_VMINOR 10
-#define PR_VPATCH 7
+#define PR_VMINOR 12
+#define PR_VPATCH 0
#define PR_BETA PR_FALSE
/*
*/
NSPR_API(void) PR_LogFlush(void);
-NSPR_API(void) PR_Assert(const char *s, const char *file, PRIntn ln);
+NSPR_API(void) PR_Assert(const char *s, const char *file, PRIntn ln)
+ PR_PRETEND_NORETURN;
#if defined(DEBUG) || defined(FORCE_PR_LOG)
#define PR_LOGGING 1
/* Format a time value into a buffer. Same semantics as strftime() */
NSPR_API(PRUint32) PR_FormatTime(char *buf, int buflen, const char *fmt,
- const PRExplodedTime *tm);
+ const PRExplodedTime *time);
-/* Format a time value into a buffer. Time is always in US English format, regardless
- * of locale setting.
+/* Format a time value into a buffer. Time is always in US English format,
+ * regardless of locale setting.
*/
NSPR_API(PRUint32)
-PR_FormatTimeUSEnglish( char* buf, PRUint32 bufSize,
- const char* format, const PRExplodedTime* tm );
+PR_FormatTimeUSEnglish(char *buf, PRUint32 bufSize,
+ const char *format, const PRExplodedTime *time);
PR_END_EXTERN_C
typedef unsigned long PRUword;
#endif
+/*
+ * PR_PRETEND_NORETURN, specified at the end of a function declaration,
+ * indicates that for the purposes of static analysis, this function does not
+ * return. (The function definition does not need to be annotated.)
+ *
+ * void PR_Assert(const char *s, const char *file, PRIntn ln)
+ * PR_PRETEND_NORETURN;
+ *
+ * Some static analyzers, like scan-build from clang, can use this information
+ * to eliminate false positives. From the upstream documentation of
+ * scan-build:
+ * This attribute is useful for annotating assertion handlers that actually
+ * can return, but for the purpose of using the analyzer we want to pretend
+ * that such functions do not return.
+ */
+#ifdef __clang_analyzer__
+#if __has_extension(attribute_analyzer_noreturn)
+#define PR_PRETEND_NORETURN __attribute__((analyzer_noreturn))
+#endif
+#endif
+
+#ifndef PR_PRETEND_NORETURN
+#define PR_PRETEND_NORETURN /* no support */
+#endif
+
#if defined(NO_NSPR_10_SUPPORT)
#else
/********* ???????????????? FIX ME ??????????????????????????? *****/
ifeq ($(OS_ARCH),WINNT)
ifdef NS_USE_GCC
-OS_LIBS = -ladvapi32 -lws2_32 -lwinmm
+OS_LIBS = -ladvapi32 -lws2_32 -lmswsock -lwinmm
else
-OS_LIBS = advapi32.lib ws2_32.lib winmm.lib
+OS_LIBS = advapi32.lib ws2_32.lib mswsock.lib winmm.lib
endif
endif
{
case RCNetAddr::any: how = PR_IpAddrAny; break;
case RCNetAddr::loopback: how = PR_IpAddrLoopback; break;
- default: PR_ASSERT(!"This can't happen -- and did!");
+ default: PR_NOT_REACHED("This can't happen -- and did!");
}
(void)PR_InitializeNetAddr(how, port, &address);
} /* RCNetAddr::RCNetAddr */
{
PRLock *ml;
PRIntn count;
- PRStack *stack;
PRFileDesc *head, *tail;
PRIntn limit_low, limit_high;
} _PR_Fd_Cache;
static _PR_Fd_Cache _pr_fd_cache;
-static PRFileDesc **stack2fd = &(((PRFileDesc*)NULL)->higher);
/*
*/
if (0 == _pr_fd_cache.limit_high)
{
- PRStackElem *pop;
- PR_ASSERT(NULL != _pr_fd_cache.stack);
- pop = PR_StackPop(_pr_fd_cache.stack);
- if (NULL == pop) goto allocate;
- fd = (PRFileDesc*)((PRPtrdiff)pop - (PRPtrdiff)stack2fd);
+ goto allocate;
}
else
{
fd->identity = PR_INVALID_IO_LAYER;
fd->secret->state = _PR_FILEDESC_FREED;
- if (0 == _pr_fd_cache.limit_high)
- {
- PR_StackPush(_pr_fd_cache.stack, (PRStackElem*)(&fd->higher));
- }
- else
+ if (0 != _pr_fd_cache.limit_high)
{
- if (_pr_fd_cache.count > _pr_fd_cache.limit_high)
- {
- PR_Free(fd->secret);
- PR_Free(fd);
- }
- else
+ if (_pr_fd_cache.count < _pr_fd_cache.limit_high)
{
PR_Lock(_pr_fd_cache.ml);
if (NULL == _pr_fd_cache.tail)
fd->higher = NULL; /* always so */
_pr_fd_cache.count += 1; /* count the new entry */
PR_Unlock(_pr_fd_cache.ml);
+ return;
}
}
+
+ PR_Free(fd->secret);
+ PR_Free(fd);
} /* _PR_Putfd */
PR_IMPLEMENT(PRStatus) PR_SetFDCacheSize(PRIntn low, PRIntn high)
if (low > high) low = high; /* sanity check the params */
PR_Lock(_pr_fd_cache.ml);
- if (0 == high) /* shutting down or staying down */
- {
- if (0 != _pr_fd_cache.limit_high) /* shutting down */
- {
- _pr_fd_cache.limit_high = 0; /* stop use */
- /*
- ** Hold the lock throughout - nobody's going to want it
- ** other than another caller to this routine. Just don't
- ** let that happen.
- **
- ** Put all the cached fds onto the new cache.
- */
- while (NULL != _pr_fd_cache.head)
- {
- PRFileDesc *fd = _pr_fd_cache.head;
- _pr_fd_cache.head = fd->higher;
- PR_StackPush(_pr_fd_cache.stack, (PRStackElem*)(&fd->higher));
- }
- _pr_fd_cache.limit_low = 0;
- _pr_fd_cache.tail = NULL;
- _pr_fd_cache.count = 0;
- }
- }
- else /* starting up or just adjusting parameters */
- {
- PRBool was_using_stack = (0 == _pr_fd_cache.limit_high);
- _pr_fd_cache.limit_low = low;
- _pr_fd_cache.limit_high = high;
- if (was_using_stack) /* was using stack - feed into cache */
- {
- PRStackElem *pop;
- while (NULL != (pop = PR_StackPop(_pr_fd_cache.stack)))
- {
- PRFileDesc *fd = (PRFileDesc*)
- ((PRPtrdiff)pop - (PRPtrdiff)stack2fd);
- if (NULL == _pr_fd_cache.tail) _pr_fd_cache.tail = fd;
- fd->higher = _pr_fd_cache.head;
- _pr_fd_cache.head = fd;
- _pr_fd_cache.count += 1;
- }
- }
- }
+ _pr_fd_cache.limit_high = high;
+ _pr_fd_cache.limit_low = low;
PR_Unlock(_pr_fd_cache.ml);
return PR_SUCCESS;
} /* PR_SetFDCacheSize */
_pr_fd_cache.ml = PR_NewLock();
PR_ASSERT(NULL != _pr_fd_cache.ml);
- _pr_fd_cache.stack = PR_CreateStack("FD");
- PR_ASSERT(NULL != _pr_fd_cache.stack);
} /* _PR_InitFdCache */
void _PR_CleanupFdCache(void)
{
PRFileDesc *fd, *next;
- PRStackElem *pop;
for (fd = _pr_fd_cache.head; fd != NULL; fd = next)
{
_pr_fd_cache.count = 0;
PR_DestroyLock(_pr_fd_cache.ml);
_pr_fd_cache.ml = NULL;
- while ((pop = PR_StackPop(_pr_fd_cache.stack)) != NULL)
- {
- fd = (PRFileDesc*)((PRPtrdiff)pop - (PRPtrdiff)stack2fd);
- PR_DELETE(fd->secret);
- PR_DELETE(fd);
- }
- PR_DestroyStack(_pr_fd_cache.stack);
- _pr_fd_cache.stack = NULL;
} /* _PR_CleanupFdCache */
/* prfdcach.c */
PRIntn _PR_InvalidInt(void)
{
- PR_ASSERT(!"I/O method is invalid");
+ PR_NOT_REACHED("I/O method is invalid");
PR_SetError(PR_INVALID_METHOD_ERROR, 0);
return -1;
} /* _PR_InvalidInt */
PRInt16 _PR_InvalidInt16(void)
{
- PR_ASSERT(!"I/O method is invalid");
+ PR_NOT_REACHED("I/O method is invalid");
PR_SetError(PR_INVALID_METHOD_ERROR, 0);
return -1;
} /* _PR_InvalidInt */
{
PRInt64 rv;
LL_I2L(rv, -1);
- PR_ASSERT(!"I/O method is invalid");
+ PR_NOT_REACHED("I/O method is invalid");
PR_SetError(PR_INVALID_METHOD_ERROR, 0);
return rv;
} /* _PR_InvalidInt */
PRStatus _PR_InvalidStatus(void)
{
- PR_ASSERT(!"I/O method is invalid");
+ PR_NOT_REACHED("I/O method is invalid");
PR_SetError(PR_INVALID_METHOD_ERROR, 0);
return PR_FAILURE;
} /* _PR_InvalidDesc */
PRFileDesc *_PR_InvalidDesc(void)
{
- PR_ASSERT(!"I/O method is invalid");
+ PR_NOT_REACHED("I/O method is invalid");
PR_SetError(PR_INVALID_METHOD_ERROR, 0);
return NULL;
} /* _PR_InvalidDesc */
}
PR_SetLogBuffering(isSync ? 0 : bufSize);
-#ifdef XP_UNIX
- if ((getuid() != geteuid()) || (getgid() != getegid())) {
- return;
- }
-#endif /* XP_UNIX */
-
- ev = PR_GetEnv("NSPR_LOG_FILE");
+ ev = PR_GetEnvSecure("NSPR_LOG_FILE");
if (ev && ev[0]) {
if (!PR_SetLogFile(ev)) {
#ifdef XP_PC
PR_IMPLEMENT(void) PR_Abort(void)
{
PR_LogPrint("Aborting");
+#ifdef ANDROID
+ __android_log_write(ANDROID_LOG_ERROR, "PRLog", "Aborting");
+#endif
abort();
}
fflush(stderr);
#ifdef WIN32
DebugBreak();
-#endif
-#ifdef XP_OS2
+#elif defined(XP_OS2)
asm("int $3");
+#elif defined(ANDROID)
+ __android_log_assert(NULL, "PRLog", "Assertion failure: %s, at %s:%d\n",
+ s, file, ln);
#endif
abort();
}
PR_Lock(group->ml);
if (_prmw_running != group->state)
{
+ PR_DELETE(poll_list);
PR_SetError(PR_INVALID_STATE_ERROR, 0);
goto aborted;
}
if (closesocket(bottom->secret->md.osfd) == SOCKET_ERROR)
{
fprintf(stderr, "closesocket failed: %d\n", WSAGetLastError());
- PR_ASSERT(!"What shall I do?");
+ PR_NOT_REACHED("What shall I do?");
}
}
return;
#include "prlog.h"
#include "prmem.h"
-#ifdef _MSC_VER
+#if defined(_MSC_VER) && _MSC_VER < 1900
#define snprintf _snprintf
#endif
char *base;
char *cur;
- PRUint32 maxlen;
+ PRUint32 maxlen; /* Must not exceed PR_INT32_MAX. */
int (*func)(void *arg, const char *sp, PRUint32 len);
void *arg;
#define NAS_DEFAULT_NUM 20 /* default number of NumberedArgument array */
-
+/*
+** For numeric types, the signed versions must have even values,
+** and their corresponding unsigned versions must have the subsequent
+** odd value.
+*/
#define TYPE_INT16 0
#define TYPE_UINT16 1
#define TYPE_INTN 2
/*
** BuildArgArray stands for Numbered Argument list Sprintf
-** for example,
-** fmp = "%4$i, %2$d, %3s, %1d";
+** for example,
+** fmt = "%4$i, %2$d, %3s, %1d";
** the number must start from 1, and no gap among them
*/
nas[cn].type = TYPE_INT64;
c = *p++;
}
+ } else if (c == 'z') {
+ if (sizeof(size_t) == sizeof(PRInt32)) {
+ nas[ cn ].type = TYPE_INT32;
+ } else if (sizeof(size_t) == sizeof(PRInt64)) {
+ nas[ cn ].type = TYPE_INT64;
+ } else {
+ nas[ cn ].type = TYPE_UNKNOWN;
+ }
+ c = *p++;
}
/* format */
char *hexp;
int rv, i;
struct NumArg* nas = NULL;
- struct NumArg* nap;
+ struct NumArg* nap = NULL;
struct NumArg nasArray[ NAS_DEFAULT_NUM ];
char pattern[20];
const char* dolPt = NULL; /* in "%4$.2f", dolPt will point to . */
type = TYPE_INT64;
c = *fmt++;
}
+ } else if (c == 'z') {
+ if (sizeof(size_t) == sizeof(PRInt32)) {
+ type = TYPE_INT32;
+ } else if (sizeof(size_t) == sizeof(PRInt64)) {
+ type = TYPE_INT64;
+ }
+ c = *fmt++;
}
/* format */
{
int rv;
+ /*
+ ** We will add len to ss->maxlen at the end of the function. First check
+ ** if ss->maxlen + len would overflow or be greater than PR_INT32_MAX.
+ */
+ if (PR_UINT32_MAX - ss->maxlen < len || ss->maxlen + len > PR_INT32_MAX) {
+ return -1;
+ }
rv = (*ss->func)(ss->arg, sp, len);
if (rv < 0) {
return rv;
PRUint32 newlen;
off = ss->cur - ss->base;
+ if (PR_UINT32_MAX - len < off) {
+ /* off + len would be too big. */
+ return -1;
+ }
if (off + len >= ss->maxlen) {
/* Grow the buffer */
- newlen = ss->maxlen + ((len > 32) ? len : 32);
+ PRUint32 increment = (len > 32) ? len : 32;
+ if (PR_UINT32_MAX - ss->maxlen < increment) {
+ /* ss->maxlen + increment would overflow. */
+ return -1;
+ }
+ newlen = ss->maxlen + increment;
+ if (newlen > PR_INT32_MAX) {
+ return -1;
+ }
if (ss->base) {
newbase = (char*) PR_REALLOC(ss->base, newlen);
} else {
SprintfState ss;
PRUint32 n;
- PR_ASSERT((PRInt32)outlen > 0);
- if ((PRInt32)outlen <= 0) {
+ PR_ASSERT(outlen != 0 && outlen <= PR_INT32_MAX);
+ if (outlen == 0 || outlen > PR_INT32_MAX) {
return 0;
}
ss.stuff = GrowStuff;
if (last) {
- int lastlen = strlen(last);
+ size_t lastlen = strlen(last);
+ if (lastlen > PR_INT32_MAX) {
+ return 0;
+ }
ss.base = last;
ss.cur = last + lastlen;
ss.maxlen = lastlen;
GetInt(ScanfState *state, int code)
{
char buf[FMAX + 1], *p;
- int ch;
+ int ch = 0;
static const char digits[] = "0123456789abcdefABCDEF";
PRBool seenDigit = PR_FALSE;
int base;
GetFloat(ScanfState *state)
{
char buf[FMAX + 1], *p;
- int ch;
+ int ch = 0;
PRBool seenDigit = PR_FALSE;
if (state->width == 0 || state->width > FMAX) {
* fail (the library is not on the _pr_loadmap list),
* but don't wipe out an error from dlclose/shl_unload.
*/
- PR_ASSERT(!"_pr_loadmap and lib->refCount inconsistent");
+ PR_NOT_REACHED("_pr_loadmap and lib->refCount inconsistent");
if (result == 0) {
PR_SetError(PR_INVALID_ARGUMENT_ERROR, 0);
status = PR_FAILURE;
_PR_MD_SETTHREADAFFINITYMASK(PRThread *thread, PRUint32 mask )
{
/* Can we do this on OS/2? Only on SMP versions? */
- PR_ASSERT(!"Not implemented");
+ PR_NOT_REACHED("Not implemented");
return 0;
/* This is what windows does:
_PR_MD_GETTHREADAFFINITYMASK(PRThread *thread, PRUint32 *mask)
{
/* Can we do this on OS/2? Only on SMP versions? */
- PR_ASSERT(!"Not implemented");
+ PR_NOT_REACHED("Not implemented");
return 0;
/* This is what windows does:
/* Android <= 19 doesn't have mmap64. */
#if defined(ANDROID) && __ANDROID_API__ <= 19
-extern void *__mmap2(void *, size_t, int, int, int, size_t);
+PR_IMPORT(void) *__mmap2(void *, size_t, int, int, int, size_t);
#define ANDROID_PAGE_SIZE 4096
}
#endif
-#if defined(HAVE_CLOCK_MONOTONIC)
+#if defined(_PR_HAVE_CLOCK_MONOTONIC)
PRIntervalTime _PR_UNIX_GetInterval2()
{
struct timespec time;
*
*/
+/* Mozilla's build system defines this globally. */
+#ifdef WIN32_LEAN_AND_MEAN
+#undef WIN32_LEAN_AND_MEAN
+#endif
#include "primpl.h"
#ifdef WINCE
0l, 0l,
0x0l, 0xffffffffl );
if ( rv == 0 ) {
- DWORD rc = GetLastError();
+ DWORD err = GetLastError();
+ _PR_MD_MAP_DEFAULT_ERROR(err);
PR_LOG( _pr_io_lm, PR_LOG_ERROR,
- ("_PR_MD_LOCKFILE() failed. Error: %d", rc ));
+ ("_PR_MD_LOCKFILE() failed. Error: %d", err ));
rc = PR_FAILURE;
}
** suspending). Therefore, get a real handle from
** the pseudo handle via DuplicateHandle(...)
*/
- DuplicateHandle(
+ BOOL ok = DuplicateHandle(
GetCurrentProcess(), /* Process of source handle */
GetCurrentThread(), /* Pseudo Handle to dup */
GetCurrentProcess(), /* Process of handle */
0L, /* access flags */
FALSE, /* Inheritable */
DUPLICATE_SAME_ACCESS); /* Options */
+ if (!ok) {
+ return PR_FAILURE;
+ }
+ thread->id = GetCurrentThreadId();
+ thread->md.id = thread->id;
}
/* Create the blocking IO semaphore */
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include <string.h>
+#include <stdlib.h>
#include "primpl.h"
+#include "prmem.h"
+
+#if defined(XP_UNIX)
+#include <unistd.h>
+#if defined(DARWIN)
+#if defined(HAVE_CRT_EXTERNS_H)
+#include <crt_externs.h>
+#endif /* HAVE_CRT_EXTERNS_H */
+#else /* DARWIN */
+PR_IMPORT_DATA(char **) environ;
+#endif /* DARWIN */
+#endif /* XP_UNIX */
+
+#if !defined(HAVE_SECURE_GETENV) && defined(HAVE___SECURE_GETENV)
+#define secure_getenv __secure_getenv
+#define HAVE_SECURE_GETENV 1
+#endif
/* Lock used to lock the environment */
#if defined(_PR_NO_PREEMPT)
return ev;
}
+PR_IMPLEMENT(char*) PR_GetEnvSecure(const char *var)
+{
+#ifdef HAVE_SECURE_GETENV
+ char *ev;
+
+ if (!_pr_initialized) _PR_ImplicitInitialization();
+
+ _PR_LOCK_ENV();
+ ev = secure_getenv(var);
+ _PR_UNLOCK_ENV();
+
+ return ev;
+#else
+#ifdef XP_UNIX
+ /*
+ ** Fall back to checking uids and gids. This won't detect any other
+ ** privilege-granting mechanisms the platform may have. This also
+ ** can't detect the case where the process already called
+ ** setuid(geteuid()) and/or setgid(getegid()).
+ */
+ if (getuid() != geteuid() || getgid() != getegid()) {
+ return NULL;
+ }
+#endif /* XP_UNIX */
+ return PR_GetEnv(var);
+#endif /* HAVE_SECURE_GETENV */
+}
+
PR_IMPLEMENT(PRStatus) PR_SetEnv(const char *string)
{
PRIntn result;
if (!_pr_initialized) _PR_ImplicitInitialization();
- if ( !strchr(string, '=')) return(PR_FAILURE);
+ if (!strchr(string, '=')) return(PR_FAILURE);
+
+ _PR_LOCK_ENV();
+ result = _PR_MD_PUT_ENV((char*)string);
+ _PR_UNLOCK_ENV();
+ return result ? PR_FAILURE : PR_SUCCESS;
+}
+
+#if defined(XP_UNIX) && (!defined(DARWIN) || defined(HAVE_CRT_EXTERNS_H))
+PR_IMPLEMENT(char **) PR_DuplicateEnvironment(void)
+{
+ char **the_environ, **result, **end, **src, **dst;
_PR_LOCK_ENV();
- result = _PR_MD_PUT_ENV(string);
+#ifdef DARWIN
+ the_environ = *(_NSGetEnviron());
+#else
+ the_environ = environ;
+#endif
+
+ for (end = the_environ; *end != NULL; end++)
+ /* empty loop body */;
+
+ result = (char **)PR_Malloc(sizeof(char *) * (end - the_environ + 1));
+ if (result != NULL) {
+ for (src = the_environ, dst = result; src != end; src++, dst++) {
+ size_t len;
+
+ len = strlen(*src) + 1;
+ *dst = PR_Malloc(len);
+ if (*dst == NULL) {
+ /* Allocation failed. Must clean up the half-copied env. */
+ char **to_delete;
+
+ for (to_delete = result; to_delete != dst; to_delete++) {
+ PR_Free(*to_delete);
+ }
+ PR_Free(result);
+ result = NULL;
+ goto out;
+ }
+ memcpy(*dst, *src, len);
+ }
+ *dst = NULL;
+ }
+ out:
_PR_UNLOCK_ENV();
- return (result)? PR_FAILURE : PR_SUCCESS;
+ return result;
+}
+#else
+/* This platform doesn't support raw access to the environ block. */
+PR_IMPLEMENT(char **) PR_DuplicateEnvironment(void)
+{
+ return NULL;
}
+#endif
while (1) {
if ((ptr[len] == ':') && (strncmp(ptr, name, len) == 0)) {
ptr += len + 1;
- PR_sscanf(ptr, "%d:0x%" PR_SCNxOSFD, &fileType, &osfd);
+ if (PR_sscanf(ptr, "%d:0x%" PR_SCNxOSFD, &fileType, &osfd) != 2) {
+ PR_SetError(PR_UNKNOWN_ERROR, 0);
+ return NULL;
+ }
switch ((PRDescType)fileType) {
case PR_DESC_FILE:
fd = PR_ImportFile(osfd);
#if defined(SOLARIS) || (defined(BSDI) && defined(_REENTRANT)) \
|| (defined(LINUX) && defined(_REENTRANT) \
- && !(defined(__GLIBC__) && __GLIBC__ >= 2) \
- && !defined(ANDROID))
+ && defined(__GLIBC__) && __GLIBC__ < 2)
#define _PR_HAVE_GETPROTO_R
#define _PR_HAVE_GETPROTO_R_POINTER
#endif
const char *name
)
{
- PR_ASSERT(!"Not implemented"); /* Not implemented yet */
+ PR_NOT_REACHED("Not implemented"); /* Not implemented yet */
PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0);
return NULL;
} /* end PR_CreateOrderedLock() */
PROrderedLock *lock
)
{
- PR_ASSERT(!"Not implemented"); /* Not implemented yet */
+ PR_NOT_REACHED("Not implemented"); /* Not implemented yet */
PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0);
} /* end PR_DestroyOrderedLock() */
PROrderedLock *lock
)
{
- PR_ASSERT(!"Not implemented"); /* Not implemented yet */
+ PR_NOT_REACHED("Not implemented"); /* Not implemented yet */
PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0);
} /* end PR_LockOrderedLock() */
PROrderedLock *lock
)
{
- PR_ASSERT(!"Not implemented"); /* Not implemented yet */
+ PR_NOT_REACHED("Not implemented"); /* Not implemented yet */
PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0);
return PR_FAILURE;
} /* end PR_UnlockOrderedLock() */
/* BSD-derived systems use sysctl() to get the number of processors */
#if defined(BSDI) || defined(FREEBSD) || defined(NETBSD) \
- || defined(OPENBSD) || defined(DARWIN)
+ || defined(OPENBSD) || defined(DRAGONFLY) || defined(DARWIN)
#define _PR_HAVE_SYSCTL
#include <sys/param.h>
#include <sys/sysctl.h>
if (pageSize >= 0 && pageCount >= 0)
bytes = (PRUint64) pageSize * pageCount;
-#elif defined(NETBSD) || defined(OPENBSD)
+#elif defined(NETBSD) || defined(OPENBSD) \
+ || defined(FREEBSD) || defined(DRAGONFLY)
int mib[2];
int rc;
+#ifdef HW_PHYSMEM64
uint64_t memSize;
+#else
+ unsigned long memSize;
+#endif
size_t len = sizeof(memSize);
mib[0] = CTL_HW;
+#ifdef HW_PHYSMEM64
mib[1] = HW_PHYSMEM64;
+#else
+ mib[1] = HW_PHYSMEM;
+#endif
rc = sysctl(mib, 2, &memSize, &len, NULL, 0);
if (-1 != rc) {
bytes = memSize;
*/
PR_IMPLEMENT(PRUint32)
-PR_FormatTime(char *buf, int buflen, const char *fmt, const PRExplodedTime *tm)
+PR_FormatTime(char *buf, int buflen, const char *fmt,
+ const PRExplodedTime *time)
{
size_t rv;
struct tm a;
struct tm *ap;
- if (tm) {
+ if (time) {
ap = &a;
- a.tm_sec = tm->tm_sec;
- a.tm_min = tm->tm_min;
- a.tm_hour = tm->tm_hour;
- a.tm_mday = tm->tm_mday;
- a.tm_mon = tm->tm_month;
- a.tm_wday = tm->tm_wday;
- a.tm_year = tm->tm_year - 1900;
- a.tm_yday = tm->tm_yday;
- a.tm_isdst = tm->tm_params.tp_dst_offset ? 1 : 0;
+ a.tm_sec = time->tm_sec;
+ a.tm_min = time->tm_min;
+ a.tm_hour = time->tm_hour;
+ a.tm_mday = time->tm_mday;
+ a.tm_mon = time->tm_month;
+ a.tm_wday = time->tm_wday;
+ a.tm_year = time->tm_year - 1900;
+ a.tm_yday = time->tm_yday;
+ a.tm_isdst = time->tm_params.tp_dst_offset ? 1 : 0;
/*
* On some platforms, for example SunOS 4, struct tm has two
|| defined(NETBSD) || defined(OPENBSD) || defined(FREEBSD) \
|| defined(DARWIN) || defined(SYMBIAN) || defined(ANDROID)
a.tm_zone = NULL;
- a.tm_gmtoff = tm->tm_params.tp_gmt_offset +
- tm->tm_params.tp_dst_offset;
+ a.tm_gmtoff = time->tm_params.tp_gmt_offset +
+ time->tm_params.tp_dst_offset;
#endif
} else {
ap = NULL;
int pollfd_cnt, pollfds_used;
int rv;
PRCList *qp, *nextqp;
-PRPollDesc *pollfds;
-PRJob **polljobs;
+PRPollDesc *pollfds = NULL;
+PRJob **polljobs = NULL;
int poll_timeout;
PRIntervalTime now;
logLostData = 0; /* reset at entry */
logState = LogReset;
-#ifdef XP_UNIX
- if ((getuid() != geteuid()) || (getgid() != getegid())) {
- return NULL;
- }
-#endif /* XP_UNIX */
-
/* Get the filename for the logfile from the environment */
- logFileName = PR_GetEnv( "NSPR_TRACE_LOG" );
+ logFileName = PR_GetEnvSecure( "NSPR_TRACE_LOG" );
if ( logFileName == NULL )
{
PR_LOG( lm, PR_LOG_ERROR,
;+ global:
PR_SyncMemMap;
;+} NSPR_4.9.2;
+;+# Function PR_DuplicateEnvironment had been added in NSPR 4.10.9,
+;+# but we neglected to add it to nspr.def until NSPR 4.12
+;+NSPR_4.12 {
+;+ global:
+ PR_DuplicateEnvironment;
+ PR_GetEnvSecure;
+;+} NSPR_4.10.3;
* We use these variables to figure out how much time has
* elapsed and how much of the timeout still remains.
*/
- PRIntervalTime start, elapsed, remaining;
+ PRIntervalTime start = 0, elapsed, remaining;
if (pt_TestAbort()) return -1;
* We use these variables to figure out how much time has
* elapsed and how much of the timeout still remains.
*/
- PRIntervalTime start, elapsed, remaining;
+ PRIntervalTime start = 0, elapsed, remaining;
if (pt_TestAbort()) return -1;
* We use these variables to figure out how much time has elapsed
* and how much of the timeout still remains.
*/
- PRIntervalTime start, elapsed, remaining;
+ PRIntervalTime start = 0, elapsed, remaining;
static PRBool unwarned = PR_TRUE;
if (unwarned) unwarned = _PR_Obsolete( "PR_Select", "PR_Poll");
PR_ASSERT(lock != NULL);
if (cv != NULL)
{
- int rv = _PT_PTHREAD_COND_INIT(cv->cv, _pt_cvar_attr);
+ int rv = _PT_PTHREAD_COND_INIT(cv->cv, _pt_cvar_attr);
PR_ASSERT(0 == rv);
- cv->lock = lock;
- cv->notify_pending = 0;
+ if (0 == rv)
+ {
+ cv->lock = lock;
+ cv->notify_pending = 0;
#if defined(DEBUG)
- pt_debug.cvars_created += 1;
+ pt_debug.cvars_created += 1;
#endif
+ }
+ else
+ {
+ PR_DELETE(cv);
+ cv = NULL;
+ }
}
return cv;
} /* PR_NewCondVar */
{
if (0 > PR_ATOMIC_DECREMENT(&cvar->notify_pending))
{
- PRIntn rv = pthread_cond_destroy(&cvar->cv); PR_ASSERT(0 == rv);
+ PRIntn rv = pthread_cond_destroy(&cvar->cv);
#if defined(DEBUG)
+ PR_ASSERT(0 == rv);
memset(cvar, 0xaf, sizeof(PRCondVar));
pt_debug.cvars_destroyed += 1;
+#else
+ (void)rv;
#endif
PR_Free(cvar);
}
if (cv != NULL)
{
int rv;
- rv = _PT_PTHREAD_COND_INIT(cv->cv, _pt_cvar_attr);
+ rv = _PT_PTHREAD_COND_INIT(cv->cv, _pt_cvar_attr);
PR_ASSERT(0 == rv);
- cv->lock = _PR_NAKED_CV_LOCK;
+ if (0 == rv)
+ {
+ cv->lock = _PR_NAKED_CV_LOCK;
+ }
+ else
+ {
+ PR_DELETE(cv);
+ cv = NULL;
+ }
}
return cv;
} /* PRP_NewNakedCondVar */
#include <signal.h>
#include <dlfcn.h>
+#if defined(OPENBSD) || defined(FREEBSD) || defined(DRAGONFLY)
+#include <pthread_np.h>
+#endif
+
#ifdef SYMBIAN
/* In Open C sched_get_priority_min/max do not work properly, so we undefine
* _POSIX_THREAD_PRIORITY_SCHEDULING here.
pthread_key_t key; /* thread private data key */
PRBool keyCreated; /* whether 'key' should be deleted */
PRThread *first, *last; /* list of threads we know about */
-#if defined(_PR_DCETHREADS) || defined(_POSIX_THREAD_PRIORITY_SCHEDULING)
+#if defined(_PR_DCETHREADS) || _POSIX_THREAD_PRIORITY_SCHEDULING > 0
PRInt32 minPrio, maxPrio; /* range of scheduling priorities */
#endif
} pt_book = {0};
static void _pt_thread_death_internal(void *arg, PRBool callDestructors);
static void init_pthread_gc_support(void);
-#if defined(_PR_DCETHREADS) || defined(_POSIX_THREAD_PRIORITY_SCHEDULING)
+#if defined(_PR_DCETHREADS) || _POSIX_THREAD_PRIORITY_SCHEDULING > 0
static PRIntn pt_PriorityMap(PRThreadPriority pri)
{
#ifdef NTO
if (EPERM != pt_schedpriv)
{
-#if !defined(_PR_DCETHREADS) && defined(_POSIX_THREAD_PRIORITY_SCHEDULING)
+#if !defined(_PR_DCETHREADS) && _POSIX_THREAD_PRIORITY_SCHEDULING > 0
struct sched_param schedule;
#endif
-#if defined(_POSIX_THREAD_PRIORITY_SCHEDULING)
+#if _POSIX_THREAD_PRIORITY_SCHEDULING > 0
rv = pthread_attr_setinheritsched(&tattr, PTHREAD_EXPLICIT_SCHED);
PR_ASSERT(0 == rv);
#endif
#if defined(_PR_DCETHREADS)
rv = pthread_attr_setprio(&tattr, pt_PriorityMap(priority));
PR_ASSERT(0 == rv);
-#elif defined(_POSIX_THREAD_PRIORITY_SCHEDULING)
+#elif _POSIX_THREAD_PRIORITY_SCHEDULING > 0
rv = pthread_attr_getschedparam(&tattr, &schedule);
PR_ASSERT(0 == rv);
schedule.sched_priority = pt_PriorityMap(priority);
scope = PR_GLOBAL_THREAD;
if (PR_GLOBAL_BOUND_THREAD == scope) {
-#if defined(_POSIX_THREAD_PRIORITY_SCHEDULING)
+#if _POSIX_THREAD_PRIORITY_SCHEDULING > 0
rv = pthread_attr_setscope(&tattr, PTHREAD_SCOPE_SYSTEM);
if (rv) {
/*
PR_LOG(_pr_thread_lm, PR_LOG_MIN,
("_PR_CreateThread: no thread scheduling privilege"));
/* Try creating the thread again without setting priority. */
-#if defined(_POSIX_THREAD_PRIORITY_SCHEDULING)
+#if _POSIX_THREAD_PRIORITY_SCHEDULING > 0
rv = pthread_attr_setinheritsched(&tattr, PTHREAD_INHERIT_SCHED);
PR_ASSERT(0 == rv);
#endif
PR_IMPLEMENT(void) PR_SetThreadPriority(PRThread *thred, PRThreadPriority newPri)
{
- PRIntn rv = -1;
+ PRIntn rv;
PR_ASSERT(NULL != thred);
#if defined(_PR_DCETHREADS)
rv = pthread_setprio(thred->id, pt_PriorityMap(newPri));
/* pthread_setprio returns the old priority */
-#elif defined(_POSIX_THREAD_PRIORITY_SCHEDULING)
+#elif _POSIX_THREAD_PRIORITY_SCHEDULING > 0
if (EPERM != pt_schedpriv)
{
int policy;
errno));
}
}
+#else
+ (void)rv; /* rv is unused */
#endif
thred->priority = newPri;
pthread_init();
#endif
-#if defined(_PR_DCETHREADS) || defined(_POSIX_THREAD_PRIORITY_SCHEDULING)
+#if defined(_PR_DCETHREADS) || _POSIX_THREAD_PRIORITY_SCHEDULING > 0
#if defined(FREEBSD)
{
pthread_attr_t attr;
{
PRThread *thread;
size_t nameLen;
- int result;
+ int result = 0;
if (!name) {
PR_SetError(PR_INVALID_ARGUMENT_ERROR, 0);
return PR_FAILURE;
memcpy(thread->name, name, nameLen + 1);
-#if defined(OPENBSD) || defined(FREEBSD)
- result = pthread_set_name_np(thread->id, name);
+#if defined(OPENBSD) || defined(FREEBSD) || defined(DRAGONFLY)
+ pthread_set_name_np(thread->id, name);
+#elif defined(NETBSD)
+ result = pthread_setname_np(thread->id, "%s", (void *)name);
#else /* not BSD */
/*
* On OSX, pthread_setname_np is only available in 10.6 or later, so test
_MD_NEW_LOCK( &cpuQueue->sleepQLock );
_MD_NEW_LOCK( &cpuQueue->miscQLock );
- for (index = 0; index < PR_PRIORITY_LAST + 1; index++)
+ for (index = 0; index < PR_ARRAY_SIZE(cpuQueue->runQ); index++)
PR_INIT_CLIST( &(cpuQueue->runQ[index]) );
PR_INIT_CLIST( &(cpuQueue->sleepQ) );
PR_INIT_CLIST( &(cpuQueue->pauseQ) );
#ifndef HAVE_CUSTOM_USER_THREADS
stack = PR_NEWZAP(PRThreadStack);
#ifdef HAVE_STACK_GROWING_UP
- stack->stackTop = (char*) ((((long)&type) >> _pr_pageShift)
+ stack->stackTop = (char*) ((((PRWord)&type) >> _pr_pageShift)
<< _pr_pageShift);
#else
#if defined(SOLARIS) || defined (UNIXWARE) && defined (USR_SVR4_THREADS)
stack->stackTop = (char*) &thread;
#else
- stack->stackTop = (char*) ((((long)&type + _pr_pageSize - 1)
+ stack->stackTop = (char*) ((((PRWord)&type + _pr_pageSize - 1)
>> _pr_pageShift) << _pr_pageShift);
#endif
#endif
** Setup stackTop and stackBottom values.
*/
#ifdef HAVE_STACK_GROWING_UP
- ts->allocBase = (char*) ((((long)&ts) >> _pr_pageShift)
+ ts->allocBase = (char*) ((((PRWord)&ts) >> _pr_pageShift)
<< _pr_pageShift);
ts->stackBottom = ts->allocBase + ts->stackSize;
ts->stackTop = ts->allocBase;
#else
- ts->allocBase = (char*) ((((long)&ts + _pr_pageSize - 1)
+ ts->allocBase = (char*) ((((PRWord)&ts + _pr_pageSize - 1)
>> _pr_pageShift) << _pr_pageShift);
ts->stackTop = ts->allocBase;
ts->stackBottom = ts->allocBase - ts->stackSize;
_PR_DumpThread(fd, t);
_PR_DumpPrintf(fd, "Runnable Threads:\n");
- for (i = 0; i < 32; i++) {
+ for (i = 0; i < PR_ARRAY_SIZE(_PR_RUNQ(t->cpu)); i++) {
DumpThreadQueue(fd, &_PR_RUNQ(t->cpu)[i]);
}
prftest.c \
prftest1.c \
prftest2.c \
+ prfz.c \
primblok.c \
priotest.c \
provider.c \
prftest2.c
Obsolete. Subsumed in prftest.c
+prfz.c
+ Tests printf handling of (s)size_t formats
+
priotest.c
Limited use. Tests NSPR thread dispatching priority.
**
*/
#include "prenv.h"
+#include "prmem.h"
#include "plgetopt.h"
#include <stdio.h>
PRIntn debug = 0;
PRIntn verbose = 0;
+PRIntn secure = 0;
PRBool failedAlready = PR_FALSE;
#define ENVNAME "NSPR_ENVIRONMENT_TEST_VARIABLE"
{ /* Get command line options */
PLOptStatus os;
- PLOptState *opt = PL_CreateOptState(argc, argv, "vd");
+ PLOptState *opt = PL_CreateOptState(argc, argv, "vds");
while (PL_OPT_EOL != (os = PL_GetNextOpt(opt)))
{
case 'v': /* verbose */
verbose = 1;
break;
+ case 's': /* secure / set[ug]id */
+ /*
+ ** To test PR_GetEnvSecure, make this executable (or a
+ ** copy of it) setuid / setgid / otherwise inherently
+ ** privileged (e.g., file capabilities) and run it
+ ** with this flag.
+ */
+ secure = 1;
+ break;
default:
break;
}
if (verbose) printf("env: PR_GetEnv() worked after setting it. Found: %s\n", value );
}
+ if ( secure ) {
+ /*
+ ** In this case we've been run with elevated privileges, so
+ ** test that PR_GetEnvSecure *doesn't* find that env var.
+ */
+ value = PR_GetEnvSecure( ENVNAME );
+ if ( NULL != value ) {
+ if (debug) printf( "env: PR_GetEnvSecure() failed; expected NULL, found \"%s\"\n", value );
+ failedAlready = PR_TRUE;
+ } else {
+ if (verbose) printf("env: PR_GetEnvSecure() worked\n" );
+ }
+ } else {
+ /*
+ ** In this case the program is being run normally, so do the
+ ** same check for PR_GetEnvSecure as for PR_GetEnv.
+ */
+ value = PR_GetEnvSecure( ENVNAME );
+ if ( (NULL == value ) || (strcmp( value, ENVVALUE))) {
+ if (debug) printf( "env: PR_GetEnvSecure() Failed after setting\n" );
+ failedAlready = PR_TRUE;
+ } else {
+ if (verbose) printf("env: PR_GetEnvSecure() worked after setting it. Found: %s\n", value );
+ }
+ }
+
+/* ---------------------------------------------------------------------- */
+ /* check that PR_DuplicateEnvironment() agrees with PR_GetEnv() */
+ {
+#if defined(XP_UNIX) && (!defined(DARWIN) || defined(HAVE_CRT_EXTERNS_H))
+ static const PRBool expect_failure = PR_FALSE;
+#else
+ static const PRBool expect_failure = PR_TRUE;
+#endif
+ char **i, **dupenv = PR_DuplicateEnvironment();
+
+
+ if ( NULL == dupenv ) {
+ if (expect_failure) {
+ if (verbose) printf("env: PR_DuplicateEnvironment failed, "
+ "as expected on this platform.\n");
+ } else {
+ if (debug) printf("env: PR_DuplicateEnvironment() failed.\n");
+ failedAlready = PR_TRUE;
+ }
+ } else {
+ unsigned found = 0;
+
+ if (expect_failure) {
+ if (debug) printf("env: PR_DuplicateEnvironment() succeeded, "
+ "but failure is expected on this platform.\n");
+ failedAlready = PR_TRUE;
+ } else {
+ if (verbose) printf("env: PR_DuplicateEnvironment() succeeded.\n");
+ }
+ for (i = dupenv; *i; i++) {
+ char *equals = strchr(*i, '=');
+
+ if ( equals == NULL ) {
+ if (debug) printf("env: PR_DuplicateEnvironment() returned a string"
+ " with no '=': %s\n", *i);
+ failedAlready = PR_TRUE;
+ } else {
+ /* We own this string, so we can temporarily alter it */
+ /* *i is the null-terminated name; equals + 1 is the value */
+ *equals = '\0';
+
+ if ( strcmp(*i, ENVNAME) == 0) {
+ found++;
+ if (verbose) printf("env: PR_DuplicateEnvironment() found " ENVNAME
+ " (%u so far).\n", found);
+ }
+
+ /* Multiple values for the same name can't happen, according to POSIX. */
+ value = PR_GetEnv(*i);
+ if ( value == NULL ) {
+ if (debug) printf("env: PR_DuplicateEnvironment() returned a name"
+ " which PR_GetEnv() failed to find: %s\n", *i);
+ failedAlready = PR_TRUE;
+ } else if ( strcmp(equals + 1, value) != 0) {
+ if (debug) printf("env: PR_DuplicateEnvironment() returned the wrong"
+ " value for %s: expected %s; found %s\n",
+ *i, value, equals + 1);
+ failedAlready = PR_TRUE;
+ } else {
+ if (verbose) printf("env: PR_DuplicateEnvironment() agreed with"
+ " PR_GetEnv() about %s\n", *i);
+ }
+ }
+ PR_Free(*i);
+ }
+ PR_Free(dupenv);
+
+ if (found != 1) {
+ if (debug) printf("env: PR_DuplicateEnvironment() found %u entries for " ENVNAME
+ " (expected 1)\n", found);
+ failedAlready = PR_TRUE;
+ } else {
+ if (verbose) printf("env: PR_DuplicateEnvironment() found 1 entry for " ENVNAME "\n");
+ }
+ }
+ }
+
/* ---------------------------------------------------------------------- */
/* un-set the variable, using RAW name... should not work */
envBuf = NewBuffer( ENVBUFSIZE );
scope_str = GLOBAL_BOUND_SCOPE_STRING;
break;
default:
- PR_ASSERT(!"Invalid thread scope");
+ PR_NOT_REACHED("Invalid thread scope");
break;
}
printf("thread id %d, scope %s\n", info->id, scope_str);
{
if (PR_PENDING_INTERRUPT_ERROR == PR_GetError()) break;
PL_PrintError("Accept failed");
- MW_ASSERT(!"Accept failed");
+ MW_ASSERT(PR_FALSE && "Accept failed");
}
else
{
ready = PR_Poll(&polldesc, 1, PR_INTERVAL_NO_TIMEOUT);
if ((1 != ready) /* if not 1, then we're dead */
|| (0 == (polldesc.in_flags & polldesc.out_flags)))
- { PR_ASSERT(!"Whoa!"); break; }
+ { PR_NOT_REACHED("Whoa!"); break; }
if (verbosity > quiet)
PR_fprintf(
logFile, "Client connect 'in progress' [0x%x]\n",
ready = PR_Poll(&polldesc, 1, PR_INTERVAL_NO_TIMEOUT);
if ((1 != ready) /* if not 1, then we're dead */
|| (0 == (polldesc.in_flags & polldesc.out_flags)))
- { PR_ASSERT(!"Whoa!"); break; }
+ { PR_NOT_REACHED("Whoa!"); break; }
}
else break;
} while (bytes_sent < sizeof(buffer));
ready = PR_Poll(&polldesc, 1, PR_INTERVAL_NO_TIMEOUT);
if ((1 != ready) /* if not 1, then we're dead */
|| (0 == (polldesc.in_flags & polldesc.out_flags)))
- { PR_ASSERT(!"Whoa!"); break; }
+ { PR_NOT_REACHED("Whoa!"); break; }
}
else break;
} while (bytes_read < bytes_sent);
ready = PR_Poll(&polldesc, 1, PR_INTERVAL_NO_TIMEOUT);
if ((1 != ready) /* if not 1, then we're dead */
|| (0 == (polldesc.in_flags & polldesc.out_flags)))
- { PR_ASSERT(!"Whoa!"); break; }
+ { PR_NOT_REACHED("Whoa!"); break; }
}
} while (NULL == service);
PR_ASSERT(NULL != service);
ready = PR_Poll(&polldesc, 1, PR_INTERVAL_NO_TIMEOUT);
if ((1 != ready) /* if not 1, then we're dead */
|| (0 == (polldesc.in_flags & polldesc.out_flags)))
- { PR_ASSERT(!"Whoa!"); break; }
+ { PR_NOT_REACHED("Whoa!"); break; }
}
else break;
} while (bytes_read < sizeof(buffer));
ready = PR_Poll(&polldesc, 1, PR_INTERVAL_NO_TIMEOUT);
if ((1 != ready) /* if not 1, then we're dead */
|| (0 == (polldesc.in_flags & polldesc.out_flags)))
- { PR_ASSERT(!"Whoa!"); break; }
+ { PR_NOT_REACHED("Whoa!"); break; }
}
else break;
} while (bytes_sent < bytes_read);
default: break;
}
}
- else PR_ASSERT(!"How'd I get here?");
+ else PR_NOT_REACHED("How'd I get here?");
new_flags = (fd->lower->methods->poll)(fd->lower, my_flags, out_flags);
if (verbosity > chatty)
PR_fprintf(
--- /dev/null
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+/*
+ * This is a simple test of the PR_fprintf() function for size_t formats.
+ */
+
+#include "prprf.h"
+#include <sys/types.h>
+#include <limits.h>
+#include <string.h>
+
+int
+main(int argc, char **argv)
+{
+ char buffer[128];
+
+ size_t unsigned_small = 266;
+#ifdef XP_UNIX
+ ssize_t signed_small_p = 943;
+ ssize_t signed_small_n = -1;
+#endif
+ size_t unsigned_max = SIZE_MAX;
+ size_t unsigned_min = 0;
+#ifdef XP_UNIX
+ ssize_t signed_max = SSIZE_MAX;
+#endif
+
+ printf("Test: unsigned small '%%zu' : ");
+ PR_snprintf(buffer, sizeof(buffer), "%zu", unsigned_small);
+ if (strncmp(buffer, "266", sizeof(buffer)) != 0) {
+ printf("Failed, got '%s'\n", buffer);
+ return -1;
+ }
+ printf("OK\n");
+
+#ifdef XP_UNIX
+ printf("Test: signed small positive '%%zd' : ");
+ PR_snprintf(buffer, sizeof(buffer), "%zd", signed_small_p);
+ if (strncmp(buffer, "943", sizeof(buffer)) != 0) {
+ printf("Failed, got '%s'\n", buffer);
+ return -1;
+ }
+ printf("OK\n");
+
+ printf("Test: signed small negative '%%zd' : ");
+ PR_snprintf(buffer, sizeof(buffer), "%zd", signed_small_n);
+ if (strncmp(buffer, "-1", sizeof(buffer)) != 0) {
+ printf("Failed, got '%s'\n", buffer);
+ return -1;
+ }
+ printf("OK\n");
+#endif
+
+ printf("Test: 0 '%%zu' : ");
+ PR_snprintf(buffer, sizeof(buffer), "%zu", unsigned_min);
+ if (strncmp(buffer, "0", sizeof(buffer)) != 0) {
+ printf("Failed, got '%s'\n", buffer);
+ return -1;
+ }
+ printf("OK\n");
+
+ printf("Test: SIZE_MAX '%%zx' : ");
+ PR_snprintf(buffer, sizeof(buffer), "%zx", unsigned_max);
+ if (strspn(buffer, "f") != sizeof(size_t) * 2) {
+ printf("Failed, got '%s'\n", buffer);
+ return -1;
+ }
+ printf("OK\n");
+
+#ifdef XP_UNIX
+ printf("Test: SSIZE_MAX '%%zx' : ");
+ PR_snprintf(buffer, sizeof(buffer), "%zx", signed_max);
+ if (*buffer != '7' ||
+ strspn(buffer + 1, "f") != sizeof(ssize_t) * 2 - 1) {
+ printf("Failed, got '%s'\n", buffer);
+ return -1;
+ }
+ printf("OK\n");
+#endif
+
+ return 0;
+}
PR_ProcessExit((failed) ? 1 : 0);
- PR_ASSERT(!"You can't get here -- but you did!");
+ PR_NOT_REACHED("You can't get here -- but you did!");
return 1; /* or here */
} /* main */
"poll_to",
"pollable",
"prftest",
+"prfz",
"primblok",
"provider",
"prpollml",
poll_to
pollable
prftest
+prfz
primblok
provider
prpollml
PR_RWLock_Rlock(rwlock1);
PR_RWLock_Unlock(rwlock1);
- // Test correct lock rank.
+ /* Test correct lock rank. */
PR_RWLock_Rlock(rwlock1);
PR_RWLock_Rlock(rwlock2);
PR_RWLock_Unlock(rwlock2);
PR_RWLock_Unlock(rwlock1);
#if 0
- // Test incorrect lock rank.
+ /* Test incorrect lock rank. */
PR_RWLock_Rlock(rwlock2);
PR_RWLock_Rlock(rwlock1);
PR_RWLock_Unlock(rwlock1);
#define PASS 0
#define FAIL 1
static int debug_mode = 0;
+static int failed_already = 0;
static int _iterations = 1000;
static int _clients = 1;
break;
case FAIL:
printf ("FAIL\n");
+ failed_already = 1;
break;
default:
break;
ServerSetup(void)
{
PRFileDesc *listenSocket;
+ PRSocketOptionData sockOpt;
PRNetAddr serverAddr;
PRThread *WorkerThread;
- if ( (listenSocket = PR_NewTCPSocket()) == NULL) {
+ if ((listenSocket = PR_NewTCPSocket()) == NULL) {
if (debug_mode) printf("\tServer error creating listen socket\n");
else Test_Result(FAIL);
return NULL;
}
+ sockOpt.option = PR_SockOpt_Reuseaddr;
+ sockOpt.value.reuse_addr = PR_TRUE;
+ if (PR_SetSocketOption(listenSocket, &sockOpt) != PR_SUCCESS) {
+ if (debug_mode) printf("\tServer error setting socket option: OS error %d\n",
+ PR_GetOSError());
+ else Test_Result(FAIL);
+ PR_Close(listenSocket);
+ return NULL;
+ }
+
memset(&serverAddr, 0, sizeof(PRNetAddr));
serverAddr.inet.family = PR_AF_INET;
serverAddr.inet.port = PR_htons(PORT);
serverAddr.inet.ip = PR_htonl(PR_INADDR_ANY);
- if ( PR_Bind(listenSocket, &serverAddr) == PR_FAILURE) {
+ if (PR_Bind(listenSocket, &serverAddr) != PR_SUCCESS) {
if (debug_mode) printf("\tServer error binding to server address: OS error %d\n",
PR_GetOSError());
else Test_Result(FAIL);
return NULL;
}
- if ( PR_Listen(listenSocket, 128) == PR_FAILURE) {
+ if (PR_Listen(listenSocket, 128) != PR_SUCCESS) {
if (debug_mode) printf("\tServer error listening to server socket\n");
else Test_Result(FAIL);
PR_Close(listenSocket);
Usage: test_name -d
*/
PLOptStatus os;
- PLOptState *opt = PL_CreateOptState(argc, argv, "d:");
+ PLOptState *opt = PL_CreateOptState(argc, argv, "d");
while (PL_OPT_EOL != (os = PL_GetNextOpt(opt)))
{
if (PL_OPT_BAD == os) continue;
PR_Cleanup();
- return 0;
+ return failed_already;
}
native_thread = 1;
break;
default:
- PR_ASSERT(!"Invalid scope");
+ PR_NOT_REACHED("Invalid scope");
break;
}
if (native_thread) {
native_thread = 1;
break;
default:
- PR_ASSERT(!"Invalid scope");
+ PR_NOT_REACHED("Invalid scope");
break;
}
if (native_thread) {
#include <stdlib.h>
/*
- * This release (4.10.7) is backward compatible with the
+ * This release (4.10.10) is backward compatible with the
* 4.0.x, 4.1.x, 4.2.x, 4.3.x, 4.4.x, 4.5.x, 4.6.x, 4.7.x,
- * 4.8.x, 4.9.x, 4.10, 4.10.1, 4.10.2, 4.10.3, 4.10.4,
- * 4.10.5, and 4.10.6 releases.
+ * 4.8.x, 4.9.x, 4.10.x and 4.11.X releases.
* It, of course, is compatible with itself.
*/
static char *compatible_version[] = {
"4.9", "4.9.1", "4.9.2", "4.9.3", "4.9.4", "4.9.5",
"4.9.6",
"4.10", "4.10.1", "4.10.2", "4.10.3", "4.10.4",
- "4.10.5", "4.10.6",
+ "4.10.5", "4.10.6", "4.10.7", "4.10.8", "4.10.9",
+ "4.10.10", "4.11",
PR_VERSION
};
"3.0", "3.0.1",
"3.1", "3.1.1", "3.1.2", "3.1.3",
"3.5", "3.5.1",
- "4.10.8",
- "4.11", "4.11.1",
+ "4.11.1",
+ "4.12.1",
"10.0", "11.1", "12.14.20"
};