Bug 489231: Update NSPR to the NSPR_HEAD_20090501 CVS tag.

This commit is contained in:
Wan-Teh Chang 2009-05-01 06:59:46 -07:00
Родитель 36161310be
Коммит 520dbc7d37
11 изменённых файлов: 104 добавлений и 45 удалений

Просмотреть файл

@ -42,3 +42,4 @@
*/
#error "Do not include this header file."

53
nsprpub/configure поставляемый
Просмотреть файл

@ -3356,7 +3356,8 @@ EOF
#define HAVE_SOCKLEN_T 1
EOF
CFLAGS="$CFLAGS -Wmost -fno-common"
AS='$(CC) -x assembler-with-cpp'
CFLAGS="$CFLAGS -Wall -fno-common"
case "${target_cpu}" in
i*86*)
if test -n "$USE_64"; then
@ -3372,6 +3373,7 @@ EOF
esac
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
MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
STRIP="$STRIP -x -S"
DLL_SUFFIX=dylib
@ -4059,13 +4061,8 @@ EOF
fi
if test -n "$MOZ_OPTIMIZE"; then
if test -n "$MOZ_PROFILE"; then
_OPTIMIZE_FLAGS="$_OPTIMIZE_FLAGS -Z7"
fi
if test -n "$MOZ_DEBUG_SYMBOLS"; then
_OPTIMIZE_FLAGS="$_OPTIMIZE_FLAGS -Zi"
fi
if test -n "$MOZ_PROFILE" -o -n "$MOZ_DEBUG_SYMBOLS"; then
DLLFLAGS="$DLLFLAGS -DEBUG -OPT:REF"
LDFLAGS="$LDFLAGS -DEBUG -OPT:REF"
fi
@ -4545,17 +4542,17 @@ EOF
_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:4549: checking for machine/builtins.h" >&5
echo "configure:4546: 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
#line 4554 "configure"
#line 4551 "configure"
#include "confdefs.h"
#include <machine/builtins.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:4559: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:4556: \"$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*
@ -5204,7 +5201,7 @@ case $target in
;;
*)
echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
echo "configure:5208: checking for dlopen in -ldl" >&5
echo "configure:5205: 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
@ -5212,7 +5209,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldl $LIBS"
cat > conftest.$ac_ext <<EOF
#line 5216 "configure"
#line 5213 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@ -5223,7 +5220,7 @@ int main() {
dlopen()
; return 0; }
EOF
if { (eval echo configure:5227: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:5224: \"$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
@ -5240,17 +5237,17 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
ac_safe=`echo "dlfcn.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for dlfcn.h""... $ac_c" 1>&6
echo "configure:5244: checking for dlfcn.h" >&5
echo "configure:5241: checking for dlfcn.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
#line 5249 "configure"
#line 5246 "configure"
#include "confdefs.h"
#include <dlfcn.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:5254: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:5251: \"$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*
@ -5283,13 +5280,13 @@ esac
if test $ac_cv_prog_gcc = yes; then
echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6
echo "configure:5287: checking whether ${CC-cc} needs -traditional" >&5
echo "configure:5284: 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 <<EOF
#line 5293 "configure"
#line 5290 "configure"
#include "confdefs.h"
#include <sgtty.h>
Autoconf TIOCGETP
@ -5307,7 +5304,7 @@ rm -f conftest*
if test $ac_cv_prog_gcc_traditional = no; then
cat > conftest.$ac_ext <<EOF
#line 5311 "configure"
#line 5308 "configure"
#include "confdefs.h"
#include <termio.h>
Autoconf TCGETA
@ -5331,12 +5328,12 @@ fi
for ac_func in lchown strerror
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:5335: checking for $ac_func" >&5
echo "configure:5332: 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 <<EOF
#line 5340 "configure"
#line 5337 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@ -5359,7 +5356,7 @@ $ac_func();
; return 0; }
EOF
if { (eval echo configure:5363: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:5360: \"$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
@ -5400,7 +5397,7 @@ hpux*)
if test -z "$GNU_CC"; then
echo $ac_n "checking for +Olit support""... $ac_c" 1>&6
echo "configure:5404: checking for +Olit support" >&5
echo "configure:5401: checking for +Olit support" >&5
if eval "test \"`echo '$''{'ac_cv_hpux_usable_olit_option'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -5439,7 +5436,7 @@ darwin*)
*)
echo $ac_n "checking for pthread_create in -lpthreads""... $ac_c" 1>&6
echo "configure:5443: checking for pthread_create in -lpthreads" >&5
echo "configure:5440: checking for pthread_create in -lpthreads" >&5
echo "
#include <pthread.h>
void *foo(void *v) { return v; }
@ -5461,7 +5458,7 @@ echo "
echo "$ac_t""no" 1>&6
echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6
echo "configure:5465: checking for pthread_create in -lpthread" >&5
echo "configure:5462: checking for pthread_create in -lpthread" >&5
echo "
#include <pthread.h>
void *foo(void *v) { return v; }
@ -5483,7 +5480,7 @@ echo "
echo "$ac_t""no" 1>&6
echo $ac_n "checking for pthread_create in -lc_r""... $ac_c" 1>&6
echo "configure:5487: checking for pthread_create in -lc_r" >&5
echo "configure:5484: checking for pthread_create in -lc_r" >&5
echo "
#include <pthread.h>
void *foo(void *v) { return v; }
@ -5505,7 +5502,7 @@ echo "
echo "$ac_t""no" 1>&6
echo $ac_n "checking for pthread_create in -lc""... $ac_c" 1>&6
echo "configure:5509: checking for pthread_create in -lc" >&5
echo "configure:5506: checking for pthread_create in -lc" >&5
echo "
#include <pthread.h>
void *foo(void *v) { return v; }
@ -5637,7 +5634,7 @@ 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:5641: checking whether ${CC-cc} accepts -pthread" >&5
echo "configure:5638: 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
@ -5660,7 +5657,7 @@ echo "configure:5641: 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:5664: checking whether ${CC-cc} accepts -pthreads" >&5
echo "configure:5661: 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

Просмотреть файл

@ -996,7 +996,8 @@ case "$target" in
AC_DEFINE(DARWIN)
AC_DEFINE(HAVE_BSD_FLOCK)
AC_DEFINE(HAVE_SOCKLEN_T)
CFLAGS="$CFLAGS -Wmost -fno-common"
AS='$(CC) -x assembler-with-cpp'
CFLAGS="$CFLAGS -Wall -fno-common"
case "${target_cpu}" in
i*86*)
if test -n "$USE_64"; then
@ -1012,6 +1013,7 @@ case "$target" in
esac
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
MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
STRIP="$STRIP -x -S"
DLL_SUFFIX=dylib
@ -1568,13 +1570,8 @@ tools are selected during the Xcode/Developer Tools installation.])
fi
if test -n "$MOZ_OPTIMIZE"; then
if test -n "$MOZ_PROFILE"; then
_OPTIMIZE_FLAGS="$_OPTIMIZE_FLAGS -Z7"
fi
if test -n "$MOZ_DEBUG_SYMBOLS"; then
_OPTIMIZE_FLAGS="$_OPTIMIZE_FLAGS -Zi"
fi
if test -n "$MOZ_PROFILE" -o -n "$MOZ_DEBUG_SYMBOLS"; then
DLLFLAGS="$DLLFLAGS -DEBUG -OPT:REF"
LDFLAGS="$LDFLAGS -DEBUG -OPT:REF"
fi

