summaryrefslogtreecommitdiffstats
path: root/sys/compat/linux
diff options
context:
space:
mode:
Diffstat (limited to 'sys/compat/linux')
-rw-r--r--sys/compat/linux/linux_ioctl.c9
-rw-r--r--sys/compat/linux/linux_stats.c12
2 files changed, 18 insertions, 3 deletions
diff --git a/sys/compat/linux/linux_ioctl.c b/sys/compat/linux/linux_ioctl.c
index b166535..083548e 100644
--- a/sys/compat/linux/linux_ioctl.c
+++ b/sys/compat/linux/linux_ioctl.c
@@ -296,6 +296,11 @@ struct linux_winsize {
unsigned short ws_xpixel, ws_ypixel;
};
+struct speedtab {
+ int sp_speed; /* Speed. */
+ int sp_code; /* Code. */
+};
+
static struct speedtab sptab[] = {
{ B0, LINUX_B0 }, { B50, LINUX_B50 },
{ B75, LINUX_B75 }, { B110, LINUX_B110 },
@@ -395,7 +400,7 @@ bsd_to_linux_termios(struct termios *bios, struct linux_termios *lios)
lios->c_oflag |= LINUX_OPOST;
if (bios->c_oflag & ONLCR)
lios->c_oflag |= LINUX_ONLCR;
- if (bios->c_oflag & OXTABS)
+ if (bios->c_oflag & TAB3)
lios->c_oflag |= LINUX_XTABS;
lios->c_cflag = bsd_to_linux_speed(bios->c_ispeed, sptab);
@@ -537,7 +542,7 @@ linux_to_bsd_termios(struct linux_termios *lios, struct termios *bios)
if (lios->c_oflag & LINUX_ONLCR)
bios->c_oflag |= ONLCR;
if (lios->c_oflag & LINUX_XTABS)
- bios->c_oflag |= OXTABS;
+ bios->c_oflag |= TAB3;
bios->c_cflag = (lios->c_cflag & LINUX_CSIZE) << 4;
if (lios->c_cflag & LINUX_CSTOPB)
diff --git a/sys/compat/linux/linux_stats.c b/sys/compat/linux/linux_stats.c
index 7c85fb4..c5f10af 100644
--- a/sys/compat/linux/linux_stats.c
+++ b/sys/compat/linux/linux_stats.c
@@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$");
#include <sys/stat.h>
#include <sys/syscallsubr.h>
#include <sys/systm.h>
+#include <sys/tty.h>
#include <sys/vnode.h>
#include <sys/conf.h>
#include <sys/fcntl.h>
@@ -109,8 +110,17 @@ translate_fd_major_minor(struct thread *td, int fd, struct stat *buf)
if (fp->f_vnode != NULL &&
fp->f_vnode->v_un.vu_cdev != NULL &&
linux_driver_get_major_minor(fp->f_vnode->v_un.vu_cdev->si_name,
- &major, &minor) == 0)
+ &major, &minor) == 0) {
buf->st_rdev = (major << 8 | minor);
+ } else if (fp->f_type == DTYPE_PTS) {
+ struct tty *tp = fp->f_data;
+
+ /* Convert the numbers for the slave device. */
+ if (linux_driver_get_major_minor(tp->t_dev->si_name,
+ &major, &minor) == 0) {
+ buf->st_rdev = (major << 8 | minor);
+ }
+ }
fdrop(fp, td);
}
OpenPOWER on IntegriCloud