next up previous contents
Next: Entry Points Up: Prospero Library Manual Previous: Entry Points

Pcompat Library

The compatibility library includes replacements for existing system calls and library routines that interact with the directory service. The replacements optionally resolve names using the Prospero file system. The behavior depends on the value of the pfs_enable global variable. Possible values are defined in pcompat.h and are described below. Note that pfs_enable exists in only a single instance, even in a multithreaded context; setting it for one thread sets it for all.

The default Prospero installation procedure leaves the compatibility library in lib/pcompat/libpcompat.a. Programs linked with the compatibility library should also be linked with the pfs library, since the compatibility library uses some functions in libpfs.

The routines in the compatibility library are self-initializing; they will call p_initialize() and initialize all data structures internally. This makes it possible to relink existing programs with the compatibility library with less effort.

Like the POSIX readdir(), the Prospero readdir() is not multithread-safe because it uses internal data structures. We would gladly accept a contributed readdir_r(), but will not write it ourselves until a strong need appears.

As of this writing, the compatibility library does not run on as many machines as the pfs library does. Specifically, the compatibility library is known not to work on HP-UX and on AIX. Therefore, use of the pfs library is suggested for maximal portability. The compatibility library is not compiled by default. (See the Prospero installation instructions for instructions on how to compile it.).

If you are interested in the pcompat library, you should also look at the Prospero User's Manual, in the section titled The Compatibility Library.

Setting the environment variable PFS_DEBUG to a numeric value will cause the PCOMPAT library to set the PFS library's value of pfs_debug to that value. This is useful for debugging applications that use the compatibility library.

By default, the pfs compatability library will report Prospero errors encountered by compatibility functions such as open() to stderr. You can silence these error messages by setting the variable int pfs_quiet in your program to a non-zero value or by defining your own global variable pfs_quiet with a non-zero initialized value. The global variable pfs_quiet is not multi-threaded; a single instance of it is shared among multi-threaded programs.

 
Table: Settings for the pfs_enable global variable 


Value Meaning
PMAP_DISABLE Never resolve names within the virtual system.
PMAP_ENABLE Always resolve names within the virtual system.
PMAP_COLON Resolve names within the virtual system if they contain a :(colon).
PMAP_ATSIGN_NF Resolve names within the virtual system by default, but treat names beginnning with an @ or full path names that do not exist in the virtual system as native file system names.
PMAP_ATSIGN Resolve names within the virtual system by default, but treat names beginnning with an @ sign as native file system names.


next up previous contents
Next: Entry Points Up: Prospero Library Manual Previous: Entry Points



Padma Indraganti
Wed Jun 19 18:04:04 PDT 1996