Commit Graph

128 Commits

Author SHA1 Message Date
scw 2963ff5c58 Add `l_poll' to `struct linesw' and provide an xxxpoll() entry point
in each tty driver to indirect through it.

This allows tty line-disciplines to handle poll(2) system calls.
2001-05-02 10:32:08 +00:00
enami 2ceebb6c0e Remove unnecessary test of tp->t_linesw against NULL; they are results
of confusion while correcting compilation error after t_line is
replaced with t_linesw.
2001-03-31 00:35:21 +00:00
lukem b4e2b14fe6 convert to ANSI KNF 2001-03-22 04:52:25 +00:00
jdolecek e9e91a0fb5 split off thread specific stuff from struct sigacts to struct sigctx, leaving
only signal handler array sharable between threads
move other random signal stuff from struct proc to struct sigctx

This addresses kern/10981 by Matthew Orgass.
2000-12-22 22:58:52 +00:00
enami c4c6285008 Don't allow t_linesw to be NULL. 2000-11-15 01:47:14 +00:00
thorpej e39f7bbe1c NBPG -> PAGE_SIZE 2000-11-14 22:16:38 +00:00
jdolecek e8e4da6b87 add new function sigismasked(), which checks whether passed signal
is ignored or masked by the process, and use it appropriately
instead of directly checking p->p_sigmask and p->p_sigignore
2000-11-05 15:37:09 +00:00
eeh d85adca51f Make line disciplines modular so they can be added or removed dynamically. 2000-11-01 23:51:38 +00:00
mrg 32aa199ccf remove include of <vm/vm.h> 2000-06-27 17:41:07 +00:00
thorpej 8964c35eca Introduce a new process state distinct from SRUN called SONPROC
which indicates that the process is actually running on a
processor.  Test against SONPROC as appropriate rather than
combinations of SRUN and curproc.  Update all context switch code
to properly set SONPROC when the process becomes the current
process on the CPU.
2000-05-26 00:36:42 +00:00
augustss 264f1d27c6 Get rid of register declarations. 2000-03-30 09:27:11 +00:00
kleink 2e68f6172e Cast timeval members to types we know the printf conversions of. 2000-03-28 18:39:03 +00:00
thorpej b667a5a357 New callout mechanism with two major improvements over the old
timeout()/untimeout() API:
- Clients supply callout handle storage, thus eliminating problems of
  resource allocation.
- Insertion and removal of callouts is constant time, important as
  this facility is used quite a lot in the kernel.

The old timeout()/untimeout() API has been removed from the kernel.
2000-03-23 06:30:07 +00:00
tron d5442d74c5 Fix NULL pointer access. Patch supplied by Dave Huang in PR kern/8055. 1999-07-24 15:10:02 +00:00
thorpej 2715b812d1 Rework the process exit path, in preparation for making process exit
and PID allocation MP-safe.  A new process state is added: SDEAD.  This
state indicates that a process is dead, but not yet a zombie (has not
yet been processed by the process reaper).

SDEAD processes exist on both the zombproc list (via p_list) and deadproc
(via p_hash; the proc has been removed from the pidhash earlier in the exit
path).  When the reaper deals with a process, it changes the state to
SZOMB, so that wait4 can process it.

Add a P_ZOMBIE() macro, which treats a proc in SZOMB or SDEAD as a zombie,
and update various parts of the kernel to reflect the new state.
1999-07-22 18:13:36 +00:00
simonb 5d8b1ef3e4 g/c REAL_CLISTS. 1999-04-25 02:56:26 +00:00
mycroft fb526e055c Substantial signal handling changes:
* Increase the size of sigset_t to accomodate 128 signals -- adding new
  versions of sys_setprocmask(), sys_sigaction(), sys_sigpending() and
  sys_sigsuspend() to handle the changed arguments.
* Abstract the guts of sys_sigaltstack(), sys_setprocmask(), sys_sigaction(),
  sys_sigpending() and sys_sigsuspend() into separate functions, and call them
  from all the emulations rather than hard-coding everything.  (Avoids uses
  the stackgap crap for these system calls.)
* Add a new flag (p_checksig) to indicate that a process may have signals
  pending and userret() needs to do the full (slow) check.
* Eliminate SAS_ALTSTACK; it's exactly the inverse of SS_DISABLE.
* Correct emulation bugs with restoring SS_ONSTACK.
* Make the signal mask in the sigcontext always use the emulated mask format.
* Store signals internally in sigaction structures, rather than maintaining a
  bunch of little sigsets for each SA_* bit.
* Keep track of where we put the signal trampoline, rather than figuring it out
  in *_sendsig().
