tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Open master pty (/dev/ptmx) non blocking



On Fri, 23 Sep 2022, David Holland wrote:

While my inclination would be to make it work, until someone wants to
figure out how to do that it seems straightforward to make O_NONBLOCK
fail:

Index: tty_ptm.c
===================================================================
RCS file: /cvsroot/src/sys/kern/tty_ptm.c,v
retrieving revision 1.43
diff -u -p -r1.43 tty_ptm.c
--- tty_ptm.c	29 Jun 2021 22:40:53 -0000	1.43
+++ tty_ptm.c	23 Sep 2022 20:12:07 -0000
@@ -338,6 +338,10 @@ ptmopen(dev_t dev, int flag, int mode, s
	dev_t ttydev;
	struct mount *mp;

+	if (flag & O_NONBLOCK) {
+		return EINVAL;
+	}
+


Or:
```
	if (flags & ~(O_RDWR | O_NOCTTY))
		return EINVAL;
```

-RVP


Home | Main Index | Thread Index | Old Index