ZLIBC - Uncompressing C Library (For Linux and SunOs)
Alain Knaff 1993-1999
Zlibc is a preloadable shared object that allows executables to
uncompress the datafiles that they need on the fly. No kernel patch,
no recompilation of these executables and no recompilation of the
libraries is needed.
This package overrides the "open" function (and other system call
functions) in the shared library.
This package uses the LD_PRELOAD/LD_LIBRARY_PATH mechanism to
redirect the dynamic linker to use the relevant functions out of
uncompress.o instead of the shared library. Thus, it should work with
every release of the shared library.
(An older, not recommended way to use zlibc is to have it patch the
jumptable. This is only available for a.out on Linux.)
How it works:
Usually, programs don't make system calls directly, but instead call
a function which does them. To open a file, first the "open" function
is called, and then this function makes the actual syscall. This
package patches the "open" function and other related functions.
With the zlibc, if the "open" system call fails because the file
doesn't exist, the "open" function constructs the filename of a
compressed file by appending .gz to the filename supplied by the user
program. If this compressed file exists, it is opened and piped trough
gunzip(1), and the descriptor of the read end of this pipe is returned
to the caller.
For certain extensions, the .gz file is first uncompressed into a
temporary file, and a read descriptor for this file is passed to the
caller. This is necessary if the caller wants to call lseek on the
descriptor or mmap it. A description of data files for which this is
necessary can be given in the configuration files /usr/lib/zlibrc and
~/.zlibrc. See zlibrc(5) for a detailed description of the syntax of
these configuration files.
The most up to date documentation is the texinfo documentation.
* To generate a printable copy, run the following commands:
./configure; make dvi; dvips zlibc.dvi
* To generate a html copy, run:
./configure; make html
A premade html copy can be found at:
* To generate an info copy (browsable using emacs' info mode), run:
./configure; make info
This doc looks most pretty when printed or as html. Indeed, in the
info version certain examples are difficult to read due to the quoting
conventions in info.
Manpages are less up to date and probably less readable as well.
There is also a sample configuration file called zlibrc.sample. The
compiled-in defaults are fairly complete, so normally you don't need
to use the run-time compilation. (The zlibrc.sample file reflects
roughly the compiled-in defaults.)
The file CAVEATS describes the limitations of this package.
The file BUGS describes the bugs of this package.
The file FAQ contains frequently asked questions and answers. It is
regularily updated on http://zlibc.linux.lu/FAQ.html
Alain L. Knaff firstname.lastname@example.org