#
d4892ee5 |
| 13-Dec-2008 |
Ed Schouten <ed@FreeBSD.org> |
Add FIONREAD to pseudo-terminal master devices.
All ioctl()'s that aren't implemented by pts(4) are forwarded to the TTY itself. Unfortunately this is not correct for FIONREAD, because it will give
Add FIONREAD to pseudo-terminal master devices.
All ioctl()'s that aren't implemented by pts(4) are forwarded to the TTY itself. Unfortunately this is not correct for FIONREAD, because it will give the wrong amount of bytes that are available to read.
Tested by: keramida Reminded by: keramida
show more ...
|
#
1ff90be7 |
| 11-Dec-2008 |
Ed Schouten <ed@FreeBSD.org> |
Add kqueue()-support to pseudo-terminal master devices.
One thing I didn't expect many applications to use, was kqueue() on pseudo-terminal master devices. There are applications that use kqueue() o
Add kqueue()-support to pseudo-terminal master devices.
One thing I didn't expect many applications to use, was kqueue() on pseudo-terminal master devices. There are applications that use kqueue() on the TTY itself (rtorrent, etc). That doesn't mean we shouldn't implement this. Libraries like libevent use kqueue() by default, which means they wouldn't be able to use kqueue().
The old TTY layer implements a very broken version of kqueue() by performing the actual polling on the TTY device.
Discussed with: peter
show more ...
|
Revision tags: release/6.4.0_cvs, release/6.4.0 |
|
#
394e9407 |
| 04-Nov-2008 |
Ed Schouten <ed@FreeBSD.org> |
Remove redundant return value tests.
There is no need to test whether the return value is non-zero here. Just return the error number directly.
|
#
b6163710 |
| 23-Sep-2008 |
Ed Schouten <ed@FreeBSD.org> |
Track state to determine if the associated TTY device node has been used.
It turns out our old TTY layer (and other implementations) block when you read() on a PTY master device of which the slave d
Track state to determine if the associated TTY device node has been used.
It turns out our old TTY layer (and other implementations) block when you read() on a PTY master device of which the slave device node has not been opened yet. Our new implementation just returned 0. This caused applications like telnetd to die in a very subtle way (when child processes would open the TTY later than the first call to select()).
Introduce a new flag called PTS_FINISHED, which indicates whether we should block or bail out of a read() or write() occurs.
Reported by: Claude Buisson <clbuisson orange fr>
show more ...
|
#
37ddf38e |
| 21-Sep-2008 |
Ed Schouten <ed@FreeBSD.org> |
Make fstat() on a pseudo-terminal master return sane timestamps.
Because pseudo-terminal master file descriptors no longer have a vnode underneath, we have to fill in fstat() values ourselves. Make
Make fstat() on a pseudo-terminal master return sane timestamps.
Because pseudo-terminal master file descriptors no longer have a vnode underneath, we have to fill in fstat() values ourselves. Make our implementation somewhat sane by returning the timestamps of the TTY device node that corresponds with our file descriptor.
Obtained from: //depot/projects/mpsafettty/...
show more ...
|
#
64308260 |
| 04-Sep-2008 |
Ed Schouten <ed@FreeBSD.org> |
Implement pts(4) packet mode.
As reported by several users on the mailing lists, applications like screen(1) fail to properly handle ^S and ^Q characters. This was because MPSAFE TTY didn't implemen
Implement pts(4) packet mode.
As reported by several users on the mailing lists, applications like screen(1) fail to properly handle ^S and ^Q characters. This was because MPSAFE TTY didn't implement packet mode (TIOCPKT) yet. Add basic packet mode support to make these applications work again.
Obtained from: //depot/projects/mpsafetty/...
show more ...
|
#
6137be43 |
| 22-Aug-2008 |
Ed Schouten <ed@FreeBSD.org> |
Fix pts(4) error codes when slave device is closed.
Unlike pre-MPSAFE TTY, the pts(4) driver always returned ENXIO when a read() or write() was performed on a pseudo-terminal master device when the
Fix pts(4) error codes when slave device is closed.
Unlike pre-MPSAFE TTY, the pts(4) driver always returned ENXIO when a read() or write() was performed on a pseudo-terminal master device when the slave device was not opened. The old implementation had different semantics:
- When the slave device had not been opened yet, read() and write() just blocked. - When the slave device had been closed, a read() call would return 0 bytes length. - When the slave device had been closed, a write() call would return EIO.
Change the new implementation to return 0 and EIO as well. We don't implement the first rule, but I suspect this is not needed, because routines like openpty() also open the slave device node. posix_openpt() users also do similar things.
Reported by: rink Tested by: rink
show more ...
|
#
bc093719 |
| 20-Aug-2008 |
Ed Schouten <ed@FreeBSD.org> |
Integrate the new MPSAFE TTY layer to the FreeBSD operating system.
The last half year I've been working on a replacement TTY layer for the FreeBSD kernel. The new TTY layer was designed to improve
Integrate the new MPSAFE TTY layer to the FreeBSD operating system.
The last half year I've been working on a replacement TTY layer for the FreeBSD kernel. The new TTY layer was designed to improve the following:
- Improved driver model:
The old TTY layer has a driver model that is not abstract enough to make it friendly to use. A good example is the output path, where the device drivers directly access the output buffers. This means that an in-kernel PPP implementation must always convert network buffers into TTY buffers.
If a PPP implementation would be built on top of the new TTY layer (still needs a hooks layer, though), it would allow the PPP implementation to directly hand the data to the TTY driver.
- Improved hotplugging:
With the old TTY layer, it isn't entirely safe to destroy TTY's from the system. This implementation has a two-step destructing design, where the driver first abandons the TTY. After all threads have left the TTY, the TTY layer calls a routine in the driver, which can be used to free resources (unit numbers, etc).
The pts(4) driver also implements this feature, which means posix_openpt() will now return PTY's that are created on the fly.
- Improved performance:
One of the major improvements is the per-TTY mutex, which is expected to improve scalability when compared to the old Giant locking. Another change is the unbuffered copying to userspace, which is both used on TTY device nodes and PTY masters.
Upgrading should be quite straightforward. Unlike previous versions, existing kernel configuration files do not need to be changed, except when they reference device drivers that are listed in UPDATING.
Obtained from: //depot/projects/mpsafetty/... Approved by: philip (ex-mentor) Discussed: on the lists, at BSDCan, at the DevSummit Sponsored by: Snow B.V., the Netherlands dcons(4) fixed by: kan
show more ...
|
#
0bc7bc0e |
| 04-Aug-2008 |
John Baldwin <jhb@FreeBSD.org> |
- Close a race with concurrent open's of a pts master device which could result in leaked tty structures. - When constructing a new pty, allocate it's tty structure before adding it to the list.
- Close a race with concurrent open's of a pts master device which could result in leaked tty structures. - When constructing a new pty, allocate it's tty structure before adding it to the list.
MFC after: 1 week
show more ...
|
#
237fdd78 |
| 16-Mar-2008 |
Robert Watson <rwatson@FreeBSD.org> |
In keeping with style(9)'s recommendations on macros, use a ';' after each SYSINIT() macro invocation. This makes a number of lightweight C parsers much happier with the FreeBSD kernel source, inclu
In keeping with style(9)'s recommendations on macros, use a ';' after each SYSINIT() macro invocation. This makes a number of lightweight C parsers much happier with the FreeBSD kernel source, including cflow's prcc and lxr.
MFC after: 1 month Discussed with: imp, rink
show more ...
|
Revision tags: release/7.0.0_cvs, release/7.0.0, release/6.3.0_cvs, release/6.3.0 |
|
#
22af4cab |
| 05-Jul-2007 |
Peter Wemm <peter@FreeBSD.org> |
Fix bad function type passed to destroy_dev_sched_cb().
Approved by: re (rwatson)
|
#
0a9c2b6d |
| 03-Jul-2007 |
Konstantin Belousov <kib@FreeBSD.org> |
Use make_dev_credf(MAKEDEV_REF) instead of make_dev() from the clone handler. Lock Giant in the clone handler. Use destroy_dev_sched() explicitely from pty_maybecleanup() and postpone pty_release() u
Use make_dev_credf(MAKEDEV_REF) instead of make_dev() from the clone handler. Lock Giant in the clone handler. Use destroy_dev_sched() explicitely from pty_maybecleanup() and postpone pty_release() until both master and slave cdevs are destroyed by setting it as callback for destroy_dev_sched().
Debugging help and testing by: Peter Holm Approved by: re (kensmith)
show more ...
|
Revision tags: release/6.2.0_cvs, release/6.2.0 |
|
#
abdeb3b0 |
| 08-Jan-2007 |
Robert Watson <rwatson@FreeBSD.org> |
Canonicalize copyrights in some files I hold copyrights on:
- Sort by date in license blocks, oldest copyright first. - All rights reserved after all copyrights, not just the first. - Use (c) to be
Canonicalize copyrights in some files I hold copyrights on:
- Sort by date in license blocks, oldest copyright first. - All rights reserved after all copyrights, not just the first. - Use (c) to be consistent with other entries.
MFC after: 3 days
show more ...
|
#
acd3428b |
| 06-Nov-2006 |
Robert Watson <rwatson@FreeBSD.org> |
Sweep kernel replacing suser(9) calls with priv(9) calls, assigning specific privilege names to a broad range of privileges. These may require some future tweaking.
Sponsored by: nCircle
Sweep kernel replacing suser(9) calls with priv(9) calls, assigning specific privilege names to a broad range of privileges. These may require some future tweaking.
Sponsored by: nCircle Network Security, Inc. Obtained from: TrustedBSD Project Discussed on: arch@ Reviewed (at least in part) by: mlaier, jmg, pjd, bde, ceri, Alex Lyashkov <umka at sevcity dot net>, Skip Ford <skip dot ford at verizon dot net>, Antoine Brodin <antoine dot brodin at laposte dot net>
show more ...
|
#
1ac27db5 |
| 01-Nov-2006 |
John Baldwin <jhb@FreeBSD.org> |
Increment nb_allocated while holding the pt_mtx lock to avoid races.
|
#
9045eda2 |
| 01-Nov-2006 |
John Baldwin <jhb@FreeBSD.org> |
Comment and style tweak.
|
#
9b206de5 |
| 29-Sep-2006 |
Martin Blapp <mbr@FreeBSD.org> |
Free tty struct after last close. This should fix the pty-leak by numbers. Remove workarounds for tty_refcount beeing 0, this will be fixed differently later.
|
#
9fddcc66 |
| 27-Sep-2006 |
Ruslan Ermilov <ru@FreeBSD.org> |
Fix our ioctl(2) implementation when the argument is "int". New ioctls passing integer arguments should use the _IOWINT() macro. This fixes a lot of ioctl's not working on sparc64, most notable bein
Fix our ioctl(2) implementation when the argument is "int". New ioctls passing integer arguments should use the _IOWINT() macro. This fixes a lot of ioctl's not working on sparc64, most notable being keyboard/syscons ioctls.
Full ABI compatibility is provided, with the bonus of fixing the handling of old ioctls on sparc64.
Reviewed by: bde (with contributions) Tested by: emax, marius MFC after: 1 week
show more ...
|
Revision tags: release/5.5.0_cvs, release/5.5.0, release/6.1.0_cvs, release/6.1.0 |
|
#
3bf14fd5 |
| 28-Apr-2006 |
Robert Watson <rwatson@FreeBSD.org> |
Also check use_pty in the ptmx clone lookup; this means that when ptmx support is turned off using the sysctl, we no longer even allow the ptmx device to be looked up.
Foot provided by: peter
|
#
b4e12c03 |
| 31-Jan-2006 |
Christian S.J. Peron <csjp@FreeBSD.org> |
Allow root to open prison pts devices too.
Pointed out by: rwatson
|
#
4c0b1995 |
| 30-Jan-2006 |
Robert Watson <rwatson@FreeBSD.org> |
Move pts master devices into /dev/pty/ instead of littering /dev with them; this is more consistent with the placement of slaves in /dev/pts. The actual name doesn't matter as it's not part of the e
Move pts master devices into /dev/pty/ instead of littering /dev with them; this is more consistent with the placement of slaves in /dev/pts. The actual name doesn't matter as it's not part of the exposed API or used by libc. In some sense, it would be nice if these device nodes didn't have to have names in devfs at all.
Suggested by: Stephen McKay <smckay at internode dot on dot net>
show more ...
|
#
5276d747 |
| 29-Jan-2006 |
Robert Watson <rwatson@FreeBSD.org> |
Rename use_old_pty variable to use_pts, as this more accurately reflects the sense of the variable.
Suggested by: dwhite
|
#
23c15e64 |
| 27-Jan-2006 |
Olivier Houchard <cognet@FreeBSD.org> |
Merge a bunch of changes that where done in tty_pty.c after tty_pts.c was forked from it, but missed from some reason.
|
#
f94cf2b1 |
| 27-Jan-2006 |
Olivier Houchard <cognet@FreeBSD.org> |
Take into account that bits 0x0000ff00 can't be used for minor.
|
#
169c4490 |
| 26-Jan-2006 |
Olivier Houchard <cognet@FreeBSD.org> |
Don't attempt to re-create the /dev entry for the slave part if it already exist when opening the master. This can happen if one open the master, then open the slave, then close and re-open the maste
Don't attempt to re-create the /dev entry for the slave part if it already exist when opening the master. This can happen if one open the master, then open the slave, then close and re-open the master.
Reported by: Peter Holm
show more ...
|