From owner-freebsd-emulation@FreeBSD.ORG Mon Jun 2 14:47:49 2008 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 80B641065672; Mon, 2 Jun 2008 14:47:49 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from palm.hoeg.nl (mx0.hoeg.nl [IPv6:2001:610:652::211]) by mx1.freebsd.org (Postfix) with ESMTP id 4A46A8FC19; Mon, 2 Jun 2008 14:47:49 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: by palm.hoeg.nl (Postfix, from userid 1000) id 6642E1CD58; Mon, 2 Jun 2008 16:47:44 +0200 (CEST) Date: Mon, 2 Jun 2008 16:47:44 +0200 From: Ed Schouten To: John E Hein Message-ID: <20080602144744.GU64397@hoeg.nl> References: <20080602073152.GO64397@hoeg.nl> <18500.1974.681847.564212@gromit.timing.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="B4kTqtjDNMSIbfiv" Content-Disposition: inline In-Reply-To: <18500.1974.681847.564212@gromit.timing.com> User-Agent: Mutt/1.5.18 (2008-05-17) Cc: freebsd-emulation@freebsd.org, philip@freebsd.org Subject: Re: Linux major/minor conversion not entirely correct X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jun 2008 14:47:49 -0000 --B4kTqtjDNMSIbfiv Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * John E Hein wrote: > Ed Schouten wrote at 09:31 +0200 on Jun 2, 2008: > > + /* > > + * Linux checks major and minors of the slave device > > + * to make sure it's a pty device, so let's make him > > + * believe it is. > > + */ > > + devno =3D strtoul(node + strlen("pts/"), NULL, 10); > > + *major =3D 136 + (devno / 256); > > + *minor =3D devno % 256; > > + return 0; >=20 > Where does the magic number 136 come from? Linux uses major numbers 136,137,138,... for PTY's. --=20 Ed Schouten WWW: http://80386.nl/ --B4kTqtjDNMSIbfiv Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAkhECBAACgkQ52SDGA2eCwV6AQCeMYE8lwW2+ue8pdziJ9Ol7SR7 XD4An1VqSVk0raWiZo8qEEe9fmieoYFI =33dv -----END PGP SIGNATURE----- --B4kTqtjDNMSIbfiv--