Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 2 Jun 2008 16:47:44 +0200
From:      Ed Schouten <ed@80386.nl>
To:        John E Hein <jhein@timing.com>
Cc:        freebsd-emulation@freebsd.org, philip@freebsd.org
Subject:   Re: Linux major/minor conversion not entirely correct
Message-ID:  <20080602144744.GU64397@hoeg.nl>
In-Reply-To: <18500.1974.681847.564212@gromit.timing.com>
References:  <20080602073152.GO64397@hoeg.nl> <18500.1974.681847.564212@gromit.timing.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--B4kTqtjDNMSIbfiv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

* John E Hein <jhein@timing.com> 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 <ed@80386.nl>
 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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080602144744.GU64397>