Просмотреть файл

@ -66,7 +66,8 @@ NSPR_API(PRUint64) LL_MaxUint(void);
#if defined(HAVE_LONG_LONG)
#if PR_BYTES_PER_LONG == 8
/* Keep this in sync with prtypes.h. */
#if PR_BYTES_PER_LONG == 8 && !defined(__APPLE__)
#define LL_MAXINT 9223372036854775807L
#define LL_MININT (-LL_MAXINT - 1L)
#define LL_ZERO 0L

Просмотреть файл

@ -354,6 +354,7 @@ typedef long PRInt32;
** the LL_ macros (see prlong.h).
************************************************************************/
#ifdef HAVE_LONG_LONG
/* Keep this in sync with prlong.h. */
/*
* On 64-bit Mac OS X, uint64 needs to be defined as unsigned long long to
* match uint64_t, otherwise our uint64 typedef conflicts with the uint64

Просмотреть файл

@ -2649,7 +2649,7 @@ PRInt32 _MD_getopenfileinfo64(const PRFileDesc *fd, PRFileInfo64 *info)
return rv;
}
struct _MD_IOVector _md_iovector = { open };
struct _MD_IOVector _md_iovector;
/*
** These implementations are to emulate large file routines on systems that

Просмотреть файл

@ -281,7 +281,7 @@ ForkAndExec(
#ifdef AIX
process->md.pid = (*pr_wp.forkptr)();
#elif defined(NTO)
#elif defined(NTO) || defined(SYMBIAN)
/*
* fork() & exec() does not work in a multithreaded process.
* Use spawn() instead.
@ -312,7 +312,12 @@ ForkAndExec(
PR_ASSERT(attr->currentDirectory == NULL); /* not implemented */
}
#ifdef SYMBIAN
/* In Symbian OS, we use posix_spawn instead of fork() and exec() */
posix_spawn(&(process->md.pid), path, NULL, NULL, argv, childEnvp);
#else
process->md.pid = spawn(path, 3, fd_map, NULL, argv, childEnvp);
#endif
if (fd_map[0] != 0)
close(fd_map[0]);
@ -339,7 +344,7 @@ ForkAndExec(
* the parent process's standard I/O data structures.
*/
#if !defined(NTO)
#if !defined(NTO) && !defined(SYMBIAN)
#ifdef VMS
/* OpenVMS has already handled all this above */
#else
@ -980,6 +985,11 @@ PRStatus _MD_KillUnixProcess(PRProcess *process)
PRErrorCode prerror;
PRInt32 oserror;
#ifdef SYMBIAN
/* In Symbian OS, we can not kill other process with Open C */
PR_SetError(PR_OPERATION_NOT_SUPPORTED_ERROR, oserror);
return PR_FAILURE;
#else
if (kill(process->md.pid, SIGKILL) == 0) {
return PR_SUCCESS;
}
@ -997,4 +1007,5 @@ PRStatus _MD_KillUnixProcess(PRProcess *process)
}
PR_SetError(prerror, oserror);
return PR_FAILURE;
#endif
} /* _MD_KillUnixProcess */

