#include <fcntl.h>

#define BUFSIZE 1024
void main(void) 
{
        char buf[BUFSIZE];
        int fds[2];
        int dsp = open("/dev/dsp",O_RDWR);
        pipe(fds);
        if(fork())
                for (;;) {
                        read(dsp,buf,BUFSIZE);
                        write(fds[1],buf,BUFSIZE);
                }
        else
                for (;;) {
                        read(fds[0],buf,BUFSIZE);
                        write(dsp,buf,BUFSIZE);
                }
}

