summaryrefslogtreecommitdiff
path: root/sys/kern/tty.c
AgeCommit message (Collapse)Author
2009-11-09Every selwakeup() should have a matching KNOTE() (even if kqueue isn'tNicholas Marriott
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
2009-10-30Add missing KNOTE() calls after selwakeup() in ptcread() (to wake up writersNicholas Marriott
after the master side of the pty has finished reading) and in ttyflush(). ok tedu millert
2009-10-28For the TIOCSET* ioctls, validate that the tty speeds are positive (sinceTheo de Raadt
they are signed int) ok miod guenther
2009-07-19clalloc() can't fail, so there's no need to handle failure cases.Bret Lambert
Change to void function. Also, no need to have global tty stats pointer, so just return it from clalloc, as the caller frees it immediately anyway. ok miod@
2008-12-24EVFILT_WRITE filters should return the amount of space remaining in theMark Kettenis
write buffer, not the amount of space used. It is debatable wether the size of the write buffer is set by the size of the buffer or the high water mark. For now, go with the former since that seems to be more consistent with what the pipe and socet code does. It is also what NetBSD does. ok deraadt@
2008-11-11for ^T support, grab all the information from the process before goingTheo de Raadt
into a potentially sleeping function... ok tedu.
2008-07-28Fix integer truncation in ttwrite(). ok deraadt, miod.Stefan Kempf
2008-05-23tputchar() can put characters on the tty output queue if clocal is set,Theo de Raadt
fixing (status) ^T support on some ttys without carrier ok pyr
2008-04-10scrub local stack-based buffers in the tty subsystem. tested by a lot ofTheo de Raadt
developers. if you notice tty weirdnesses in the next few months, talk to me
2007-10-29MALLOC/FREE -> malloc/freeCharles Longeau
replace an hard coded value with M_WAITOK ok krw@
2007-09-07Use M_ZERO in a few more places to shave bytes from the kernel.Artur Grabowski
eyeballed and ok dlg@
2007-03-15Since p_flag is often manipulated in interrupts and without biglockArtur Grabowski
it's a good idea to use atomic.h operations on it. This mechanic change updates all bit operations on p_flag to atomic_{set,clear}bits_int. Only exception is that P_OWEUPC is set by MI code before calling need_proftick and it's automatically cleared by ADDUPC. There's no reason for MD handling of that flag since everyone handles it the same way. kettenis@ ok
2006-06-17avoid missing events for timestamping (dcd change at same time as cts);Theo de Raadt
mrd@alkemio.org
2006-04-27create a (very simple) method for timestamping CTS & DCD events on ttys,Theo de Raadt
using ioctl TIOCSTSTAMP & TIOCGTSTAMP. to be used later for gps monitoring type things; ok kettenis miod
2005-12-21ansi/deregister. No binary change.Jonathan Gray
2004-12-26Use list and queue macros where applicable to make the code easier to read;Miod Vallat
no change in compiler assembly output.
2004-11-18handle SONPROC; ok aaron, deraadt, krwMarkus Friedl
2004-09-19constify speedtabs and make ttspeedtab() take a const struct speedtab *Michael Shalayeff
2004-06-13debranch SMP, have funNiklas Hallqvist
2004-03-19check for CLOCAL flag in right variable; from sq@oganer.netTheo de Raadt
2004-02-10Dynamically allocate space for ptys; adapted from NetBSD by beck@Todd C. Miller
2003-10-03Merge tty_attach() in ttymalloc() and tty_detach() in ttyfree(). The need forMiod Vallat
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...
2003-09-23Replace select backends with poll backends. selscan() and pollscan()Todd C. Miller
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
2003-08-23knfTheo de Raadt
2003-08-15change arguments to suser. suser now takes the process, and a flagsTed Unangst
argument. old cred only calls user suser_ucred. this will allow future work to more flexibly implement the idea of a root process. looks like something i saw in freebsd, but a little different. use of suser_ucred vs suser in file system code should be looked at again, for the moment semantics remain unchanged. review and input from art@ testing and further review miod@
2003-06-02Remove the advertising clause in the UCB license which BerkeleyTodd C. Miller
rescinded 22 July 1999. Proofed by myself and Theo.
2002-12-20Clear error before jumping back to the input loop. If error was setTodd C. Miller
to EWOULDBLOCK it would otherwise not get cleared; Jim Geovedi
2002-12-12can now get _ttylist via sysctl; millert okTheo de Raadt
2002-07-30Release sessions to avoid memory leak. From NetBSD. ok deraadt@Thomas Nordin
2002-07-11Make sure to protect ttypend with spltty all the time.Artur Grabowski
Implemented with paranoia.
2002-07-03Change all variables definitions (int foo) in sys/sys/*.h to variableMiod Vallat
declarations (extern int foo), and compensate in the appropriate locations.
2002-06-11splassert(IPL_TTY) where comments tell us we shouldArtur Grabowski
2002-03-14First round of __P removal in sysTodd C. Miller
2002-01-30Move SET/CLR/ISSET macros to param.h. fgsch@ and millert@ okThomas Nordin
2001-12-27Increment reference count when copying session pointer pr#2112. ok deraadt@Thomas Nordin
2001-11-06Replace inclusion of <vm/foo.h> with the correct <uvm/bar.h> when necessary.Miod Vallat
(Look ma, I might have broken the tree)
2001-10-07Setting the VTIME to a value larger than 214 lead to an integer overflowArtur Grabowski
in the calculation of the sleep timeout which could lead to a panic. Instead of doing the very error-prone, and in more than one way incorrect, sleep time calculation, allocate an external timeout and let it wake us. Reported by: Raan Young <raan@graand-visions.com>
2001-09-28Random cleanup (I don't like Ms in my tree).Artur Grabowski
2001-07-05Get rid of REAL_CLISTS. It was never implemented and the tentacles areArtur Grabowski
everywhhere.
2001-05-14tty stats sysctl, deraadt@okAngelos D. Keromytis
2001-03-02Casting magic to avoid warnings on alpha.Artur Grabowski
2001-03-01port kqueue changes from freebsd, plus all required openbsd glue.Niels Provos
okay deraadt@, millert@ from jlemon@freebsd.org: extend kqueue down to the device layer, backwards compatible approach suggested by peter@freebsd.org
2000-07-19Many drivers use a timeout on ttrstrt, make this a generic interface.Artur Grabowski
2000-06-05Changes to exit handling.Artur Grabowski
cpu_exit no longer frees the vmspace and u-area. This is now handled by a separate kernel thread "reaper". This is to avoid sleeping locks in the critical path of cpu_exit where we're not allowed to sleep. From NetBSD
2000-03-23Iiieeek! This kludge was almost funny.Artur Grabowski
Probably something from the stone age. Kill it.
1999-11-25Use PAGE_SIZE instead of NBPG.Artur Grabowski
1999-06-01remove the "ifdef pmap_resident_count" hack and replace it with a macro.Artur Grabowski
change some &vm->vm_pmap to vm->vm_map.pmap
1998-03-28nasty indentTheo de Raadt
1998-02-20Please GCC 2.8's harsher view of good styleNiklas Hallqvist
1998-02-03bad types; wileyc@sekiya.twics.co.jpTheo de Raadt