Possibility of an extra device?

Alex Waugh alex at alexwaugh.com
Wed Feb 5 07:53:45 PST 2003

Maarten Bezemer wrote:
> On 5 Feb 2003 "Alex Waugh" <alex at alexwaugh.com> wrote:
>>Maarten Bezemer wrote:
>>>On 5 Feb 2003 "Nick Burrett" <nick at dsvr.net> wrote:
>>>>Maarten Bezemer wrote:
>>>>>Hereby a patch for a user definable device. I think it may be handy for
>>>>>some particular situations. At least it gets used by CVS :-)
>>>>So what are the benefits of having a user definable device ? I can't 
>>>>think of any applications off the top of my head.
>>>I use it for CVS to connect a file stream (stdout, stdin) to a
>>>socket (via a buffer). So all data send to stdout won't be visible on
>>>the screen, but will be sended trough a given socketed with the right
>>>CVS was build this way and I had to continue it.
>>How are you making use of the device? Is your program modifying the 
>>device structure to point reads/writes to the user device to it's own 
>>routines? What interface does CVS use to set things up on unix?
> CVS on unix runs a thread with the ssh protocol (or another) running
> and opens a pipe to it and send/received all its data trought it.

Do you really mean a thread, or a separate process?

> But running different threads at the same time on the commandline it
> quite impossible right now. So a pipe is not a option...
> So I had to think of some other possibilities and for sending/receiving
> ssh data for the client I managed to create a special buffer and
> connect it to the stdin/stdout but for the server side it would be
> sufficient because CVS is runned from another program (CVSServer) and
> the Socket must be passed on also. So I put the socket number in my new
> device and my function used that number to read/send data and passes it
> on the the stdout or receives it from the stdin.

I think I understand, I'm just a little concerned that to use this new 
device you have to modify internal unixlib structures, which could 
easily break if unixlib changes.


Alex Waugh                                           alex at alexwaugh.com

PHP, Roots, Subversion, WebJames and more from http://www.alexwaugh.com/

More information about the gcc mailing list