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.1 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 release 3.1 of nspr is now available at /m/dist/nspr20/v3.1. This release is backward compatible with the v 3.0 release of nspr. Results of Y2K Compliance testing are documented.

2. What's New

Several new cross-platform and platform-specific features are available in this release, in addition to bug fixes.

2.1 New functions and features

1. Support for creation of kernel/bound threads
A new value of PRThreadScope, PR_GLOBAL_BOUND_THREAD, can be used to create a kernel/bound thread on platforms where native support is available.
2.  Faster implementation of atomic operations
The implementation of atomic operations now uses multiple locks, as opposed to a single global lock, on platforms that don't support native atomic operations.
3. Enhancement implementation of PLEvent
Multiple event queues can be created on all platforms. Global data and functions referencing global data (e.g. PL_GetMainEventQueue()) have been removed. Event queues may be created using different notification methods: platform native methods and monitored (using PRMonitor). See specs/plevent.html for specification of all changes.
4. Inheritance of file descriptors
NSPR file descriptors can be inherited by a child process from a parent process when using PR_CreateProcess. This feature is fully supported on Unix and NT and partially supported on Win95/98 (sockets cannot be inherited).
5. Localizable error code translation
The NSPR error codes can be translated to text strings with UTF-8 encoding. NSPR provides translation to US-English text, with support for adding callback functions for translation to other languages.

The implementation is for a draft/preliminary API and is subject to change in future releases without affecting backward compatibility.

6.  Faster implementation of TransmitFile function on AIX

        The new implementation uses the native send_file function on AIX 4.3.2, for faster performance.

7. Static libraries not supported

        Static libraries are no longer supported.

8. Year 2000 Certification

        A Year 2000 Test Plan was executed successfully on all the supported platforms and the results documented.

2.2 Bug fixes

Several bugs are fixed in this release.

2.3 Obsolete  interface

The reader-writer lock interface in libnsps is obsolete as it is now implemented in libnspr.

3. Library Name and Versioning

Starting with this release, the name of the nspr name will contain the major number of the release; the new name is libnspr3, except for the Win95 version of NSPR. The Win95 library name is shortened to nspr3, to conform to the MS-DOS 8.3 rule and also to differentiate with the NT build of nspr library. The minor releases of nspr will contain new features/bug-fixes, but will be backward compatible with earlier minor releases with the same major number.

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.


Release/Build Name

Certified OS releases


Solaris 2.5.1 
Sun WorkShop 4.2
Solaris 2.6
Sun WorkShop 4.2
Irix  6.2 
6.5  MIPS Pro 7.2.1/-n32
AIX 4.2 
Digital Unix 4.0D 
4.0D DEC C V5.6-079
DIGITAL C++ V6.1-027
HP-UX 10.10 
A.10.30 HP C Compiler
HP-UX (pthreads) 
11.0 A.11.01.00 HP C Compiler
a HP ANSI C++ B3910B A.03.13
HP-UX (64-bit) 11.0 
11.0 A.11.00.00  HP C Compiler
HP aC++ B3910B A.03.04
Linux (Redhat) Redhat 5.2 (kernel 2.0)
Redhat 5.2
kernel 2.0 and 2.2.1
g++: egcs-1.0.3
Windows NT 4.0 
4.0 SP3/SP4 VC++ 4.2
Windows 95 Win 95 
Win 95
Win 98 
Win NT 4.0
VC++ 4.2

Important changes to note are:

1. Irix

The pthreads-based (n32) version of nspr is now the default and only version available. The sproc-based version (o32) is discontinued..
2. Solaris
Two binaries are supported for Solaris

1. The Solaris 2.5.1 binary is for applications running on Solaris 2.5.1 and Solaris 2.6.
2. The Solaris 2.6 binary is for applications running on Solaris 2.6 and 2.7.

The two binaries are needed because Sun does not support applications built on Solaris 2.5.1 but run on Solaris 2.7.

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. Win32
Support for NT 3.51 is no longer available for both the Win NT and Win95 builds of NSPR.

5. Compatibility

The  release v 3.1 of nspr is both source code and binary compatible with the v3.0 release of nspr.

For the nspr library, binary 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>]_<DBG/OPT>.OBJ

  For example,
      SunOS5.5.1_OPT.OBJ (optimized build)
      IRIX6.2_n32_PTH_DBG.OBJ (built using the -n32 compiler option,
              pthreads implementation strategy)

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. Two other
    libraries are built on server platforms only: ares and prstrms.  Only shared (dynamic link) and purified
    (for a subset of platforms) versions of the libraries are built.

The nspr library exports the core nspr20 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 command-line option functions.

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.

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 all platforms, except for Win95/98.

7.1 Runtime Error Detection

A subset of the test programs were run successfully on Solaris and Windows NT (both Win95 and Win NT versions) with the purify program.

 8. Reporting bugs

Bugs discovered should be reported by filing a report in Bugsplat. The following information is required
  • platform (Solaris 2.5.1, 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_1.  You can check out the source from CVS by
    cvs co -r NSPR20_RELEASE_3_1 ns/nspr20

To build, do
    cd ns/nspr20
    gmake export

10. Contact Info - NSPR documentation (Update on 2006-01-10: this has moved.)
http://warp/projects/hardcore/prj-nspr20  - nspr home page
nsprgroup   - the nspr team
nspr20eng  - mailing list for nspr developers
nspr20clients - mailing list for nspr clients
netscape.public.mozilla.nspr  - nspr newsgroup at