Another update from the internal CVS repository /m/src. NSPRPUB_RELEASE_3_1_ALMOST
authorwtc%netscape.com
Tue, 09 Mar 1999 05:12:06 +0000
changeset 491 91c3f3b19cc4e1184fee1afc1306847cd39c039f
parent 489 34073f036ca6d3d04002a9828113ea74f2189976
child 492 e495e4c00fb468c029b48acd87c9d14986fee0ec
push idunknown
push userunknown
push dateunknown
Another update from the internal CVS repository /m/src.
pr/include/md/_bsdi.cfg
pr/include/md/_unixos.h
pr/include/prerror.h
pr/include/prinit.h
pr/src/Makefile
pr/src/misc/pratom.c
pr/src/pthreads/ptthread.c
pr/tests/Makefile
pr/tests/socket.c
pr/tests/testfile.c
--- a/pr/include/md/_bsdi.cfg
+++ b/pr/include/md/_bsdi.cfg
@@ -24,17 +24,17 @@
 #endif
 
 #ifndef BSDI
 #define BSDI
 #endif
 
 #define IS_LITTLE_ENDIAN 1
 #undef  IS_BIG_ENDIAN
-#undef  HAVE_LONG_LONG
+#define HAVE_LONG_LONG
 #undef	HAVE_ALIGNED_DOUBLES
 #undef	HAVE_ALIGNED_LONGLONGS
 
 #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
