"Fossies" - the Fresh Open Source Software Archive 
Member "alsa-oss-1.1.8/oss-redir/README" (7 Jan 2019, 1253 Bytes) of package /linux/misc/alsa-oss-1.1.8.tar.bz2:
As a special service "Fossies" has tried to format the requested text file into HTML format (style:
standard) with prefixed line numbers.
Alternatively you can here
view or
download the uninterpreted source code file.
1 Open Sound System call redirector
2 =================================
3
4 The purpose of this little piece of code is to redirect
5 OSS (Open Sound System) calls to any shared library to avoid
6 overhead caused with the LD_PRELOAD wrapper. Especially,
7 wrapping select() and poll() functions cause big overhead.
8
9 In ideal world, all OSS programs will use this little code
10 to allow a sound emulation for OSS based APIs without requirement
11 of ugly LD_PRELOAD hacks.
12
13 Usage
14 =====
15
16 Set environment variable OSS_REDIRECTOR to name of dynamic library
17 with lib_oss_* public functions. For example (ALSA):
18
19 export OSS_REDIRECTOR=libalsatoss.so
20
21 If this variable is not set, or this value is "oss" or "OSS",
22 the direct system calls are used.
23
24 Porting OSS application to use this code
25 ========================================
26
27 All functions have equivalent as using syscalls. Only one exception
28 is select() or poll() usage. It is required to use oss_pcm_select*()
29 or oss_pcm_poll*() wrappers to determine the "real" used file
30 descriptors and mangle back the result.
31
32 Note that the *prepare() functions returns the count of file
33 descriptors allocated (poll) or the maximum used file descriptor
34 (select).
35
36 Porting example
37 ===============
38
39 FIXME: Add a link to a good patch.