Linux major/minor conversion not entirely correct
Ed Schouten
ed at 80386.nl
Mon Jun 2 14:47:49 UTC 2008
* John E Hein <jhein at 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 = strtoul(node + strlen("pts/"), NULL, 10);
> > + *major = 136 + (devno / 256);
> > + *minor = devno % 256;
> > + return 0;
>
> Where does the magic number 136 come from?
Linux uses major numbers 136,137,138,... for PTY's.
--
Ed Schouten <ed at 80386.nl>
WWW: http://80386.nl/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-emulation/attachments/20080602/43e2f825/attachment.pgp
More information about the freebsd-emulation
mailing list