summaryrefslogtreecommitdiffstats
path: root/sys/kern/tty_pty.c
Commit message (Collapse)AuthorAgeFilesLines
...
* 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.
* Julian forgot to make the *devsw structures static.phk1995-12-081-3/+3
|
* Pass 3 of the great devsw changesjulian1995-12-081-42/+63
| | | | | | | | | | | | | | | | | | | | | | | most devsw referenced functions are now static, as they are in the same file as their devsw structure. I've also added DEVFS support for nearly every device in the system, however many of the devices have 'incorrect' names under DEVFS because I couldn't quickly work out the correct naming conventions. (but devfs won't be coming on line for a month or so anyhow so that doesn't matter) If you "OWN" a device which would normally have an entry in /dev then search for the devfs_add_devsw() entries and munge to make them right.. check out similar devices to see what I might have done in them in you can't see what's going on.. for a laugh compare conf.c conf.h defore and after... :) I have not doen DEVFS entries for any DISKSLICE devices yet as that will be a much more complicated job.. (pass 5 :) pass 4 will be to make the devsw tables of type (cdevsw * ) rather than (cdevsw) seems to work here.. complaints to the usual places.. :)
* I fixed this before than committed it on my machine and not on freefall.julian1995-12-021-5/+5
| | | | (window confusion)
* Submitted by: Heikki Suonsivujulian1995-12-021-8/+8
| | | | Made the pty devices creates in devfs match the present MAKEDEV naming
* If you're going to mechanically replicate something in 50 filesjulian1995-11-291-12/+12
| | | | it's best to not have a (compiles cleanly) typo in it! (sigh)
* OK, that's it..julian1995-11-291-1/+63
| | | | | | | | | | | | | | | | | | | | | | | | That's EVERY SINGLE driver that has an entry in conf.c.. my next trick will be to define cdevsw[] and bdevsw[] as empty arrays and remove all those DAMNED defines as well.. Each of these drivers has a SYSINIT linker set entry that comes in very early.. and asks teh driver to add it's own entry to the two devsw[] tables. some slight reworking of the commits from yesterday (added the SYSINIT stuff and some usually wrong but token DEVFS entries to all these devices. BTW does anyone know where the 'ata' entries in conf.c actually reside? seems we don't actually have a 'ataopen() etc... If you want to add a new device in conf.c please make sure I know so I can keep it up to date too.. as before, this is all dependent on #if defined(JREMOD) (and #ifdef DEVFS in parts)
* Moved prototypes for devswitch functions from conf.c and driver sourcesbde1995-11-041-3/+1
| | | | | | | to <machine/conf.h>. conf.h was mechanically generated by `grep ^d_ conf.c >conf.h'. This accounts for part of its ugliness. The prototypes should be moved back to the driver sources when the functions are staticalized.
* Removed an annoying redundant declaration that I added in the previousbde1995-10-301-2/+1
| | | | revision.
* Fixed data loss in writes to pty masters. Data was almost always lostbde1995-10-251-8/+23
| | | | | | | | | at the end of each write for writes of more than 1K. Fixed handling of residual count for early returns in writes to pty masters. It was only adjusted in 2 out of 6 cases. Added prototypes.
* Don't clear the session pointer in ptcclose(). It must be left alonebde1995-09-191-2/+1
| | | | | until the session leader exits so that a SIGHUP gets sent to the process group and the pty slave gets revoked.
* Fix benign type mismatches in devsw functions. 82 out of 299 devswbde1995-09-081-2/+5
| | | | functions were wrong.
* Back out predefined termios speeds check, it can cause troublesache1995-08-021-28/+1
| | | | | | with interaction pty <-> serial driver with non-standard speed. So, nothing protect us from garbadge in speed field, expect checking for < 0 left in tty.c :-(
* Check for valid speed values in pty driveache1995-08-021-2/+29
| | | | | | Check for negative speed values in tty drive Back out valid speed values checking from tty drive Suggested by: bde
* Don't set TS_ZOMBIE flag for non-open ptys. ptcclose() has always donebde1995-08-021-4/+6
| | | | | | too much for non-open ptys, but there is normally no problem because the l_modem(, 0) is a no-op for closed ptys provided the line discipline is standard and MDMBUF isn't set.
* Obtained from: partly from ancient patches of mine via 1.1.5bde1995-07-311-13/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce TS_CONNECTED and TS_ZOMBIE states. TS_CONNECTED is set while a connection is established. It is set while (TS_CARR_ON or CLOCAL is set) and TS_ZOMBIE is clear. TS_ZOMBIE is set for on to off transitions of TS_CARR_ON that occur when CLOCAL is clear and is cleared for off to on transitions of CLOCAL. I/o can only occur while TS_CONNECTED is set. TS_ZOMBIE prevents further i/o. Split the input-event sleep address TSA_CARR_ON(tp) into TSA_CARR_ON(tp) and TSA_HUP_OR_INPUT(tp). The former address is now used only for off to on carrier transitions and equivalent CLOCAL transitions. The latter is used for all input events, all carrier transitions and certain CLOCAL transitions. There are some harmless extra wakeups for rare connection- related events. Previously there were too many extra wakeups for non-rare input events. Drivers now call l_modem() instead of setting TS_CARR_ON directly to handle even the initial off to on transition of carrier. They should always have done this. l_modem() now handles TS_CONNECTED and TS_ZOMBIE as well as TS_CARR_ON. gnu/isdn/iitty.c: Set TS_CONNECTED for first open ourself to go with bogusly setting CLOCAL. i386/isa/syscons.c, i386/isa/pcvt/pcvt_drv.c: We fake carrier, so don't also fake CLOCAL. kern/tty.c: Testing TS_CONNECTED instead of TS_CARR_ON fixes TIOCCONS forgetting to test CLOCAL. TS_ISOPEN was tested instead, but that broke when we disabled the clearing of TS_ISOPEN for certain transitions of CLOCAL. Testing TS_CONNECTED fixes ttyselect() returning false success for output to devices in state !TS_CARR_ON && !CLOCAL. Optimize the other selwakeup() call (this is not related to the other changes). kern/tty_pty.c: ptcopen() can be declared in traditional C now that dev_t isn't short.
OpenPOWER on IntegriCloud