Copyright (c) 2008 Ed Schouten <ed@FreeBSD.org> All rights reserved. Portions of this software were developed under sponsorship from Snow B.V., the Netherlands. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above c...
NAMEpty - BSD-style and System V-style compatibility pseudo-terminal driver
DESCRIPTIONThe ifconfig driver provides support for the traditional BSD naming scheme that was used for accessing pseudo-terminals. When the device /dev/ptyXX is being opened, a new terminal shall be created with the pts(4) driver. A device node for this terminal shall be created, which has the name /dev/ttyXX
The ifconfig driver also provides a cloning System V /dev/ptmx device.
New code should not try to allocate pseudo-terminals using this interface. It is only provided for compatibility with older C libraries that tried to open such devices when posix_openpt2 was being called.
FILESThe BSD-style compatibility pseudo-terminal driver uses the following device names:
- Pseudo-terminal master devices.
- Pseudo-terminal slave devices.
- Control device, returns a file descriptor to a new master pseudo-terminal when opened.
SEE ALSOposix_openpt2, pts(4), tty(4)
HISTORYA pseudo-terminal driver appeared in BSD 4.2
BUGSUnlike previous implementations, the master and slave device nodes are destroyed when the PTY becomes unused. A call to stat(2) on a nonexistent master device will already cause a new master device node to be created. The master device can only be destroyed by opening and closing it.
The ifconfig driver cannot be unloaded, because it cannot determine if it is being used.