Просмотреть файл

@ -263,7 +263,12 @@ extern PRStatus _MD_DeleteSharedMemory( const char *name )
("_MD_DeleteSharedMemory(): ftok() failed on name: %s", ipcname));
}
#ifdef SYMBIAN
/* In Symbian OS the system imposed minimum is 1 byte, instead of ZERO */
id = shmget( key, 1, 0 );
#else
id = shmget( key, 0, 0 );
#endif
if ( -1 == id ) {
_PR_MD_MAP_DEFAULT_ERROR( errno );
PR_LOG( _pr_shm_lm, PR_LOG_DEBUG,
@ -515,7 +520,12 @@ extern PRFileMap* _md_OpenAnonFileMap(
** make maxTries number of attempts at uniqueness in the filename
*/
for ( incr = 0; incr < maxTries ; incr++ ) {
genName = PR_smprintf( "%s/.NSPR-AFM-%d-%p.%d",
#if defined(SYMBIAN)
#define NSPR_AFM_FILENAME "%s\\NSPR-AFM-%d-%p.%d"
#else
#define NSPR_AFM_FILENAME "%s/.NSPR-AFM-%d-%p.%d"
#endif
genName = PR_smprintf( NSPR_AFM_FILENAME,
dirName, (int) pid, tid, incr );
if ( NULL == genName ) {
PR_LOG( _pr_shma_lm, PR_LOG_DEBUG,
@ -549,7 +559,13 @@ extern PRFileMap* _md_OpenAnonFileMap(
}
urc = unlink( genName );
#if defined(SYMBIAN) && defined(__WINS__)
/* If it is being used by the system or another process, Symbian OS
* Emulator(WINS) considers this an error. */
if ( -1 == urc && EACCES != errno ) {
#else
if ( -1 == urc ) {
#endif
_PR_MD_MAP_UNLINK_ERROR( errno );
PR_LOG( _pr_shma_lm, PR_LOG_DEBUG,
("_md_OpenAnonFileMap(): failed on unlink(), errno: %d", errno));

Просмотреть файл

@ -596,6 +596,25 @@ static PRStatus CopyHostent(
return PR_SUCCESS;
}
#ifdef SYMBIAN
/* Set p_aliases by hand because Symbian's getprotobyname() returns NULL. */
static void AssignAliases(struct protoent *Protoent, char** aliases)
{
if (NULL == Protoent->p_aliases) {
if (0 == strcmp(Protoent->p_name, "ip"))
aliases[0] = "IP";
else if (0 == strcmp(Protoent->p_name, "tcp"))
aliases[0] = "TCP";
else if (0 == strcmp(Protoent->p_name, "udp"))
aliases[0] = "UDP";
else
aliases[0] = "UNKNOWN";
aliases[1] = NULL;
Protoent->p_aliases = aliases;
}
}
#endif
#if !defined(_PR_HAVE_GETPROTO_R)
/*
** Copy a protoent, and all of the memory that it refers to into
@ -1253,6 +1272,10 @@ PR_IMPLEMENT(PRStatus) PR_GetProtoByName(
}
else
{
#if defined(SYMBIAN)
char* aliases[2];
AssignAliases(staticBuf, aliases);
#endif
rv = CopyProtoent(staticBuf, buffer, buflen, result);
if (PR_FAILURE == rv)
PR_SetError(PR_INSUFFICIENT_RESOURCES_ERROR, 0);
@ -1333,6 +1356,10 @@ PR_IMPLEMENT(PRStatus) PR_GetProtoByNumber(
}
else
{
#if defined(SYMBIAN)
char* aliases[2];
AssignAliases(staticBuf, aliases);
#endif
rv = CopyProtoent(staticBuf, buffer, buflen, result);
if (PR_FAILURE == rv)
PR_SetError(PR_INSUFFICIENT_RESOURCES_ERROR, 0);

Просмотреть файл

@ -2097,21 +2097,21 @@ static PRInt32 pt_RecvFrom(PRFileDesc *fd, void *buf, PRInt32 amount,
bytes = pt_Continue(&op);
syserrno = op.syserrno;
}
#ifdef _PR_HAVE_SOCKADDR_LEN
if (bytes >= 0)
{
#ifdef _PR_HAVE_SOCKADDR_LEN
/* ignore the sa_len field of struct sockaddr */
if (addr)
{
addr->raw.family = ((struct sockaddr*)addr)->sa_family;
}
}
#endif /* _PR_HAVE_SOCKADDR_LEN */
#ifdef _PR_INET6
if (addr && (AF_INET6 == addr->raw.family))
addr->raw.family = PR_AF_INET6;
if (addr && (AF_INET6 == addr->raw.family))
addr->raw.family = PR_AF_INET6;
#endif
if (bytes < 0)
}
else
pt_MapError(_PR_MD_MAP_RECVFROM_ERROR, syserrno);
return bytes;
} /* pt_RecvFrom */

Просмотреть файл

@ -1159,6 +1159,7 @@ static void null_signal_handler(PRIntn sig);
*/
static void init_pthread_gc_support(void)
{
#ifndef SYMBIAN
PRIntn rv;
#if defined(_PR_DCETHREADS)
@ -1195,6 +1196,7 @@ static void init_pthread_gc_support(void)
}
#endif /* defined(PT_NO_SIGTIMEDWAIT) */
#endif /* defined(_PR_DCETHREADS) */
#endif /* SYMBIAN */
}
PR_IMPLEMENT(void) PR_SetThreadGCAble(void)
@ -1346,7 +1348,8 @@ static void suspend_signal_handler(PRIntn sig)
{
#if !defined(FREEBSD) && !defined(NETBSD) && !defined(OPENBSD) \
&& !defined(BSDI) && !defined(VMS) && !defined(UNIXWARE) \
&& !defined(DARWIN) && !defined(RISCOS) /*XXX*/
&& !defined(DARWIN) && !defined(RISCOS) \
&& !defined(SYMBIAN) /*XXX*/
PRIntn rv;
sigwait(&sigwait_set, &rv);
#endif
@ -1392,6 +1395,9 @@ static void pt_SuspendSet(PRThread *thred)
thred, thred->id));
#if defined(VMS)
rv = thread_suspend(thred);
#elif defined(SYMBIAN)
/* All signal group functions are not implemented in Symbian OS */
rv = 0;
#else
rv = pthread_kill (thred->id, SIGUSR2);
#endif
@ -1448,6 +1454,8 @@ static void pt_ResumeSet(PRThread *thred)
#if defined(PT_NO_SIGTIMEDWAIT)
#if defined(VMS)
thread_resume(thred);
#elif defined(SYMBIAN)
/* All signal group functions are not implemented in Symbian OS */
#else
pthread_kill(thred->id, SIGUSR1);
#endif