Buy GNU books!
|[ < ]||[ > ]||[ << ]||[ Up ]||[ >> ]||[Top]||[Contents]||[Index]||[ ? ]|
Usually, programs don't make system calls directly, but instead call a
library function which performs the actual system calls. For instance,
to open a file, the program first calls the
function, and then this function makes the actual syscall. Zlibc
open function and other related functions in order
to do the uncompression on the fly.
open system call fails because the file doesn't exist,
zlibc 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
the descriptor of the read end of this pipe is returned to the caller.
In some cases, the compressed 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
the file or
mmap it. A description of data files for which using
temporary is necessary can be given in the configuration files
`/usr/local/etc/zlibc.conf' (`/etc/zlibc.conf' on
`~/.zlibrc'. See section 5.2 Configuration files, for a detailed description
of their syntax.
Many user programs try to check the existence of a given file by other system calls before actually opening it. That's why zlibc also overrides these system calls. If for example the user program tries to stat a file, this call is also intercepted.
The compressed file, which exists physically on the disk, is also called 'the real file', and the uncompressed file, whose existence is only simulated by zlibc is called 'the virtual file'.
|webmaster||delorie software privacy|
|Copyright © 2003 by The Free Software Foundation||Updated Jun 2003|