diff options
Diffstat (limited to 'sys/kern/tty_pts.c')
-rw-r--r-- | sys/kern/tty_pts.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/sys/kern/tty_pts.c b/sys/kern/tty_pts.c index 16cbb3c..58cbc52 100644 --- a/sys/kern/tty_pts.c +++ b/sys/kern/tty_pts.c @@ -62,6 +62,7 @@ __FBSDID("$FreeBSD$"); #include <sys/systm.h> #include <sys/tty.h> #include <sys/ttycom.h> +#include <sys/user.h> #include <machine/stdarg.h> @@ -580,6 +581,18 @@ ptsdev_close(struct file *fp, struct thread *td) return (0); } +static int +ptsdev_fill_kinfo(struct file *fp, struct kinfo_file *kif, struct filedesc *fdp) +{ + struct tty *tp; + + kif->kf_type = KF_TYPE_PTS; + tp = fp->f_data; + kif->kf_un.kf_pts.kf_pts_dev = tty_udev(tp); + strlcpy(kif->kf_path, tty_devname(tp), sizeof(kif->kf_path)); + return (0); +} + static struct fileops ptsdev_ops = { .fo_read = ptsdev_read, .fo_write = ptsdev_write, @@ -592,6 +605,7 @@ static struct fileops ptsdev_ops = { .fo_chmod = invfo_chmod, .fo_chown = invfo_chown, .fo_sendfile = invfo_sendfile, + .fo_fill_kinfo = ptsdev_fill_kinfo, .fo_flags = DFLAG_PASSABLE, }; |