Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uunet!mcsun!ukc!edcastle!ssj From: ssj@castle.ed.ac.uk (S Johal) Newsgroups: comp.unix.questions Subject: select()/stdio usage problem Message-ID: <1988@castle.ed.ac.uk> Date: 2 Feb 90 14:51:14 GMT Reply-To: ssj@castle.ed.ac.uk (S Johal) Organization: Edinburgh University Computing Service Lines: 25 I have an application that is event driven. I use select (- actually I use XtAddInput form X Toolkit Intrinsics stuff). That tells me if any input has arrived. I then use stdio.h gear to read from the descriptor. I read 'units' of information using stdio, the number of units arriving being an unknown integer number. My problem is that I could not find any stdio function that would do the equivilant of select - ie. as sort of "is there any more data left to be read ? - without actually reading it". So, what I did was look at stdio.h, and decided to use FILE->_cnt, to tell me if there are any items left in the buffer pool. The questions I need help with, are: (1) Is it *totally* portable/POSIX compatible to use _cnt ? (2) if not, Have I missed something in stdio.h that will let me do what I'm after ? *-------------------------------------------*----------------------------* * Subindrao Johal, *++++++++++++++++++++++++++++* * SARI Project, * tel: 031 668 1550 x219 * * Department of Electrical Engineering, * fax: 031 662 4678 * * University of Edinburgh, * email: ssj@sari.ed.ac.uk * * The King's Buildings, Edinburgh EH9 3JL *++++++++++++++++++++++++++++* *-------------------------------------------*----------------------------*