summaryrefslogtreecommitdiffstats
path: root/sys/kern/tty_pty.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* Add struct proc * argument to FRELE() and FILE_SET_MATURE() inguenther2012-04-221-3/+3
| | | | | | anticipation of further changes to closef(). No binary change. ok krw@ miod@ deraadt@
* Recommit the reverted sigacts change now that the NFS use-after-freeguenther2011-07-051-2/+2
| | | | | | | | problem has been tracked down. This fixes the sharing of the signal handling state: shared bits go in sigacts, per-rthread bits goes in struct proc. ok deraadt@
* kqueue attach functions should return an errno or 0, not a plain 1. Fixnicm2011-07-021-2/+2
| | | | | | the obvious cases to return EINVAL and ENXIO. ok tedu deraadt
* Revert the sigacts diff: NFS can apparently retain pointers to processesguenther2011-04-181-2/+2
| | | | | | until they're zombies and then send them signals (for intr mounts). Until that is untangled, the sigacts change is unsafe. sthen@ was the victim for this one
* Correct the sharing of the signal handling state: stuff that shouldguenther2011-04-151-2/+2
| | | | | | | | | | | | be shared (p_sigignore, p_sigcatch, P_NOCLDSTOP, P_NOCLDWAIT) moves to struct sigacts, wihle stuff that should be per rthread (ps_oldmask, SAS_OLDMASK, ps_sigstk) moves to struct proc. Treat the coredumping state bits (ps_sig, ps_code, ps_type, ps_sigval) as per-rthread until our locking around coredumping is better. Oh, and remove the old SunOS-compat ps_usertramp member. "I like the sound of this" tedu@
* Move PPWAIT flag from struct proc to process, so that rthreads inguenther2011-04-031-2/+2
| | | | | | | | | a vforked child behave correctly. Have the parent in a vfork() wait on a (different) flag in *its* process instead of the child to prevent a possible use-after-free. When ktracing the child return from a fork, call it rfork if an rthread was created. ok blambert@
* dead store; found by clangderaadt2010-09-241-2/+1
|
* Every time you ignore uiomove() return value, $DEITY kills a littlemiod2010-08-061-2/+4
| | | | | | $ADORABLE_FELINE. ok deraadt@ matthew@
* Correct the links between threads, processes, pgrps, and sessions,guenther2010-07-261-4/+5
| | | | | | | | | so that the process-level stuff is to/from struct process and not struct proc. This fixes a bunch of problem cases in rthreads. Based on earlier work by blambert and myself, but mostly written at c2k10. Tested by many: deraadt, sthen, krw, ray, and in snapshots
* ptm needs no read/write, just use enodev.nicm2010-07-211-23/+1
| | | | ok deraadt
* remove support for compat_sunos (and m68k4k). ok deraadt guenthertedu2010-07-021-16/+1
|
* Move common code for waking up writers on a tty into a function.nicm2010-07-021-8/+2
| | | | ok deraadt matthew millert
* Allow tty drivers to request larger buffers at attach time using aderaadt2010-06-281-9/+9
| | | | | | | | max-baud-rate hint. Adjust TTYHOG (the nearly full logic) to this new situation. The larger buffers are required by the very high speed KDDI devices in Japan (CF com, or USB ucom) so those are the only two drivers which currently ask for a larger buffer size. ok yasuoka miod
* Some of the line disciplines want to check for suser. Better to pass themtedu2010-04-121-3/+3
| | | | a process instead of using curproc. ok deraadt
* Add a case so that FIONREAD on the master side of a pty returns the sizenicm2010-04-021-2/+10
| | | | | | | | of the output queue (that is, the data coming from the program on the slave side) rather than falling through to ttioctl which returns the size of the input queue (the amount written to the master). ok deraadt
* Every selwakeup() should have a matching KNOTE() (even if kqueue isn'tnicm2009-11-091-4/+1
| | | | | | | | | | supported it doesn't do any harm), so put the KNOTE() in selwakeup() itself and remove it from any occurences where both are used, except one for kqueue itself and one in sys_pipe.c (where the selwakeup is under a PIPE_SEL flag). Based on a diff from tedu. ok deraadt
* Use suser when possible. Suggested by miod@.fgsch2009-10-311-2/+2
| | | | miod@ deraadt@ ok.
* Add missing KNOTE() calls after selwakeup() in ptcread() (to wake up writersnicm2009-10-301-1/+2
| | | | | | after the master side of the pty has finished reading) and in ttyflush(). ok tedu millert
* Remove a redundant if (maxpty == npty) in check_pty - this is also tested bynicm2009-10-141-5/+1
| | | | | | | the two ifs at the start of the function and both variables are only altered under pt_softc_lock so cannot change between the checks. ok guenther@
* Having pty_isfree_locked() be inlined may make pty allocation a tinyderaadt2009-09-291-2/+3
| | | | | | bit faster, but come on, inlining is supposed to be reserved only for things which *critically* need it. ok millert
* Fix integer truncation in pcread() and ptcwrite(). ok miod, otto, deraadt.stefan2008-08-021-6/+6
|
* check TIOCSIG for 0 and do not send that to psignal() and pgsignal()deraadt2008-05-071-4/+4
| | | | ok fgsch
* scrub local stack-based buffers in the tty subsystem. tested by a lot ofderaadt2008-04-101-25/+44
| | | | | developers. if you notice tty weirdnesses in the next few months, talk to me
* Use M_ZERO in a few more places to shave bytes from the kernel.art2007-09-071-6/+5
| | | | eyeballed and ok dlg@
* Add a name argument to the RWLOCK_INITIALIZER macro.thib2007-05-291-2/+3
| | | | | | Pick reasonble names for the locks involved.. ok tedu@, art@
* Typos grab bag of the month, eyeballed by jmc@miod2006-03-041-2/+2
|
* Fix logic botch when checking for COMPAT_SUNOS binary specifics; repairsmiod2006-01-181-6/+8
| | | | | some TIOCGPGRP result fallout. ok deraadt@
* ansi/deregister. No binary change.jsg2005-12-211-71/+36
|
* Fix a crash in ptmioctl() in the error path when the master hasmillert2005-11-211-3/+5
| | | | | | | been opened but the slave cannot be. We can't do the FILE_SET_MATURE until we are past all possible error paths since it calls FRELE(), resulting in a reference count of 0, which closef() panics on #ifdef DIAGNOSTIC. OK deraadt@
* RIP stackable filesystems, ok marius@ tedu@, discussed with deraadt@pedro2005-05-261-2/+2
|
* When setting kern.tty.maxptys, store the old value in oldp, notmillert2005-01-281-17/+15
| | | | | | random stack garbage. Rename DEFAULT_NPTYS and DEFAULT_MAXPTYS to NPTY_MIN and NPTY_MAX to better match their function and don't allow setting kern.tty.maxptys > NPTY_MAX.
* Set atime and mtime when giving out a new pty. With help from tholo@millert2004-12-191-2/+11
| | | | and OK tedu@
* * add a missing vput() if VOP_SETATTR() fails.pat2004-12-071-2/+4
| | | | ok tedu pedro millert
* remove p arg from fdplocktedu2004-07-221-2/+2
|
* I was wrong. The assymetry created by the proc argument to rw_enter_writeart2004-07-211-3/+3
| | | | | | | | | is horrible and doesn't add anything. Remove it. XXX - the fdplock macro will need a separate cleanup. niklas@ markus@ ok
* go away staticsniklas2004-07-091-3/+3
|
* Crank max ptys to 992. We now have 62 pty/tty pairs for each lettermillert2004-04-111-5/+5
| | | | | | instead of 16. E.g. it is now /dev/{p,t}typ[0-9a-zA-z] instead of just /dev/{p,t}typ[0-9a-f]. This requires that you update MAKEDEV and run: # cd /dev && ./MAKEDEV pty0 && rm -f [pt]ty[rq]*
* Fix calculation of the index into TTY_LETTERS. This only workedmillert2004-04-111-2/+2
| | | | because sizeof(TTY_LETTERS) == sizeof(TTY_SUFFIX).
* Make sure we allow for the time when check_pty has not yet been calledbeck2004-02-231-2/+3
| | | | | | before we get invoked, by making sure getfree thinks an unused and unallocated pt_softc entry is actually free rather than following NULL. ok cedric@
* Fix off-by-one wrt TTY_LETTERS and minor being out of bounds. Missedmillert2004-02-101-2/+2
| | | | when I fixed the other TTY_LETTERS/TTY_SUFFIX off-by-ones.
* Add the ptm device to pty(4). By opening /dev/ptm and using the PTMGETmillert2004-02-101-19/+329
| | | | | | | | | | | ioctl(2), an unprivileged process may allocate a pty and have its owner and mode set appropriately. This means that programs such as xterm and screen no longer need to be setuid. Programs using the openpty() function require zero changes and will "just work". Designed by beck@ and deraadt@; changes by beck@ with cleanup (and a rewrite of the vnode bits) by art@ and tweaks/bugfixes by me. Tested by many.
* Dynamically allocate space for ptys; adapted from NetBSD by beck@millert2004-02-101-29/+147
|
* Merge tty_attach() in ttymalloc() and tty_detach() in ttyfree(). The need formiod2003-10-031-7/+3
| | | | | | | | | separate tty registering is gone now that sparc has switched to wscons, and this makes the code less error-prone. Also, remove tests for ttymalloc() failure, since it uses M_WAITOK. ok millert@ deraadt@, tested by various people as well besides me...
* Replace select backends with poll backends. selscan() and pollscan()millert2003-09-231-45/+40
| | | | | | | now call the poll backend. With this change we implement greater poll(2) functionality instead of emulating it via the select backend. Adapted from NetBSD and including some changes from FreeBSD. Tested by many, deraadt@ OK
* make it compile again damnit; from slash@peereboom.usmickey2003-07-221-2/+2
|
* remove caddr_t casts. it's just silly to cast something when the functiontedu2003-07-211-16/+15
| | | | takes a void *. convert uiomove to take a void * as well. ok deraadt@
* doing kqueue on the master side of the pty returns eventsmickey2003-06-141-1/+103
| | | | | | for the slave size as described in the pr3209. the regress has been created to verify for the conditions. from wayne@epipe.com.au
* Remove the advertising clause in the UCB license which Berkeleymillert2003-06-021-6/+2
| | | | rescinded 22 July 1999. Proofed by myself and Theo.
* First round of __P removal in sysmillert2002-03-141-6/+6
|
* ICANON is a t_lflag, not t_iflag; neelnatu@yahoo.comderaadt2002-02-171-3/+3
|