select()/stdio usage problem

Chris Torek chris at mimsy.umd.edu
Sat Feb 3 12:14:56 AEST 1990


In article <1988 at castle.ed.ac.uk> ssj at castle.ed.ac.uk (S Johal) writes:
>  (1) Is it *totally* portable/POSIX compatible to use _cnt ?

No: there is no guarantee that a `FILE *' can be followed to a `_cnt' field,
and in my stdio, there is no _cnt field.  (There are two called _r and _w
that, collectively, mean what _cnt used to.)

>  (2) if not, Have I missed something in stdio.h that will let me
>      do what I'm after ?

No.  stdio has no multiplexing feature analagous to select().  If you
need select(), you cannot use stdio; if you need stdio, you cannot use
select().

If absolutely necessary, you are probably best off by defining a small
system-dependent module to do what select does but on multiple FILE objects.
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
Domain:	chris at cs.umd.edu	Path:	uunet!mimsy!chris



More information about the Comp.unix.questions mailing list