Ariff Abdullah 3fdb3676ba Apply more thorough fixes while dealing with device opening and closing:
- Determine open direction using 'flags', not 'mode'. This bug exist since
  past 4 years.
- Don't allow opening the same device twice, be it in a same or different
  direction.
- O_RDWR is allowed, provided that it is done by a single open (for example
  by mixer(8)) and the underlying hardware support true full-duplex operation.
- Do various paranoid checking in case other process/thread trying to hijack
  the same device twice (or more).

MFC after:	5 days
2006-03-21 06:35:48 +00:00
..
2006-03-20 19:48:02 +00:00
2006-03-18 01:45:29 +00:00
2006-03-20 19:46:56 +00:00
2006-03-19 12:55:51 +00:00
2006-03-20 21:44:12 +00:00
2006-01-21 10:44:34 +00:00
2006-03-04 15:50:46 +00:00
2006-02-26 17:52:51 +00:00
2006-02-28 21:25:00 +00:00
2006-01-30 16:32:08 +00:00