SYS V.3 Streams

Reggie Rippetoe reggie at dpmizar.sw.Datapoint.COM
Wed Jul 6 09:20:13 AEST 1988


I am trying to write a streams driver and I have a question about the
behavior of a part of it.

I have a put and a service routine for both the read and the write
side.  The read side seems to be working fine and I have no problems
with it.  On the write side I put some data in a buffer, issue a
write.  That write routine comes down into my driver where my service
routine calls the getq routine in a while loop getting a message off
the queue and then it calls a routine to process the message.  Once its
processed the message, it goes back to the service routine which hangs
in a loop until it gets a null signaling no more data to be read.  Upon
getting the null it returns back to the user program which issues
another write.  This second write always blocks.

I figure it is working all right, but I am just missing something.  My
process routine sees the data and I don't crash the system or anything
I am just unable to service another write.  When it blocks I can abort
and restart and it will work that one time but never a second.

I figured that any time the user issued a write it would invoke the put
procedure which would then invoke the service proc which would then
call my routine to process all the data until there was no more.  The
service routine would then would return and then the put proc would be
sitting there waiting for more data to come down with the next write.

Any ideas?

Reggie
{ucsd | uunet | com50}!dpmizar!reggie



More information about the Comp.unix.wizards mailing list