diff --git a/sys/compat/linux/arch/i386/linux_machdep.c b/sys/compat/linux/arch/i386/linux_machdep.c index 693bf66fd90a..729e7a872e6a 100644 --- a/sys/compat/linux/arch/i386/linux_machdep.c +++ b/sys/compat/linux/arch/i386/linux_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux_machdep.c,v 1.103 2004/10/20 04:20:05 thorpej Exp $ */ +/* $NetBSD: linux_machdep.c,v 1.104 2004/11/13 07:20:54 christos Exp $ */ /*- * Copyright (c) 1995, 2000 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: linux_machdep.c,v 1.103 2004/10/20 04:20:05 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_machdep.c,v 1.104 2004/11/13 07:20:54 christos Exp $"); #if defined(_KERNEL_OPT) #include "opt_vm86.h" @@ -740,14 +740,22 @@ linux_fakedev(dev, raw) dev_t dev; int raw; { + extern const struct cdevsw ptc_cdevsw, pts_cdevsw; + const struct cdevsw *cd = cdevsw_lookup(dev); + if (raw) { #if (NWSDISPLAY > 0) extern const struct cdevsw wsdisplay_cdevsw; - if (cdevsw_lookup(dev) == &wsdisplay_cdevsw) + if (cd == &wsdisplay_cdevsw) return makedev(LINUX_CONS_MAJOR, (minor(dev) + 1)); #endif } + if (cd == &ptc_cdevsw) + return makedev(LINUX_PTC_MAJOR, minor(dev)); + if (cd == &pts_cdevsw) + return makedev(LINUX_PTS_MAJOR, minor(dev)); + return dev; } diff --git a/sys/compat/linux/arch/i386/linux_machdep.h b/sys/compat/linux/arch/i386/linux_machdep.h index 4c53112fc0c1..78b51b239830 100644 --- a/sys/compat/linux/arch/i386/linux_machdep.h +++ b/sys/compat/linux/arch/i386/linux_machdep.h @@ -1,4 +1,4 @@ -/* $NetBSD: linux_machdep.h,v 1.27 2003/09/06 22:09:21 christos Exp $ */ +/* $NetBSD: linux_machdep.h,v 1.28 2004/11/13 07:20:54 christos Exp $ */ /*- * Copyright (c) 1995, 2000 The NetBSD Foundation, Inc. @@ -155,10 +155,13 @@ struct linux_sigframe { }; /* - * Major device numbers of VT device on both Linux and NetBSD. Used in - * ugly patch to fake device numbers. + * Used in ugly patch to fake device numbers. */ -#define LINUX_CONS_MAJOR 4 +/* Major device numbers for new style ptys. */ +#define LINUX_PTC_MAJOR 2 +#define LINUX_PTS_MAJOR 3 +/* Major device numbers of VT device on both Linux and NetBSD. */ +#define LINUX_CONS_MAJOR 4 /* * Linux ioctl calls for the keyboard.