summaryrefslogtreecommitdiffstats
path: root/sys/compat/linux/linux_ioctl.c
diff options
context:
space:
mode:
authorcognet <cognet@FreeBSD.org>2006-01-26 01:32:46 +0000
committercognet <cognet@FreeBSD.org>2006-01-26 01:32:46 +0000
commitd6ecc915cc27c2d4d19e9d25926a18aae2eb5e13 (patch)
treebfc9e20a70f6bb0baac20efbd33dc290aa7a6058 /sys/compat/linux/linux_ioctl.c
parentaff5d6bf80c7cee1d2a2e3b664554663ba72ae78 (diff)
downloadFreeBSD-src-d6ecc915cc27c2d4d19e9d25926a18aae2eb5e13.zip
FreeBSD-src-d6ecc915cc27c2d4d19e9d25926a18aae2eb5e13.tar.gz
Linux compat bits needed to make linux programs use the new ptys :
linux_ioctl.[ch] : Implement LINUX_TIOCGPTN, which returns the pty number linux_stats.c : - Return the magic number for devfs. - In various stats()-related functions, check that we're stating a file in /dev/pts, and if so, change the st_rdev field to match what linux expects to be there for a slave pty device. The glibc checks for this, and their openpty() fails if it is no correct.
Diffstat (limited to 'sys/compat/linux/linux_ioctl.c')
-rw-r--r--sys/compat/linux/linux_ioctl.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/sys/compat/linux/linux_ioctl.c b/sys/compat/linux/linux_ioctl.c
index 44b5fa5..14568e2 100644
--- a/sys/compat/linux/linux_ioctl.c
+++ b/sys/compat/linux/linux_ioctl.c
@@ -1010,7 +1010,15 @@ linux_ioctl_termio(struct thread *td, struct linux_ioctl_args *args)
args->cmd = TIOCCBRK;
error = (ioctl(td, (struct ioctl_args *)args));
break;
-
+ case LINUX_TIOCGPTN: {
+ int nb;
+
+ error = fo_ioctl(fp, TIOCGPTN, (caddr_t)&nb, td->td_ucred, td);
+ if (!error)
+ error = copyout(&nb, (void *)args->arg,
+ sizeof(int));
+ break;
+ }
default:
error = ENOIOCTL;
break;
OpenPOWER on IntegriCloud