summaryrefslogtreecommitdiffstats
path: root/sys/kern/tty_pty.c
Commit message (Collapse)AuthorAgeFilesLines
* /* -> /*- for copyright notices, minor format tweaks as necessaryimp2005-01-061-1/+1
|
* Include uio.hphk2004-12-221-3/+3
| | | | | Check O_NONBLOCK instead if IO_NDELAY Don't include vnode.h
* Add new function ttyinitmode() which sets our systemwide defaultphk2004-10-181-6/+1
| | | | | | | | | | | | | | modes on a tty structure. Both the ".init" and the current settings are initialized allowing the function to be used both at attach and open time. The function takes an argument to decide if echoing should be enabled. Echoing should not be enabled for regular physical serial ports unless they are consoles, in which case they should be configured by ttyconsolemode() instead. Use the new function throughout.
* Make pty's always come up in echo mode.phk2004-10-151-1/+1
|
* Split the ioctl function in control and slave side, this eliminatedphk2004-09-231-68/+78
| | | | a troublesome devsw() call.
* Use the tty->t_sc field to find our softc.phk2004-09-161-3/+4
|
* Preparation commit for the tty cleanups that will follow in the nearphk2004-07-151-1/+1
| | | | | | | | | future: rename ttyopen() -> tty_open() and ttyclose() -> tty_close(). We need the ttyopen() and ttyclose() for the new generic cdevsw functions for tty devices in order to have consistent naming.
* Gah! commit from wrong tree.phk2004-06-251-6/+0
| | | | Remove now unused variables from last commit.
* Retire the TIOC_REMOTE ioctl.phk2004-06-251-95/+3
| | | | | It was added 22 years ago for emacs to use, but emacs gave up on it it 17 years ago.
* Put the pre FreeBSD-2.x tty compat code under BURN_BRIDGES.phk2004-06-211-2/+6
|
* Second half of the dev_t cleanup.phk2004-06-171-2/+2
| | | | | | | | | | | The big lines are: NODEV -> NULL NOUDEV -> NODEV udev_t -> dev_t udev2dev() -> findcdev() Various minor adjustments including handling of userland access to kernel space struct cdev etc.
* Do the dreaded s/dev_t/struct cdev */phk2004-06-161-16/+16
| | | | Bump __FreeBSD_version accordingly.
* Deorbit COMPAT_SUNOS.phk2004-06-111-2/+2
| | | | | We inherited this from the sparc32 port of BSD4.4-Lite1. We have neither a sparc32 port nor a SunOS4.x compatibility desire these days.
* Rename struct pt_ioctl to "ptsc" and pointers to it from "pti" to "pt"phk2004-06-091-65/+65
|
* Ditch K&R function stylephk2004-06-091-63/+15
|
* Move PTY private defines into PTY private files.phk2004-06-091-0/+4
|
* Machine generated patch which changes linedisc calls from accessingphk2004-06-041-8/+8
| | | | | | linesw[] directly to using the ttyld...() functions The ttyld...() functions ar inline so there is no performance hit.
* Use ttymalloc() instead of ttyregister(). Use ttyioctl() instead ofphk2004-06-041-8/+6
| | | | direct calls to the linedisc.
* There is no need to explicitly call the stop function. In all likelyhoodphk2004-06-011-1/+0
| | | | ->l_close() did it and ttyclose certainly will.
* Remove advertising clause from University of California Regent's license,imp2004-04-051-4/+0
| | | | | | per letter dated July 22, 1999. Approved by: core
* Device megapatch 4/6:phk2004-02-211-2/+4
| | | | | | | | Introduce d_version field in struct cdevsw, this must always be initialized to D_VERSION. Flip sense of D_NOGIANT flag to D_NEEDGIANT, this involves removing four D_NOGIANT flags and adding 145 D_NEEDGIANT flags.
* Device megapatch 3/6:phk2004-02-211-3/+0
| | | | | | | | | | | | Add missing D_TTY flags to various drivers. Complete asserts that dev_t's passed to ttyread(), ttywrite(), ttypoll() and ttykqwrite() have (d_flags & D_TTY) and a struct tty pointer. Make ttyread(), ttywrite(), ttypoll() and ttykqwrite() the default cdevsw methods for D_TTY drivers and remove the explicit initializations in various drivers cdevsw structures.
* Remove excess brackets.rwatson2004-02-151-3/+2
|
* - Implement selwakeuppri() which allows raising the priority of atanimura2003-11-091-2/+2
| | | | | | | | | | | | | thread being waken up. The thread waken up can run at a priority as high as after tsleep(). - Replace selwakeup()s with selwakeuppri()s and pass appropriate priorities. - Add cv_broadcastpri() which raises the priority of the broadcast threads. Used by selwakeuppri() if collision occurs. Not objected in: -arch, -current
* Don't use seltrue when that is not really what we mean.phk2003-09-271-1/+2
|
* Use __FBSDID().obrien2003-06-111-1/+3
|
* "break" rather than fall through to a break in the default clause.phk2003-05-311-0/+1
| | | | Found by: FlexeLint
* - Merge struct procsig with struct sigacts.jhb2003-05-131-1/+1
| | | | | | | | | | | | | | | | | - Move struct sigacts out of the u-area and malloc() it using the M_SUBPROC malloc bucket. - Add a small sigacts_*() API for managing sigacts structures: sigacts_alloc(), sigacts_free(), sigacts_copy(), sigacts_share(), and sigacts_shared(). - Remove the p_sigignore, p_sigacts, and p_sigcatch macros. - Add a mutex to struct sigacts that protects all the members of the struct. - Add sigacts locking. - Remove Giant from nosys(), kill(), killpg(), and kern_sigaction() now that sigacts is locked. - Several in-kernel functions such as psignal(), tdsignal(), trapsignal(), and thread_stopped() are now MP safe. Reviewed by: arch@ Approved by: re (rwatson)
* - Move p->p_sigmask to td->td_sigmask. Signal masks will be per thread withjeff2003-03-311-1/+1
| | | | | | | a follow on commit to kern_sig.c - signotify() now operates on a thread since unmasked pending signals are stored in the thread. - PS_NEEDSIGCHK moves to TDF_NEEDSIGCHK.
* Make TTYHOG tunable.das2003-03-051-0/+1
| | | | Reviewed by: mike (mentor)
* Make nokqfilter() return the correct return value.phk2003-03-031-2/+2
| | | | Ditch the D_KQFILTER flag which was used to prevent calling NULL pointers.
* Gigacommit to improve device-driver source compatibility betweenphk2003-03-031-28/+20
| | | | | | | | | | | | | branches: Initialize struct cdevsw using C99 sparse initializtion and remove all initializations to default values. This patch is automatically generated and has been tested by compiling LINT with all the fields in struct cdevsw in reverse order on alpha, sparc64 and i386. Approved by: re(scottl)
* Clean up whitespace, s/register //, refrain from strong urge to ANSIfy.des2003-03-021-24/+24
|
* uiomove-related caddr_t -> void * (just the low-hanging fruit)des2003-03-021-4/+3
|
* Back out M_* changes, per decision of the TRB.imp2003-02-191-1/+1
| | | | Approved by: trb
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.alfred2003-01-211-1/+1
| | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
* Remove cdevsw_add calls, they are deprecated.phk2002-12-281-2/+1
|
* - Lock proctree_lock instead of pgrpsess_lock.jhb2002-04-161-6/+8
| | | | | | - Use temporary variables to hold a pointer to a pgrp while we dink with it while not holding either the associated proc lock or proctree_lock. It is in theory possible that p->p_pgrp could change out from under us.
* Change the suser() API to take advantage of td_ucred as well as do ajhb2002-04-011-1/+1
| | | | | | | | | | | | general cleanup of the API. The entire API now consists of two functions similar to the pre-KSE API. The suser() function takes a thread pointer as its only argument. The td_ucred member of this thread must be valid so the only valid thread pointers are curthread and a few kernel threads such as thread0. The suser_cred() function takes a pointer to a struct ucred as its first argument and an integer flag as its second argument. The flag is currently only used for the PRISON_ROOT flag. Discussed on: smp@
* Remove __P.alfred2002-03-191-6/+6
|
* Fix lock leakage and late unlock.tanimura2002-03-021-0/+1
| | | | Submitted by: bde
* Simple p_ucred -> td_ucred changes to start using the per-thread ucredjhb2002-02-271-5/+3
| | | | reference.
* Lock struct pgrp, session and sigio.tanimura2002-02-231-2/+17
| | | | | | | | | | | | | | | | | | | | | | | | | New locks are: - pgrpsess_lock which locks the whole pgrps and sessions, - pg_mtx which protects the pgrp members, and - s_mtx which protects the session members. Please refer to sys/proc.h for the coverage of these locks. Changes on the pgrp/session interface: - pgfind() needs the pgrpsess_lock held. - The caller of enterpgrp() is responsible to allocate a new pgrp and session. - Call enterthispgrp() in order to enter an existing pgrp. - pgsignal() requires a pgrp lock held. Reviewed by: jhb, alfred Tested on: cvsup.jp.FreeBSD.org (which is a quad-CPU machine running -current)
* The ICANON flag is an lflag, not an iflag.dillon2002-02-181-2/+2
| | | | | Submitted by: Neelkanth Natu <neelnatu@yahoo.com> MFC after: 3 days
* o Move suser() calls in kern/ to using suser_xxx() with an explicitrwatson2001-11-011-1/+1
| | | | | | | | | credential selection, rather than reference via a thread or process pointer. This is part of a gradual migration to suser() accepting a struct ucred instead of a struct proc, simplifying the reference and locking semantics of suser(). Obtained from: TrustedBSD Project
* Use the passed in thread pointer instead of curthread in calls tojhb2001-09-211-2/+2
| | | | | | selrecord() in ptcpoll(). The pre-KSE code used the passed in proc pointer rather than curproc, and an earlier seltrue() call uses the passed in thread and not curthread.
* KSE Milestone 2julian2001-09-121-17/+20
| | | | | | | | | | | | | | Note ALL MODULES MUST BE RECOMPILED make the kernel aware that there are smaller units of scheduling than the process. (but only allow one thread per process at this time). This is functionally equivalent to teh previousl -current except that there is a thread associated with each process. Sorry john! (your next MFC will be a doosie!) Reviewed by: peter@freebsd.org, dillon@freebsd.org X-MFC after: ha ha ha ha
* Don't remove the SI_CHEAPCLONE for unsupported minorsbrian2001-06-181-1/+2
|
* With the new kernel dev_t conversions done at release 4.X,phk2001-05-281-0/+1
| | | | | | | | | | | | | | | | | | | | | | it becomes possible to trap in ptsstop() in kern/tty_pty.c if the slave side has never been opened during the life of a kernel. What happens is that calls to ttyflush() done from ptyioctl() for the controlling side end up calling ptsstop() [via (*tp->t_stop)(tp, <X>)] which evaluates the following: struct pt_ioctl *pti = tp->t_dev->si_drv1; In order for tp->t_dev to be set, the slave device must first be opened in ttyopen() [kern/tty.c]. It appears that the only problem is calls to (*tp->t_stop)(tp, <n>), so this could also happen with other ioctls initiated by the controlling side before the slave has been opened. PR: 27698 Submitted by: David Bein bein@netapp.com MFC after: 6 days
* Make the PTY drivers cloning algorithm create "CHEAPCLONE" dev_t,phk2001-05-251-11/+12
| | | | so that some twit cannot allocate all 256 PTY's with "ls -l".
OpenPOWER on IntegriCloud