Subject: Re: [linux-audio-dev] MIDI routing, FIFO's etc.
From: Paul Barton-Davis (pbd_AT_Op.Net)
Date: la loka 09 1999 - 17:18:00 EDT
>Does anyone know if there is a way to make for example /dev/dsp wrapper
>which works in read/write mode ?
>maybe by letting the wrapper close the fifo filehandle, and reassign to this
>filedescriptor a unix socket using dup2() ?
just include read(2) and write(2) front-ends in the LD_PRELOAD
wrapper, and redirect the relevant file descriptors to the right
place:
write (int fd, ...) {
if (fd == read_pipe) {
fd = write_pipe;
}
/* do normal stuff */
}
read (int fd, ...) {
if (fd == write_pipe) {
fd = read_pipe;
}
/* do normal stuff */
}
This archive was generated by hypermail 2b28 : pe maalis 10 2000 - 07:27:13 EST