--- a/pr/include/md/_unixos.h
+++ b/pr/include/md/_unixos.h
@@ -525,17 +525,17 @@ extern int poll(struct pollfd *, unsigne
 ** 2.5.1 so that we can use the same binaries on both Solaris 2.5.1 and
 ** 2.6.  At run time, we detect whether 64-bit file I/O is available by
 ** looking up the 64-bit file function symbols in libc.  At build time,
 ** we need to define the 64-bit file I/O datatypes that are compatible
 ** with their definitions on Solaris 2.6.
 */
 typedef PRInt64 off64_t;
 typedef PRUint64 ino64_t;
-typedef PRUint64 blkcnt64_t;
+typedef PRInt64 blkcnt64_t;
 struct stat64 {
     dev_t st_dev;
     long st_pad1[3];
     ino64_t st_ino;
     mode_t st_mode;
     nlink_t st_nlink;
     uid_t st_uid;
     gid_t st_gid;
--- a/pr/include/prerror.h
+++ b/pr/include/prerror.h
@@ -85,16 +85,24 @@ that the above copyright notice appear i
 copyright notice and this permission notice appear in supporting
 documentation, and that the names of M.I.T. and the M.I.T. S.I.P.B. not be
 used in advertising or publicity pertaining to distribution of the software
 without specific, written prior permission.  M.I.T. and the M.I.T. S.I.P.B.
 make no representations about the suitability of this software for any
 purpose.  It is provided "as is" without express or implied warranty.
 */
 
+
+/*
+ * NOTE:
+ *		The interfaces for error-code-translation described in the rest of
+ *		this file are preliminary in the 3.1 release of nspr and are subject 
+ *		to change in future releases.
+ */
+
 /*
 ** Description:	Localizable error code to string function.
 **
 **
 ** NSPR provides a mechanism for converting an error code to a
 ** descriptive string, in a caller-specified language.
 **
 ** Error codes themselves are 32 bit (signed) integers.  Typically,
--- a/pr/include/prinit.h
+++ b/pr/include/prinit.h
@@ -43,17 +43,17 @@ PR_BEGIN_EXTERN_C
 **
 ** The format of the version string is
 **     "<major version>.<minor version> <build date>"
 */
 #define PR_VERSION  "3.1"
 #define PR_VMAJOR   3
 #define PR_VMINOR   1
 #define PR_VPATCH   0
-#define PR_BETA     PR_TRUE
+#define PR_BETA     PR_FALSE
 
 /*
 ** PRVersionCheck
 **
 ** The basic signature of the function that is called to provide version
 ** checking. The result will be a boolean that indicates the likelihood
 ** that the underling library will perform as the caller expects.
 **
--- a/pr/src/Makefile
+++ b/pr/src/Makefile
@@ -42,17 +42,17 @@ endif
 # Disable optimization of the nspr on SunOS4.1.3
 ifeq ($(OS_ARCH),SunOS)
 ifeq ($(OS_RELEASE),4.1.3_U1)
 OPTIMIZER =
 export OPTIMIZER
 OS_LIBS			= -lm
 else	# 4.1.3_U1
 ifdef USE_PTHREADS
-OS_LIBS			= -lpthread -lposix4 -lsocket -lnsl -ldl
+OS_LIBS			= -lpthread -lthread -lposix4 -lsocket -lnsl -ldl
 else
 ifdef LOCAL_THREADS_ONLY
 OS_LIBS			= -lsocket -lnsl -ldl
 else
 OS_LIBS			= -lthread -lposix4 -lsocket -lnsl -ldl
 endif	# LOCAL_THREADS_ONLY
 endif	# USE_PTHREADS
 endif	# 4.1.3_U1
--- a/pr/src/misc/pratom.c
+++ b/pr/src/misc/pratom.c
@@ -97,20 +97,17 @@ PRIntn lock_count;
 
 	if (((eval = getenv("NSPR_ATOMIC_HASH_LOCKS")) != NULL)  &&
 		((num_atomic_locks = atoi(eval)) != DEFAULT_ATOMIC_LOCKS)) {
 
 		if (num_atomic_locks > MAX_ATOMIC_LOCKS)
 			num_atomic_locks = MAX_ATOMIC_LOCKS;
 		else {
 			num_atomic_locks = PR_FloorLog2(num_atomic_locks);
-			if (num_atomic_locks == 0)
-				num_atomic_locks = DEFAULT_ATOMIC_LOCKS;
-			else	
-				num_atomic_locks = 1L << num_atomic_locks;
+			num_atomic_locks = 1L << num_atomic_locks;
 		}
 		atomic_locks = (pthread_mutex_t *) PR_Malloc(sizeof(pthread_mutex_t) *
 						num_atomic_locks);
 		if (atomic_locks) {
 			for (index = 0; index < num_atomic_locks; index++) {
 				if (pthread_mutex_init(&atomic_locks[index], NULL)) {
 						PR_DELETE(atomic_locks);
 						atomic_locks = NULL;
--- a/pr/src/pthreads/ptthread.c
+++ b/pr/src/pthreads/ptthread.c
@@ -599,17 +599,16 @@ PR_IMPLEMENT(void) PR_SetThreadPriority(
     {
         int policy;
         struct sched_param schedule;
 
         rv = pthread_getschedparam(thred->id, &policy, &schedule);
         PR_ASSERT(0 == rv);
         schedule.sched_priority = pt_PriorityMap(newPri);
         rv = pthread_setschedparam(thred->id, policy, &schedule);
-        PR_ASSERT(0 == rv || EPERM == rv);
         if (EPERM == rv)
         {
             pt_schedpriv = EPERM;
             PR_LOG(_pr_thread_lm, PR_LOG_MIN,
                 ("PR_SetThreadPriority: no thread scheduling privilege"));
         }
     }
 #endif
--- a/pr/tests/Makefile
+++ b/pr/tests/Makefile
@@ -467,23 +467,23 @@ endif
 
 export:: $(TARGETS)
 install:: export
 clean::
 	rm -f $(TARGETS)
 
 ifeq ($(USE_PTHREADS), 1)
 $(OBJDIR)/foreign: $(OBJDIR)/foreign.o
-	$(CC) $(XCFLAGS) $< $(LDOPTS) $(LIBPLC) $(LIBPR) $(LIBPTHREAD) $(EXTRA_LIBS) -o $@
+	$(PURE) $(CC) $(XCFLAGS) $< $(LDOPTS) $(LIBPLC) $(LIBPR) $(LIBPTHREAD) $(EXTRA_LIBS) -o $@
 $(OBJDIR)/provider: $(OBJDIR)/provider.o
-	$(CC) $(XCFLAGS) $< $(LDOPTS) $(LIBPLC) $(LIBPR) $(LIBPTHREAD) $(EXTRA_LIBS) -o $@
+	$(PURE) $(CC) $(XCFLAGS) $< $(LDOPTS) $(LIBPLC) $(LIBPR) $(LIBPTHREAD) $(EXTRA_LIBS) -o $@
 $(OBJDIR)/socket: $(OBJDIR)/socket.o
-	$(CC) $(XCFLAGS) $< $(LDOPTS) $(LIBPLC) $(LIBPR) $(LIBPTHREAD) $(EXTRA_LIBS) -o $@
+	$(PURE) $(CC) $(XCFLAGS) $< $(LDOPTS) $(LIBPLC) $(LIBPR) $(LIBPTHREAD) $(EXTRA_LIBS) -o $@
 $(OBJDIR)/testfile: $(OBJDIR)/testfile.o
-	$(CC) $(XCFLAGS) $< $(LDOPTS) $(LIBPLC) $(LIBPR) $(LIBPTHREAD) $(EXTRA_LIBS) -o $@
+	$(PURE) $(CC) $(XCFLAGS) $< $(LDOPTS) $(LIBPLC) $(LIBPR) $(LIBPTHREAD) $(EXTRA_LIBS) -o $@
 endif
 
 #
 # Run the test programs with no arguments
 #
 # Test output goes to the file pointed to by the environment variable
 # NSPR_TEST_LOGFILE, if set, else to /dev/null
 #
--- a/pr/tests/socket.c
+++ b/pr/tests/socket.c
@@ -278,17 +278,17 @@ PRInt32 native_thread = 0;
 			break;
 		default:
 			PR_ASSERT(!"Invalid scope");
 			break;
 	}
 	if (native_thread) {
 #if defined(_PR_PTHREADS) && !defined(_PR_DCETHREADS)
 		pthread_t tid;
-		if (!pthread_create(&tid, NULL, start, arg))
+		if (!pthread_create(&tid, NULL, (void * (*)(void *)) start, arg))
 			return((PRThread *) tid);
 		else
 			return (NULL);
 #else
 		HANDLE thandle;
 		
 		thandle = (HANDLE) _beginthreadex(
 						NULL,
--- a/pr/tests/testfile.c
+++ b/pr/tests/testfile.c
@@ -127,17 +127,16 @@ PRInt32 native_thread = 0;
 			break;
 		default:
 			PR_ASSERT(!"Invalid scope");
 			break;
 	}
 	if (native_thread) {
 #if defined(_PR_PTHREADS) && !defined(_PR_DCETHREADS)
 		pthread_t tid;
-		printf("creating pthread\n");
 		if (!pthread_create(&tid, NULL, start, arg))
 			return((PRThread *) tid);
 		else
 			return (NULL);
 #else
 		HANDLE thandle;
 		
 		printf("creating Windows thread\n");
@@ -299,16 +298,29 @@ char tmpname[1024];
 		goto cleanup;
 	} else if (len != 0) {
 		printf(
 		"testfile PR_Available failed: expected/returned = %d/%d bytes\n",
 			0, len);
 		rv = -1;
 		goto cleanup;
 	}
+	if (PR_GetOpenFileInfo(fd_file, &file_info) < 0) {
+		printf("testfile PR_GetFileInfo failed on file %s\n",pathname);
+		goto cleanup;
+	}
+	if (LL_NE(file_info.creationTime , file_info1.creationTime)) {
+		printf(
+		"testfile PR_GetFileInfo returned incorrect status-change time: %s\n",
+		pathname);
+		printf("ft = %lld, ft1 = %lld\n",file_info.creationTime,
+									file_info1.creationTime);
+		rv = -1;
+		goto cleanup;
+	}
 	len = PR_Write(fd_file, out_buf->data, CHUNK_SIZE);
 	if (len < 0) {
 		printf("testfile failed to write to file %s\n",pathname);
 		rv = -1;
 		goto cleanup;
 	}
 	if (PR_GetOpenFileInfo(fd_file, &file_info) < 0) {
 		printf("testfile PR_GetFileInfo failed on file %s\n",pathname);
@@ -316,29 +328,22 @@ char tmpname[1024];
 	}
 	if (file_info.size != CHUNK_SIZE) {
 		printf(
 		"testfile PR_GetFileInfo returned incorrect size (%d should be %d) for file %s\n",
 		file_info.size, CHUNK_SIZE, pathname);
 		rv = -1;
 		goto cleanup;
 	}
-	if (LL_NE(file_info.creationTime , file_info1.creationTime)) {
-		printf(
-		"testfile PR_GetFileInfo returned incorrect creation time: %s\n",
-		pathname);
-		printf("ft = %lld, ft1 = %lld\n",file_info.creationTime,
-									file_info1.creationTime);
-		rv = -1;
-		goto cleanup;
-	}
-	if (LL_CMP(file_info.modifyTime, > , file_info1.modifyTime)) {
+	if (LL_CMP(file_info.modifyTime, < , file_info1.modifyTime)) {
 		printf(
 		"testfile PR_GetFileInfo returned incorrect modify time: %s\n",
 		pathname);
+		printf("ft = %lld, ft1 = %lld\n",file_info.modifyTime,
+									file_info1.modifyTime);
 		rv = -1;
 		goto cleanup;
 	}
 
 	len = PR_Available(fd_file);
 	if (len < 0) {
 		printf("testfile PR_Available failed on file %s\n",pathname);
 		rv = -1;