Zbigniew Zag�rski wrote:
> > > I have a question about unix I/O system.
> > > Can i create a "virtual" file which works like i'want
> > > and is represented as file descriptor. I mean that
> > > i call write(fd,...) and the kernel instead read from pie,file
> > > or socket is calling user defined function ?
> > > I want do use it for redirection of stdin/out for
> > > grahics console (like quake). I want to do it so to
> > > program will call read /write to/from stdin/out like
> > > in text mode, and the result will be on screen or from screen!
> >
> > The most straightforward way to do this is to redirect stdin/stdout to
> > a socket, a pty or a pair of pipes before the program is run, and have
> > a program at the other end.
>
> Yes you are right. I knew that i can do it using two (or more) processes
> but i looked for way to do it using one process.
Well, you could create a new character device driver, and put your
code in that, or create a pseudo-file in /proc. But it's generally
preferable to use a user-space process rather than add code to the
kernel if at all possible.
--
Glynn Clements <[EMAIL PROTECTED]>