[comp.os.minix] First open and last close for devices

dal@syntel.mn.org (Dale Schumacher) (10/09/89)

In researching the Minix device driver code, specifically the tty driver(s),
a serious problem of missing functionality has come up.  It seems that
Minix has no concept of "first open" and "last close" for a device.  How
is a device supposed to know when to perform initialization and reset
functions, like raising and lowering DTR to an external modem, without
this kind of support.  Simply counting the open()s and close()s will not
work, since a device (and ttys specifically) can be and are often close()d
more times than they are open()ed.  As pointed out by an earlier message
about the exit() function, many programs end by closing, instead of just
flushing, the 3 standard streams, but there are no corresponding opens,
since the streams were inherited from the parent (usually the shell).
So, has anyone considered how "first open" and "last close" hooks could
be added to Minix, or how else to solve this problem?

\\   /  Dale Schumacher                         399 Beacon Ave.
 \\ /   (alias: Dalnefre')                      St. Paul, MN  55104-3527
  ><    ...umn-cs!midgard.mn.org!syntel!dal     United States of America
 / \\   "What is wanted is not the will to believe, but the will to find out,
/   \\  which is the exact opposite." -Bertrand Russell