DragonFly BSD
DragonFly users List (threaded) for 2005-09
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: Stdio and DragonFly changes


From: Oliver Fromme <check+inl4si00rsbhddo4@xxxxxxxxxx>
Date: 29 Sep 2005 16:15:32 GMT

Jonas Trollvik <jontro@xxxxxxxxx> wrote:
 > Dave Hayes <dave@xxxxxxxxxxx> wrote:
 > > I'm looking at a codefragment like this:
 > > 
 > >    if (stdin->_bf._size > 0)
 > >        return 1;
 > > 
 > > DragonFly's FILE struct has no _bf record. I think this code is
 > > trying to see if anything is in the stdin buffer. What would the
 > > proper way be on DragonFly? I'm thinking:
 > > 
 > >    if (stdin->_lbfsize > 0)
 > >        return 1;
 > > 
 > > as a wild uneducated guess.
 > 
 > Cant this be done with select or an ioctl?

No, select() and ioctl() work on file descriptors, not on
FILE*, so they don't know anything about stdio and its
buffering.  Dave's question was about the stdio buffer.

 > As far as I understand the application shouldnt depend on the fields
 > in FILE since these might change.

That's right.

In my opinion, an application which wants to know the size
of stdio's buffer is badly designed.

Best regards
   Oliver

-- 



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]