
From kcbbs.gen.nz!nbree  Sat Dec 18 14:04:59 1993 remote from mwc
Received: by lepanto.mwc.com (smail2.5.3-coh) id AA05812; 18 Dec 93 14:04:59 GMT (Sat)
Received: by mwc.com (smail2.5.3-coh) id AA20743; 18 Dec 93 13:29:25 GMT (Sat)
Received: from kcbbs.gen.nz (via [202.14.102.1]) by relay1.UU.NET with SMTP 
	(5.61/UUNET-internet-primary) id AA20458; Sat, 18 Dec 93 08:09:30 -0500
Received: from localhost (nbree@localhost) by kcbbs.gen.nz (8.5/8.5) id BAA14952; Sun, 19 Dec 1993 01:35:19 +1300
From: Nigel Bree <nbree@kcbbs.gen.nz>
Message-Id: <199312181235.BAA14952@kcbbs.gen.nz>
Subject: Re: dev_t
To: fred@lepanto.mwc.com (Fred Butzen)
Date: Sun, 19 Dec 93 1:35:16 GMT+12:00
In-Reply-To: <9312170717.AA03259@lepanto.mwc.com>; from "Fred Butzen" at Dec 17, 93 7:17 am
X-Mailer: ELM [version 2.3 PL0]
Status: RO

Fred Butzen sez:
> > <sys/types.h>, although one has to have the right #defines active to get
> > the dev_t you want. By default you get the oldCoh/iBCS2 dev_t, using
> > -D_KERNEL for DDI/DKI compiles gets the 32-bit version. That is the only
> > place it can be got from, too.

> From my reading of the DDI/DKI docs, it appears that dev_t contains both
> the major number and the minor number, so I expected it to be a struct.
> That was why I couldn't find it - I was expecting something else entirely.
> Is my reading totally off?

No, it contains both numbers.  However, the two numbers are encoded into
a single larger number because the original primitive version of C with
which Unix was developed did not support structure values very well, and
most C compilers (except for gcc and the MIPS C compiler) still do not. 

This is why functions like getemajor () exist; the decoding of the major/
minor numbers from the single encoded value requires knowledge of how they
are encoded, and that is the kind of knowledge that it is best to insulate
drivers from having to know.



