From owner-svn-src-all@FreeBSD.ORG Sat Oct 31 18:54:45 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 46CCB10656C0; Sat, 31 Oct 2009 18:54:45 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from palm.hoeg.nl (mx0.hoeg.nl [IPv6:2001:7b8:613:100::211]) by mx1.freebsd.org (Postfix) with ESMTP id DB1B98FC15; Sat, 31 Oct 2009 18:54:44 +0000 (UTC) Received: by palm.hoeg.nl (Postfix, from userid 1000) id F1EEE1CC4D; Sat, 31 Oct 2009 19:54:43 +0100 (CET) Date: Sat, 31 Oct 2009 19:54:43 +0100 From: Ed Schouten To: Christian Brueffer Message-ID: <20091031185443.GE1293@hoeg.nl> References: <200910311222.n9VCMOGk089115@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Rm5rkB9L8kG9H2n8" Content-Disposition: inline In-Reply-To: <200910311222.n9VCMOGk089115@svn.freebsd.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r198714 - head/sbin/mknod X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Oct 2009 18:54:45 -0000 --Rm5rkB9L8kG9H2n8 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hello Christian, * Christian Brueffer wrote: > The majors file was removed long ago, 0 should be used instead. It's a bit more complex than that. Right now devices are automatically numbered, using a 32-bits integer. The following macros are used to obtain the minor and major numbers (see ): | #define major(x) ((int)(((u_int)(x) >> 8)&0xff)) /* major number */ | #define minor(x) ((int)((x)&0xffff00ff)) /* minor number */ This means that a device number above 255 may (or may not) have a non-zero major number. Just run the following code: | #include | #include | #include |=20 | int | main(int argc, char *argv[]) | { |=20 | while (posix_openpt(O_RDWR|O_NOCTTY) >=3D 0); | sleep(30); | return (0); | } On my system it even generates device nodes in /dev/pts with a major number of 4. I wrote a manpage for these macros some time ago. See makedev(3). --=20 Ed Schouten WWW: http://80386.nl/ --Rm5rkB9L8kG9H2n8 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkrsh/MACgkQ52SDGA2eCwVVuACfe4j8+CKF2Hb4Rxn3pEbz3Zpz yYcAnjCOF15CDu9zQoIwL76KydvkWvU1 =A2LX -----END PGP SIGNATURE----- --Rm5rkB9L8kG9H2n8--