diff options
author | peter <peter@FreeBSD.org> | 2001-09-10 12:05:47 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 2001-09-10 12:05:47 +0000 |
commit | b8191006ede917ab84bb811958bf36de70c7d1d6 (patch) | |
tree | 764b7ba18d469d51f10c275c9439d04824f20360 | |
parent | 7d13aa56bf0a5cd36d2bbdefa28244dd5f81fa7b (diff) | |
download | FreeBSD-src-b8191006ede917ab84bb811958bf36de70c7d1d6.zip FreeBSD-src-b8191006ede917ab84bb811958bf36de70c7d1d6.tar.gz |
Fix a warning on alpha (real problem) and make pstat -t work as a bonus.
'struct tty' was out of sync in user and kernel due to dev_t/udev_t
mixups. This takes advantage of the fact that dev_t changes type in
userland, so it isn't too pretty.
-rw-r--r-- | sys/kern/tty.c | 2 | ||||
-rw-r--r-- | sys/sys/tty.h | 7 |
2 files changed, 7 insertions, 2 deletions
diff --git a/sys/kern/tty.c b/sys/kern/tty.c index 8d56bb3..1095864 100644 --- a/sys/kern/tty.c +++ b/sys/kern/tty.c @@ -2528,7 +2528,7 @@ sysctl_kern_ttys(SYSCTL_HANDLER_ARGS) SLIST_FOREACH(tp, &tty_list, t_list) { t = *tp; if (t.t_dev) - t.t_dev = (dev_t)dev2udev(t.t_dev); + t.ttyu.t_udev = dev2udev(t.t_dev); error = SYSCTL_OUT(req, (caddr_t)&t, sizeof(t)); if (error) return (error); diff --git a/sys/sys/tty.h b/sys/sys/tty.h index f8ee4fc..82f79f3 100644 --- a/sys/sys/tty.h +++ b/sys/sys/tty.h @@ -74,7 +74,11 @@ struct tty { struct clist t_outq; /* Device output queue. */ long t_outcc; /* Output queue statistics. */ int t_line; /* Interface to device drivers. */ - dev_t t_dev; /* Device. */ + union { + dev_t t_kdev; /* Device. */ + udev_t t_udev; /* Userland (sysctl) instance */ + void *t_devp; /* Keep user/kernel size in sync */ + } ttyu; int t_state; /* Device and driver (TS*) state. */ int t_flags; /* Tty flags. */ int t_timeout; /* Timeout for ttywait() */ @@ -105,6 +109,7 @@ struct tty { SLIST_ENTRY(tty) t_list; /* Global chain of ttys for pstat(8) */ }; +#define t_dev ttyu.t_kdev #define t_cc t_termios.c_cc #define t_cflag t_termios.c_cflag #define t_iflag t_termios.c_iflag |