[comp.os.minix] System calls: particularly checking if input is available on stdin

matsl@nada.kth.se (Mats Luthman) (09/22/89)

I know how to do it in both BSD and AT&T UNIX, but I can't find a fcntl
function in libc.a (on MINIX-ST). I can find gtty and stty, but I can't find
documentation about them anywhere. I remember reading something about
them a long time ago, but I don't remember enough. Aren't they considered
obsolete? And by the way, is there a manual on MINIX system calls? I have the
book, but it doesn't say very much about how to use them, and gtty and stty
aren't even mentioned (in the index). I have the AT&T manual, but it doesn't
seem to help me, at least not in this case. Another thing I can't find is
macros for the mode parameter to open().

Another thing I want to know: if I want a certain function to be called
every time there is input available on a file descriptor, what do I do?
There is no SIGIO signal, so I wonder if it is at all possible.

ast@cs.vu.nl (Andy Tanenbaum) (09/23/89)

In article <1730@draken.nada.kth.se> matsl@nada.kth.se (Mats Luthman) writes:
>I know how to do it in both BSD and AT&T UNIX, but I can't find a fcntl
>function in libc.a (on MINIX-ST). I can find gtty and stty, but I can't find
>documentation about them anywhere. 

stty and gtty are just repackagings of ioctl, which is the standard V7 way to
control TTYs.  As to documentation, MINIX is more-or-less based on the V7
manual:
  The UNIX programmer's manual, Vols. 1-2
  Bell Labs
  Published by Holt Rinehart and Winston, 1983
  ISBN 0-03-061742-1

Andy Tanenbaum (ast@cs.vu.nl)

henry@utzoo.uucp (Henry Spencer) (09/23/89)

In article <1730@draken.nada.kth.se> matsl@nada.kth.se (Mats Luthman) writes:
>I know how to do it in both BSD and AT&T UNIX, but I can't find a fcntl
>function in libc.a (on MINIX-ST)...

This function did not exist in V7, which is what Minix is modelled on.
Nor did the ability to determine presence of pending input.

>.... doesn't say very much about how to use them, and gtty and stty
>aren't even mentioned (in the index).

Minix has probably emulated V7 in this regard:  gtty and stty were obsolete
backwards-compatibility interfaces for ioctl.  They can't do anything that
ioctl can't.

>... Another thing I can't find is macros for the mode parameter to open().

Again, in V7 there weren't any.  The mode parameter was specified as integer
values (0 readonly, 1 writeonly, 2 readwrite).

>Another thing I want to know: if I want a certain function to be called
>every time there is input available on a file descriptor, what do I do?
>There is no SIGIO signal, so I wonder if it is at all possible.

Can't be done in V7.  SIGIO is a hideous botch; I'm not surprised that
Andy didn't put it into Minix.
-- 
"Where is D.D. Harriman now,   |     Henry Spencer at U of Toronto Zoology
when we really *need* him?"    | uunet!attcan!utzoo!henry henry@zoo.toronto.edu