home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.unix.questions:13632 comp.unix.aix:11733
- Path: sparky!uunet!gatech!destroyer!gumby!wupost!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!rutgers!igor.rutgers.edu!gauss.rutgers.edu!manmetha
- From: manmetha@gauss.rutgers.edu (Rajesh Malhotra)
- Newsgroups: comp.unix.questions,comp.unix.aix
- Subject: Non blocking reads from stdin
- Keywords: non blocking getchar()
- Message-ID: <Nov.19.11.24.21.1992.26240@gauss.rutgers.edu>
- Date: 19 Nov 92 16:24:22 GMT
- Followup-To: comp.unix.aix
- Organization: Rutgers Univ., New Brunswick, N.J.
- Lines: 32
-
-
- Fellow Netters,
-
- How would I do a nonblocking read on stdin.
-
- i.e have getchar() to be nonblocking in case there is no input.
- I can implement this by having an alarm go off after a timeout and then
- continue.
-
- But is there an ioctl command that would do non-blocking i/o?
- I tried
-
- ioctl(fileno(stdin), FIOBNIO, 0)
-
- but it does not like the FIONBIO command and I get an EINVAL errno.
- Any insight on this matter?
-
- BTW, I am running AIX 3.2 on an IBM RS6000.
-
- Any and all responses would be greatly appreciared.
-
- Thanx,
-
- Raj.
- --
- ===============================================================================
- __ __ .
- / __/ / Raj Malhotra.
- / ( /_ / voice : (908)613 4313.
- __/ email : manmetha@gauss.rutgers.edu
-
- ===============================================================================
-