You are currently viewing a snapshot of taken on April 21, 2008. Most of this content is highly out of date (some pages haven't been updated since the project began in 1998) and exists for historical purposes only. If there are any pages on this archive site that you think should be added back to, please file a bug.


NSPR 3.5 Release


Table of Contents

  1. Introduction
  2. What's New
  3. Library Version Specification
  4. Platforms
  5. Compatibility
  6. Release Components
  7. Test Data
  8. Reporting bugs
  9. Building from source
  10. Contact Info

1. Introduction

The NSPR 3.5 release is available at /m/dist/nspr20/v3.5. This release is backward compatible with the 3.1 release of NSPR.

2. What's New

In addition to several bug fixes the following new features are available in this release, as compared to NSPR 3.1

2.1 New functions and features

1. Support for 64-bit features on Solaris 2.7 and AIX 4.3.2
A new port of NSPR with 64-bit support is available for Solaris 2.7 and AIX 4.3.2. This is in addition to a 32-bit library for AIX 4.3.2 and Solaris 2.6.
2.  Inter-process Communication
Shared memory (named and anonymous) and named semaphores for inter-process communication are available.

The new interfaces and test programs (for sample usage) for shared memory are found in:

Header files: prshm.h, prshma.h
Test programs: pr/tests/nameshm1.c, pr/tests/anonfm.c

For semaphores, the interface declarations and test cases are in

Header file: pripcsem.h
Test programs: pr/tests/sema.c, semaping.c and semapong.c

3. A new function for sending parts of a file across a socket connection along with optional header and trailer data.
A new function, PR_SendFile, is available to send a specified length of file data from an arbitrary offset, along with  optional header and/or trailer data. This function is implemented using a native sendfile function on platforms with such a facility. The features of PR_SendFile are a superset of the existing PR_TransmitFile interface. However, PR_SendFile is not implemented as a method in the PRIOMethods table and it cannot be invoked on a
layered fd.

Header file: prio.h
Test program: pr/tests/socket.c

4. Simultaneous support for IPv4 and IPv6
Both IPv4 and IPv6 sockets can now be used in the same process. This feature is available, by default, on AIX 4.3.2, which is currently the only platform supporting IPv6 as a basic feature. For other platforms, a NSPR library with IPv4 and IPv6 support can be built by setting the environment variable USE_IPV6 to 1.

New functions:


Header files: prio.h, prnetdb.h
Test programs: pr/tests/gethost.c, ipv6.c, socket.c

5. Improved support for native threads on Windows NT
For applications that use only global (native) threads on NT, an environment variable, NSPR_NATIVE_THREADS_ONLY, can be set at runtime for better support. In this mode, only Win32 threads (and no fibers) are created even when an application specifies local threads. This allows an application to make a blocking call from any thread without blocking the entire application. The performance of some functions is improved; the PRLock/Unlock interfaces, for example, directly call the native lock functions on NT. Currently, the multiwait interfaces in NSPR are not supported in this mode.
6.  Cancellation of IO requests on NT

        A new function, PR_NT_CancelIO, is available to cancel outstanding IO operations on NT. Prior to the availability of
        this feature, an I/O operation that times out or is interrupted required the closing of the file descriptor. Now, the
        outstanding IO operation can be canceled with PR_NT_CancelIO and new IO requests issued for that file descriptor.

        Header file: private/pprio.h
        Test program: pr/tests/socket.c

7. Improved IO performance on Unix

        NSPR now implements multiple IO continuation threads for improved scalability, especially on MP systems. The IO
        performance is also improved by optimized processing of multiple IO requests for the same file descriptor.

2.2 Bug fixes

All of the bug fixes from NSPR releases 3.1.1 and 3.1.2  are present in the 3.5 release, in addition to the following fixes:

1.  Bug 361007 -- Recording the internal name in NSPR shared libraries
2.  Bug 360959 -- message "Unrecognized NSPR_LOG_MODULE:..."
3.  Bug 345378 -- The default layered acceptread method (pl_DefAcceptread) is incorrect
4.  Bug 353121 -- Porting to DEC's IPv6 EAK Version X6.3
5.  Bug 346686 -- Improving error-code mapping functions
6.  Bug 361694 -- prmwait.c: Order of initialization in TimerInit for NT
7.  Bug 357769 -- NSPR init should not assume that stdin/out/err are valid file descriptors
8.  Bug 362221 -- PR_WaitProcess and PR_DetachProcess do not free the PRProcess structure on Unix
9.  Bug 362233 -- PR_VersionCheck is incorrect
10. Bug 361686 -- Blocking IO functions modify thread state without acquiring thread lock
11. Bug 361659 -- ntio.c: _PR_MD_CLOSE should check me->io_suspended
12. Bugzilla bug 5358 -- PR_StackPush and PR_StackPop are not implemented on Solaris/x86
13. Bugzilla bug 10201 -- HP-UX 10.20 nees x bit set on shared libraries
14. Bugzilla bug 11455 -- -mno-486 added to PLATFORM_FLAGS

2.3 Obsolete interface

The asynchronous resolver library (arlib or libares) is no longer part of the NSPR distribution (since the 3.1.1 release).

3. Library Name and Versioning

The binaries for this release are named libnspr3 (nspr3 on Win 95); this release is backward compatible with 3.1 release.

The full release number of nspr library can be determined in several ways:

1. The nspr library exports a function, libVersionPoint, that can be called to retrieve the version of the library.  The function and data prototypes are available for other libraries to provide similar version information.
2. On Win32 systems, the version number is embedded in the resource descriptor of the DLL and can be viewed using Windows Explorer. On Unix system, the "what" command of sccs or the "ident" command of rcs can be used to obtain the version information.
3. The PR_VersionCheck function can be called to check for compatibility; given a version number the function returns success condition if the version of the nspr library loaded into the application is compatible.

4. Platforms

The set of supported platforms is listed in the following table. For most platforms, a single release of the nspr library is used to support all the current releases of the OS.
Platform Build Compiler
Certify &
Thread Model  Build Name Comments
Solaris  2.6 SparcWorks C/C++ 4.2 2.6
pthreads SunOS5.6_OPT.OBJ 
2.7/64-bit SparcWorks C/C++ 5.0 2.7/64-bit pthreads SunOS5.7_64_OPT.OBJ
Windows 95 Visual C++ 6.0 95
NT 4.0
threads WIN954.0_OPT.OBJ MSVC 6.0 SP3
Win NT 4.0SP4 Visual C++ 6.0 4.0SP4
threads &
AIX  4.3.2 C Set ++ for AIX 3.6.4 - xlC 4.3.2 pthreads AIX4.3_OPT.OBJ Required patch:
PTF U463956
4.3.2/64-bit C Set ++ for AIX 3.6.4 - xlC 4.3.2/64-bit pthreads AIX4.3_64_OPT.OBJ Required patch:
PTF U463956
Tru64 UNIX (the new name of Digital UNIX) 4.0D Digital C++ v6.1-027
Digital CC v5.6-079
pthreads OSF1V4.0D_OPT.OBJ Certification of NSPR on 4.0E is recommended but not required by Compaq
HP-UX 11.0 aCC: A.03.13
cc: A.11.01.00
11.0 pthreads HP-UXB.11.00_OPT.OBJ
11.0/64-bit aCC: A.03.04
cc: A.11.00.00
11.0/64-bit pthreads HP-UXB.11.00_64_OPT.OBJ
Linux 2.2 (Red Hat 6.0) egcs-1.1.2 2.2 pthreads Linux2.2_x86_glibc_PTH_OPT.OBJ glibc-2.1-x (x=0.990222 or later) 

Important changes to note are:

1. Irix

Irix binaries are not available in this release; Irix is no longer supported as a Tier-1 platform.
2. Solaris
Two binaries are supported for Solaris

1. A Solaris 2.6 binary is for 32-bit applications running on Solaris 2.6 and 2.7.
2. A 64-bit Solaris 2.7 binary for 64-bit applications running on Solaris 2.7

Solaris 2.5.1 is not supported.

To use purify on Solaris, libpthread should be explicitly specified in the list of libraries passed to the linker, ahead of other system libraries such as -lposix4, -lsocket, -ldl, etc.,.

3. AIX

        Two versions are supported for AIX 4.3.2, one for 32-bit and another for 64-bit mode. AIX 4.2 is no longer supported.

        The AIX patch "PTF U463956" is required; this patch contains a fix for a bug in the send_file function that causes data
        corruption. If the revision level of an AIX system is or higher, the installation of this patch is implied. To use
        NSPR 3.5 on a system without this patch, the environment variable NSPR_AIX_SEND_FILE_USE_DISABLED should
        be set to 1.

        The bug in send_file appears to be present in 64-bit mode even when this patch is installed. So, the environment variable
        NSPR_AIX_SEND_FILE_USE_DISABLED should be set to 1 when using the 64-bit build of NSPR.

        The type of the 'len' argument to the streambuf::setbuf() method changed from 'int' to 'long' in 64-bit AIX.  This makes the
        compiler think the setbuf method of the derived class PRfilebuf hides the same-named virtual function of the base class.
        So is broken on 64-bit AIX.  (Bugsplat bug# 361776.)

4. HP-UX

        The HP-UX 10.10 and 10.20 releases are no longer supported.

5. Linux

        Linux is now supported only for kernel version of 2.2 on the Redhat 6.0 release. The binaries are built with the
        egcs-1.1.2 compiler and glibc-2.1.x library.

6. Win NT and Win 95

        The NSPR libraries for both Windows platforms are built with VC 6.0 (SP3).

5. Compatibility

The NSPR 3.5 release is backward compatible with NSPR 3.1.

For the nspr library, backward compatibility does not preclude the addition of new error codes to the set of nspr error codes already defined. An application should allow for nspr functions returning error codes not documented for the particular release with which it is linked. This helps to retain backward compatibility as new error codes are added upon discovery of new information about platform-specific error codes.

6. Release Components

The main components of this release are a set of shared libraries and header files for each platform. A debug build and a release (optimized) build of the libraries are made available for each platform.

6.1 Platform Directory

The platform-dependent name of the directory where the components are placed is of the form

  <os-name><os-version>[_<compiler>][cpu-arch][_<implementation strategy>][_<addr-bits>]_<DBG/OPT>.OBJ

  For example,
      SunOS5.6_OPT.OBJ (optimized build)
      AIX4.3_64_DBG.OBJ (64-bit, debug build)

6.2 Implementation Strategy

For the implementation of nspr, different strategies are used on  different platforms. On some platforms the nspr threads map directly to the native threads on the platform, while on others nspr supports both threads that are scheduled by nspr and the native threads.

 The default implementation strategies in this release are:
  - pthreads: all Unix platforms
  - classic: Win NT (combined MxN model, with Windows threads and fibers)
  - native threads: Win95

6.3 Components

Under each <platform> directory, there are:

1. include directory, containing the header files
2. lib directory, containing the libraries. Three libraries are built on all platforms: nspr, plc, plds. One other
    library is built on server platforms only:  prstrms.  Only shared (dynamic link) versions of the libraries are built.

The nspr library exports the core nspr functions.

The plc (Portable Library C) library is a separate library from  the core nspr20.  You do
not need to use plc if you just want to use the core nspr20 functions.  The plc library currently
contains thread-safe string functions and functions for processing command-line options.

The plds (Portable Library Data Structures) library supports data structures such as arenas, hash tables, and event queues.  It is important to note that services of  plds are not thread-safe. To use these services in a multi-threaded environment, clients have to implement their own thread-safe access, by acquiring locks/monitors, for example.

For Solaris platforms with UltraSparc processors only, a platform-specific library, libultrasparc, is also supplied. This library implements optimized versions of atomic operations by using the features present in the UltraSparc (V9) processors, but not in the Sparc (V8) processors.  This library is linked into libnspr, with the name libatomic, by use of the auxiliary filter mechanism of the Solaris linker. To use this library at runtime, on UltraSparc systems, should be copied into a file named and the new file should be present in the path searched by the linker, set using LD_LIBRARY_PATH.

3. bin directory, containing a perl script,, and a Java bundle,
4. mdheader.jar, jar file for the header files.
5. mdbinary.jar,  jar for the libraries, executable programs, and scripts.

7. Test Data

All the major functional areas of nspr were tested using the programs in the nspr test suite. Both functional and stress tests in the pr/tests directory were successfully run on multi-processor systems for most platforms, except for Win95/98.

 8. Reporting bugs

Bugs discovered should be reported by filing a report in Bugsplat. The following information is required
  • platform (Solaris 2.6, HP-UX 11.0, etc.)
  • number of cpus in the system
  • a stack trace, in the event of a crash
  • reproducibility of the problem
  • location of core dump, if available, along with those for the libraries and executables

 9. Building from source

This release is built from the source, at the CVS repository rooted at /m/src, with the CVS tag
NSPR20_RELEASE_3_5.  You can check out the source from CVS by
    cvs co -r NSPR20_RELEASE_3_5 ns/nspr20

To build, do
    cd ns/nspr20
    gmake export

10. Contact Info - NSPR documentation
http://warp/projects/hardcore/prj-nspr20  - nspr home page
nsprgroup   - the nspr team
nspr20clients - mailing list for nspr clients
netscape.public.mozilla.nspr  - nspr newsgroup at