NSPR 4.0 Release
Table of Contents
- What's New
- Library Version Specification
- Release Components
- Test Data
- Reporting bugs
- Building from source
- Contact Info
2.1 New functions and features1. Specification of security attributes of named objects
The security attributes of named objects (files, shared memory and semaphores) can now be specified with a platform-independent API at the time of creation; the access modes are similar to those in POSIX.2. Thread pools
A set of new interfaces for creating thread pools to create and manage jobs. This is a preliminary version of the API and is subject to change.3. Support for IPv6
The new interfaces and test programs (for sample usage) are found in:
Header files: prtpool.h
Test programs: pr/tests/thrpool_server.c
Support of IPv6 is now included for all platforms. The API is similar to the one defined in RFC 2553. The IPv6 implementation is based on the native IPv6 support, where available, and is emulated with IPv4 sockets and IPv4-mapped IPv6 addresses on other platforms. Native IPv6 support is available in the base OS on AIX 4.3.3 and Solaris 8.4. Support for blocking and unblocking interrupts.
An application can simultaneously use IPv4 and IPv6 sockets.
Header file: prio.h, prnetdb.h
Test program: pr/tests/socket.c
Two new interfaces, PR_BlockInterrupt and PR_UnblockInterrupt are added to NSPR. When a thread blocks interrupt, the interrupt is kept pending until it is unblocked.5. Source of random noise to seed pseudo-random number generators.
Header files: prthread.h
A new function, PR_GetRandomNoise, is available to generate random seeds.6. Server-side socket features for Mac
A set of server-side socket
features are supported on the Mac platform. These include accepting connections
7. Enhanced interface for dynamic load library function
A new function, PR_LoadLibraryWithFlags,
to support immediate-load/lazy-load options and
platform-specific library attributes.
8. Miscellaneous features
- New data types for file offset, PROffset32 and PROffset64
- Add PR_EXCL flag for PR_Open
- Add PR_SendFile to PRIOMethods table
- NSPR interfaces are declared with the dllimport attribute on Windows
2.2 Bug fixesThe bug fixes in NSPR 4.0 are listed in the report Bugzilla bug 29632.
2.3 Obsolete and Modified InterfacesNSPR 4.0 is not backward compatible with the previous releases of NSPR.
2.3.1 Obsolete libraryThe C++ I/O Streams library (prstrms.h, libprstrms3) is no longer part of the NSPR distribution.
2.3.2 Obsolete interfaces
A few interfaces have been removed from NSPR 4.0, they are listed in the report Obsolete interfaces in NSPR 4.0 Bugzilla bug 23642.
2.3.3 Modified interfaces
The semantics of a few interfaces are modified; they are listed in the report Bugzilla bug 23641
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
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.
|Thread Model||Build Name||Comments|
|Solaris||2.6||SparcWorks C/C++ 4.2||2.6
|7/64-bit||SparcWorks C/C++ 5.0||7/64-bit
|Windows||95||Visual C++ 6.0||95
|threads||WIN954.0_OPT.OBJ||MSVC 6.0 SP3|
|Win NT||4.0SP4||Visual C++ 6.0||4.0SP4
|WINNT4.0_OPT.OBJ||MSVC 6.0 SP3|
|AIX||4.3.3||C Set ++ for AIX 3.6.4 - xlC||4.3.3||pthreads||AIX4.3_OPT.OBJ||32-bit|
|4.3.3/64-bit||C Set ++ for AIX 3.6.4 - xlC||4.3.3/64-bit||pthreads||AIX4.3_64_OPT.OBJ||64-bit|
|Tru64 UNIX (the new name of Digital UNIX)||4.0D||Digital C++ v6.1-027
Digital CC v5.6-079
|Linux||Red Hat 6.0||egcs-1.1.2||RH 6.1||pthreads||Linux2.2_x86_glibc_PTH_OPT.OBJ||glibc-2.1.2|
Important changes to note are:
Solaris 8 is supported.2. AIX
Two binaries are provided for Solaris
1. A Solaris 2.6 binary is for 32-bit applications running on Solaris 2.6, 7 and 8.
2. A 64-bit Solaris 7 binary for 64-bit applications running on Solaris 7 and 8
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.,.
Two versions are supported
for AIX 4.3.3, one for 32-bit and another for 64-bit mode. AIX 4.3.2 is
A bug in the send_file function
in AIX causes data corruption in the 64-bit version of AIX. To work around
bug the environment variable NSPR_AIX_SEND_FILE_USE_DISABLED should be set to 1 when using the
64-bit version of NSPR.
Linux is now supported only
on the Redhat 6.1 release. The binaries are built with the egcs-1.1.2 compiler
4. Win 2000
The latest version of Windows, Windows 2000, is supported.
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.1 Platform DirectoryThe platform-dependent name of the directory where the components are placed is of the form
SunOS5.6_OPT.OBJ (optimized build)
AIX4.3_64_DBG.OBJ (64-bit, debug build)
6.2 Implementation StrategyFor 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 ComponentsUnder 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. 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 nspr. You do
not need to use plc if you just want to use the core nspr 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 and hash tables. 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, libultrasparc4.so should be copied into a file named libatomic.so 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, compile-et.pl, and a Java
4. mdheader.jar, jar file for the header files.
5. mdbinary.jar, jar for the libraries, executable programs, and scripts.
In addition, tests described in the Year 2000 Test Plan were successfully executed.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
NSPRPUB_RELEASE_4_0. You can check out the source from CVS by
cvs co -r NSPRPUB_RELEASE_4_0 mozilla/nsprpub
To build, do
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 mozilla.org