* Issue a warning when a non-emulated sigaction bit is observed.
* Add missing emulated signals, and a native SIGPWR (currently not used).
* Implement the `not reset when caught' semantics for relevant signals.

Note: Only code touched by the i386 port has been modified.  Other ports and
emulations need to be updated.
1998-09-11 12:50:05 +00:00
thorpej ad5e377513 Use the pool allocator and the "nointr" pool page allocator for tty
structures.
1998-09-01 00:23:28 +00:00
thorpej 7cc905f5c8 Add some braces to make egcs happy (ambiguous else warning). 1998-08-18 06:27:01 +00:00
perry 275d1554aa Abolition of bcopy, ovbcopy, bcmp, and bzero, phase one.
bcopy(x, y, z) ->  memcpy(y, x, z)
ovbcopy(x, y, z) -> memmove(y, x, z)
   bcmp(x, y, z) ->  memcmp(x, y, z)
  bzero(x, y)    ->  memset(x, 0, y)
1998-08-04 04:03:10 +00:00
perry 730baa7431 fix sizeofs so they comply with the KNF style guide. yes, it is pedantic. 1998-07-31 22:50:48 +00:00
mycroft 2bb5067e13 Move the code to wait for carrier on a tty into a common function, since it
depends only on device-independent state bits.
Implement SunOS-style `dialout' devices.
1998-03-22 00:55:37 +00:00
mycroft 2ada4b4af1 Replace TS_WOPEN with t_wopen, per mail on tech-kern. 1998-03-21 04:02:47 +00:00
fvdl e5bc90f40c Merge with Lite2 + local changes 1998-03-01 02:20:01 +00:00
thorpej c1538fb038 Implement TIOCGSID. 1998-02-14 01:26:50 +00:00
kleink af9cc34b3c Add ONOCR and ONLRET output modes, from XPG4.2. 1998-02-13 21:53:44 +00:00
kleink 0dc9b5452d Fix variable declarations: register -> register int. 1998-02-12 20:39:41 +00:00
drochner a9006ce5b9 Make ttyblock() work as intended and documented in canonical mode.
(operator precedence problem)
closes PR kern/2131 (Matthias Pfaller)
1997-12-12 12:49:40 +00:00
thorpej 3569d48361 defopt UCONSOLE 1997-10-28 01:53:50 +00:00
mycroft b8267c1737 Count characters even when !OPOST and FLUSHO.
Don't output the \r for ONLCR if FLUSHO.
1997-10-19 20:35:21 +00:00
mycroft 64d080efe0 Make various standard wmesg strings const. 1997-10-09 12:59:50 +00:00
mycroft 7f35228e7e Make wmesg arguments to various functions const. 1997-10-09 12:49:44 +00:00
kleink df14b3b830 Add some robustness to ttymodem(), e.g. do not SIGHUP when there hasn't been
an actual carrier transition; from Charles M. Hannum.
1997-06-20 10:50:11 +00:00
kleink a0696b91ad When a background process attempts to TIOC[CS]BRK (a.k.a. tcsendbreak()) or
TIOCSTART (a.k.a tcflow()), send its process group a SIGTTOU.
1997-06-18 15:32:33 +00:00
kleink 93da19a2f1 Rewrote break/parity/framing error handling from spec. 1997-06-17 20:41:59 +00:00
kleink b7ba6138b6 If the pgrp_id argument of TIOCSPGRP (a.k.a. tcsetpgrp()) does not specify
an existing process group, return EINVAL.
1997-05-22 17:35:42 +00:00
kleink 91830a9500 When a background process attempts to TIOCDRAIN (a.k.a. tcdrain()), send
its process group a SIGTTOU signal.
1997-05-20 13:11:33 +00:00
thorpej 92c113aebb Fix printf format botch. 1997-05-17 00:19:02 +00:00
gwr 09da7e273e Eliminate vmspace.vm_pmap and all references to it unless
__VM_PMAP_HACK is defined (for temporary compatibility).
The __VM_PMAP_HACK code should be removed after all the
ports that define it have removed all vm_pmap references.
1997-05-16 21:39:50 +00:00
kleink a0dca5145e Fix a CRNL/NLCR botch I made after looking this up in the X/Open spec.
Fixes PR 3453; from John Kohl and Enami Tsugutomo.
1997-04-07 16:09:28 +00:00
kleink 4256cf1898 Add some clarification about the TTBREAKC macro's purpose; suggested by
Chris G. Demetriou.
1997-04-06 14:44:44 +00:00
cgd c65f7b2d9a fix missing parenthesis in TTBREAKC() 1997-04-06 08:15:17 +00:00
kleink dbf70fddf5 If TOSTOP is set, and the process group of the writing process is orphaned,
and the writing process is not ignoring or blocking SIGTTOU, do not signal
the process but return EIO.
1997-04-05 21:40:34 +00:00
kleink c028733220 Recognize EOL2 as a delimiter/"break" character only if IEXTEN is set. 1997-04-05 19:50:18 +00:00
mycroft c4cd861045 Remove unintended piece of last change. 1997-04-04 21:05:00 +00:00
mycroft 00f128b69f Fix several bugs related to MDMBUF. Also, remove the partial handling from
ttymodem(); it's not complete, it's better done in the driver, and only the
com driver ever supported it anyway.
1997-04-04 21:02:28 +00:00
kleink 4d65b07afa As specified in POSIX.1 (and termios(4)!), when cc[VMIN]==0 a read() shall
be satisfied by any amount of data actually read.
1997-04-04 15:10:34 +00:00
kleink 080aeda54f WERASE, REPRINT, STATUS and DSUSP are extensions to the POSIX.1 GTI
set of special characters: recognize them only if IEXTEN is set.
1997-04-03 14:24:45 +00:00
kleink 2da2c50987 KNF glitch in last commit, pointed out by Chris G. Demetriou. 1997-04-02 03:23:01 +00:00
kleink 6b58679ffa Implement OCRNL "\r" -> "\n" tty output translation.
Fixes PR standards/3434.
1997-04-02 03:10:51 +00:00