summaryrefslogtreecommitdiffstats
path: root/sys/kern/tty_pty.c
Commit message (Collapse)AuthorAgeFilesLines
* Rename lminor() to dev2unit(). This function gives a linear unit numberphk2000-09-191-2/+2
| | | | | | | | | | | | which hides the 'hole' in the minor bits. Introduce unit2minor() to do the reverse operation. Fix some some make_dev() calls which didn't use UID_* or GID_* macros. Kill the v_hashchain alias macro, it hides the real relationship. Introduce experimental SI_CHEAPCLONE flag set it on cloned bpfs.
* Avoid the modules madness I inadvertently introduced by making thephk2000-09-021-32/+1
| | | | | | | | | | | | | | | | | | cloning infrastructure standard in kern_conf. Modules are now the same with or without devfs support. If you need to detect if devfs is present, in modules or elsewhere, check the integer variable "devfs_present". This happily removes an ugly hack from kern/vfs_conf.c. This forces a rename of the eventhandler and the standard clone helper function. Include <sys/eventhandler.h> in <sys/conf.h>: it's a helper #include like <sys/queue.h> Remove all #includes of opt_devfs.h they no longer matter.
* Remove all traces of Julians DEVFS (incl from kern/subr_diskslice.c)phk2000-08-201-9/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | Remove old DEVFS support fields from dev_t. Make uid, gid & mode members of dev_t and set them in make_dev(). Use correct uid, gid & mode in make_dev in disk minilayer. Add support for registering alias names for a dev_t using the new function make_dev_alias(). These will show up as symlinks in DEVFS. Use makedev() rather than make_dev() for MFSs magic devices to prevent DEVFS from noticing this abuse. Add a field for DEVFS inode number in dev_t. Add new DEVFS in fs/devfs. Add devfs cloning to: disk minilayer (ie: ad(4), sd(4), cd(4) etc etc) md(4), tun(4), bpf(4), fd(4) If DEVFS add -d flag to /sbin/inits args to make it mount devfs. Add commented out DEVFS to GENERIC
* Unused include: #include "pty.h"peter2000-06-101-1/+0
|
* Since ptys are allocated dynamically, there is no needs to keep theirache2000-05-011-1/+1
| | | | t_timeout across close, so move t_timeout initializing to ptcopen
* Set t_timeout to its default sysctl value only once in ttyopenache2000-05-011-0/+1
| | | | | | Initialize t_timeout to -1 for this reason Pointed-by: bde
* Correct an oversight in jail() that allowed processes in jail to accessrwatson2000-02-091-1/+8
| | | | | | | | | ptys in ways that might be unethical, especially towards processes not in jail, or in other jails. Submitted by: phk Reviewed by: rwatson Approved by: jkh
* Revert peter's commit to remove cdevsw_add() - it was a bit prematurejkh1999-11-211-0/+2
| | | | | since things fail to function properly without it (pty allocation becomes somewhat haphazard).
* Remove cdevsw_add() as the make_dev()'s are done in a clone-like fashion.peter1999-11-181-2/+0
| | | | | (ie: the next device is created with make_dev as the first is opened and so on)
* sigset_t change (part 2 of 5)marcel1999-09-291-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ----------------------------- The core of the signalling code has been rewritten to operate on the new sigset_t. No methodological changes have been made. Most references to a sigset_t object are through macros (see signalvar.h) to create a level of abstraction and to provide a basis for further improvements. The NSIG constant has not been changed to reflect the maximum number of signals possible. The reason is that it breaks programs (especially shells) which assume that all signals have a non-null name in sys_signame. See src/bin/sh/trap.c for an example. Instead _SIG_MAXSIG has been introduced to hold the maximum signal possible with the new sigset_t. struct sigprop has been moved from signalvar.h to kern_sig.c because a) it is only used there, and b) access must be done though function sigprop(). The latter because the table doesn't holds properties for all signals, but only for the first NSIG signals. signal.h has been reorganized to make reading easier and to add the new and/or modified structures. The "old" structures are moved to signalvar.h to prevent namespace polution. Especially the coda filesystem suffers from the change, because it contained lines like (p->p_sigmask == SIGIO), which is easy to do for integral types, but not for compound types. NOTE: kdump (and port linux_kdump) must be recompiled. Thanks to Garrett Wollman and Daniel Eischen for pressing the importance of changing sigreturn as well.
* Remove five now unused fields from struct cdevsw. They should neverphk1999-09-251-10/+0
| | | | | | | | have been there in the first place. A GENERIC kernel shrinks almost 1k. Add a slightly different safetybelt under nostop for tty drivers. Add some missing FreeBSD tags
* This patch clears the way for removing a number of tty relatedphk1999-09-251-16/+6
| | | | | | | | | | | | | | | | | | | | | fields in struct cdevsw: d_stop moved to struct tty. d_reset already unused. d_devtotty linkage now provided by dev_t->si_tty. These fields will be removed from struct cdevsw together with d_params and d_maxio Real Soon Now. The changes in this patch consist of: initialize dev->si_tty in *_open() initialize tty->t_stop remove devtotty functions rename ttpoll to ttypoll a few adjustments to these changes in the generic code a bump of __FreeBSD_version add a couple of FreeBSD tags
* s/si_tty_tty/si_tty/gphk1999-08-301-12/+12
|
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Convert DEVFS hooks in (most) drivers to make_dev().phk1999-08-231-14/+7
| | | | | | | | | | | | | | | | Diskslice/label code not yet handled. Vinum, i4b, alpha, pc98 not dealt with (left to respective Maintainers) Add the correct hook for devfs to kern_conf.c The net result of this excercise is that a lot less files depends on DEVFS, and devtoname() gets more sensible output in many cases. A few drivers had minor additional cleanups performed relating to cdevsw registration. A few drivers don't register a cdevsw{} anymore, but only use make_dev().
* First small steps at merging DEVFS and PHK's Dev_t stuff.julian1999-08-201-25/+8
|
* Devfs isn't quite dead yet... Add back devfs support to ptys..julian1999-08-171-1/+36
| | | | | | When you use pty(N) it creates pty(N+1) ready for your use in the DEVFS, so DEVFS is not cluttered up with hundreds of ptys you are never going to use.
* Add new sysctl "kern.ttys" which return all the struct tty's which havephk1999-08-081-1/+2
| | | | | | been registered with ttyregister(). register ptys with ttyregister().
* Make the pty driver as close to a cloning device as we can get for now,phk1999-08-081-99/+62
| | | | | | | | | we create the pty on the fly when it is first opened. If you run out of ptys now, just MAKEDEV some more. This also demonstrate the use of dev_t->si_tty_tty and dev_t->si_drv1 in a device driver.
* Simplify cdevsw registration.phk1999-05-311-6/+3
| | | | | | | | | | | | | | | | | | | | | | | | | The cdevsw_add() function now finds the major number(s) in the struct cdevsw passed to it. cdevsw_add_generic() is no longer needed, cdevsw_add() does the same thing. cdevsw_add() will print an message if the d_maj field looks bogus. Remove nblkdev and nchrdev variables. Most places they were used bogusly. Instead check a dev_t for validity by seeing if devsw() or bdevsw() returns NULL. Move bdevsw() and devsw() functions to kern/kern_conf.c Bump __FreeBSD_version to 400006 This commit removes: 72 bogus makedev() calls 26 bogus SYSINIT functions if_xe.c bogusly accessed cdevsw[], author/maintainer please fix. I4b and vinum not changed. Patches emailed to authors. LINT probably broken until they catch up.
* This commit should be a extensive NO-OP:phk1999-05-301-13/+41
| | | | | | | | | | | | | Reformat and initialize correctly all "struct cdevsw". Initialize the d_maj and d_bmaj fields. The d_reset field was not removed, although it is never used. I used a program to do most of this, so all the files now use the same consistent format. Please keep it that way. Vinum and i4b not modified, patches emailed to respective authors.
* TIOCEXT is also inapproriate before the slave is open, return EAGAIN whenluoqi1999-05-181-29/+31
| | | | | | these ioctls are attempted. Move a misplaced comment. Pointed out by: Bruce
* Ignore some ioctls on the master until the slave is open.luoqi1999-05-141-3/+12
|
* I got tired of seeing all the cdevsw[major(foo)] all over the place.phk1999-05-081-2/+2
| | | | | | | | Made a new (inline) function devsw(dev_t dev) and substituted it. Changed to the BDEV variant to this format as well: bdevsw(dev_t dev) DEVFS will eventually benefit from this change too.
* Suser() simplification:phk1999-04-271-2/+2
| | | | | | | | | | | | | | | | | | | 1: s/suser/suser_xxx/ 2: Add new function: suser(struct proc *), prototyped in <sys/proc.h>. 3: s/suser_xxx(\([a-zA-Z0-9_]*\)->p_ucred, \&\1->p_acflag)/suser(\1)/ The remaining suser_xxx() calls will be scrutinized and dealt with later. There may be some unneeded #include <sys/cred.h>, but they are left as an exercise for Bruce. More changes to the suser() API will come along with the "jail" code.
* Use suser() to check for super user rather than examining cr_uid directly.phk1999-01-301-2/+2
| | | | | | Use TTYDEF_SPEED rather than 9600 a couple of places. Reviewed by: bde, with a few grumbles.
* Added D_TTY to the cdevswitch flags for all tty drivers. This is requiredbde1998-08-231-14/+18
| | | | | | | | | for the Lite2 fix for always returning EIO in dead_read(). Cleaned up the cdevswitch initializers for all tty drivers. Removed explicit calls to ttsetwater() from all (tty) drivers. ttsetwater() is now called centrally for opens, not just for parameter changes.
* Changed %n to %r in devfs name format strings. %n has almost gone away.bde1998-07-151-3/+3
|
* This commit fixes various 64bit portability problems required fordfr1998-06-071-2/+2
| | | | | | | | | | FreeBSD/alpha. The most significant item is to change the command argument to ioctl functions from int to u_long. This change brings us inline with various other BSD versions. Driver writers may like to use (__FreeBSD_version == 300003) to detect this change. The prototype FreeBSD/alpha machdep will follow in a couple of days time.
* Don't depend on "implicit int" or bloat the data section in thebde1998-02-251-3/+3
| | | | | | declaration of ptc_devsw_installed. Fixed a spelling error.
* Make all file-system (MFS, FFS, NFS, LFS, DEVFS) related option new-style.eivind1998-01-241-1/+2
| | | | | | | | This introduce an xxxFS_BOOT for each of the rootable filesystems. (Presently not required, but encouraged to allow a smooth move of option *FS to opt_dontuse.h later.) LFS is temporarily disabled, and will be re-enabled tomorrow.
* Make COMPAT_43 and COMPAT_SUNOS new-style options.eivind1997-12-161-1/+2
|
* Use ENOIOCTL instead of -1 (= ERESTART) for tty ioctls that arebde1997-12-061-3/+3
| | | | | not handled at a particular level. This fixes mainly restarting of interrupted TIOCDRAINs and TIOCSETA{W,F}s.
* Fixed gratuitous ANSIisms.bde1997-09-161-2/+4
|
* Extend to use poll backend. If memory serves correctly, most of this waspeter1997-09-141-46/+42
| | | | | | | adapted from NetBSD.. However, there are some differences in the tty system that are big enough to cause their code to not fit comfortably. Obtained from: NetBSD (I think)
* Removed unused #includes.bde1997-09-021-2/+1
|
* fix a few problems with pty. warn about how if you only have 1 ptyjmg1997-07-301-13/+16
| | | | | | | | | | | defined, your really getting 32. Also warn about how you can't have more than 256 pty's when your using DEVFS (non DEVFS can use more, just the makedev script doesn't know how to make >256). it also doesn't allocate more memory than needed in this case. Make sure that the signal passed in TIOCSIG isn't 0 as it might cause a panic. I personally haven't seen this happen, but after a similar bug in syscons crashed my machine, I'm acutely aware of this one. :)
* Don't include <sys/ioctl.h> in the kernel. Stage 5: includebde1997-03-241-2/+4
| | | | | | <sys/ioctl_compat.h> and sometimes <sys/filio.h> instead of <sys/ioctl.h> in tty-related files. <sys/ttycom.h> is still usually imported bogusly via <sys/termios.h>.
* Don't #include <sys/fcntl.h> in <sys/file.h> if KERNEL is defined.bde1997-03-231-2/+2
| | | | | Fixed everything that depended on getting fcntl.h stuff from the wrong place. Most things don't depend on file.h stuff at all.
* Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are notpeter1997-02-221-1/+1
| | | | ready for it yet.
* Make the long-awaited change from $Id$ to $FreeBSD$jkh1997-01-141-1/+1
| | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise.
* Clean up -Wunused warnings.gpalmer1996-06-121-9/+5
| | | | Reviewed by: bde
* Fixed the PF_REMOTE case of ptcwrite(). I broke it in rev.1.22. Outputbde1996-04-111-4/+15
| | | | | | was duplicated until the canq filled up, and write() normally returned 0. This case is apparently rare. It was reported for Jove's shell buffer in PR 1130.
* Merge in Lite2: buf fix with comparison of wrong field against EXTPROC.hsu1996-03-111-3/+3
| | | | | Did not accept change of second argument to ioctl from int to u_long. Reviewed by: davidg & bde
* Fix a bug I made in the devfs.phk1996-01-261-3/+3
|
* Avoid local sprintfs and other printf'isms.phk1996-01-251-8/+7
|
* Fixed pty names. The control and slave names were back to front.bde1995-12-221-5/+5
| | | | Fixed pty permissions.
* A Major staticize sweep. Generates a couple of warnings that I'll dealphk1995-12-141-12/+12
| | | | | | with later. A number of unused vars removed. A number of unused procs removed or #ifdefed.
* devsw tables are now arrays of POINTERS to struct [cb]devswjulian1995-12-131-2/+2
| | | | | | | | | seems to work hre just fine though I can't check every file that changed due to limmited h/w, however I've checked enught to be petty happy withe hte code.. WARNING... struct lkm[mumble] has changed so it might be an idea to recompile any lkm related programs
* Removed new alias d_size_t for d_psize_t.bde1995-12-101-2/+2
| | | | | | | | | | Removed old aliases d_rdwr_t and d_ttycv_t for d_read_t/d_write_t and d_devtotty_t. Sorted declarations of switch functions into switch order. Removed duplicated comments and declarations of nonexistent switch functions.
OpenPOWER on IntegriCloud