[comp.os.minix] Non-blocking read

baron@wiesje.hobby.nl (Wim `Blue Baron' van Dorst) (06/15/91)

Hello *,

Presently I am developing a little game for which I need a non-blocking
read() on the terminal (/dev/tty1, stdin).  I found the outer stuff to 
handle those (fcntl(), read()), but the inner stuff (kernel/fs) does not 
appear to work as expected.  

Wondering how the non-blocking read system call was implemented at all
(in PC Minix 1.5.10 that is), I started to check things in the kernel 
and fs, and then I found suggestive references, e.g. to "temporary 
kludge" in fs/devices.c dev_io() where nonblocking info is handled.
This leads to the following theorem:

Theorem: Although it is suggested by various things that non-blocking 
	 read()s on /dev/tty?s are available in PC Minix 1.5.10, they 
	 are not completely implemented.

Could a knowledgeable person please comment on my theorem? Will upgrading
to 1.6.16 (full blown Posix) solve the problem?

Met vriendelijke groeten, Wim `Blue Baron' van Dorst
---------------------------------------------------------------------
Blue Baron = Wim van Dorst, Voice (+31) 074-443937, (+31) 02152-42319
(-:       baron@wiesje.hobby.nl           tgcpwd@urc.tue.nl       :-)
---------------------------------------------------------------------

ast@cs.vu.nl (Andy Tanenbaum) (06/17/91)

In article <9106143865@wiesje.hobby.nl> baron@wiesje.hobby.nl (Wim `Blue Baron' van Dorst) writes:
>Theorem: Although it is suggested by various things that non-blocking 
>	 read()s on /dev/tty?s are available in PC Minix 1.5.10, they 
>	 are not completely implemented.
>
>Could a knowledgeable person please comment on my theorem? Will upgrading
>to 1.6.16 (full blown Posix) solve the problem?

I believe 1.6.16 is somewhat further along on O_NONBLOCK.  The ultimate
goal, of course, if POSIX P1003.1 compliance, but this is not yet achieved.
In particular, the tty driver has not yet been tackled.


Andy Tanenbaum (ast@cs.vu.nl)