1: /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
   2: /* hack.ioctl.c - version 1.0.2 */
   3: 
   4: /* KLUDGE -- vars s/ltchars/ltc/ -- our C doesn't distinguish past 7 chars */
   5: 
   6: /* This cannot be part of hack.tty.c (as it was earlier) since on some
   7:    systems (e.g. MUNIX) the include files <termio.h> and <sgtty.h>
   8:    define the same constants, and the C preprocessor complains. */
   9: #include <stdio.h>
  10: #include "config.h"
  11: #ifdef BSD
  12: #include    <sgtty.h>
  13: struct ltchars ltc, ltc0;
  14: #else
  15: #include    <termio.h>  /* also includes part of <sgtty.h> */
  16: struct termio termio;
  17: #endif BSD
  18: 
  19: getioctls() {
  20: #ifdef BSD
  21:     (void) ioctl(fileno(stdin), TIOCGLTC, (char *) &ltc);
  22:     (void) ioctl(fileno(stdin), TIOCSLTC, (char *) &ltc0);
  23: #else
  24:     (void) ioctl(fileno(stdin), TCGETA, &termio);
  25: #endif BSD
  26: }
  27: 
  28: setioctls() {
  29: #ifdef BSD
  30:     (void) ioctl(fileno(stdin), TIOCSLTC, (char *) &ltc);
  31: #else
  32:     (void) ioctl(fileno(stdin), TCSETA, &termio);
  33: #endif BSD
  34: }
  35: 
  36: #ifdef SUSPEND      /* implies BSD */
  37: dosuspend() {
  38: #include    <signal.h>
  39: #ifdef SIGTSTP
  40:     if(signal(SIGTSTP, SIG_IGN) == SIG_DFL) {
  41:         settty((char *) 0);
  42:         (void) signal(SIGTSTP, SIG_DFL);
  43:         (void) kill(0, SIGTSTP);
  44:         gettty();
  45:         setftty();
  46:         docrt();
  47:     } else {
  48:         pline("I don't think your shell has job control.");
  49:     }
  50: #else SIGTSTP
  51:     pline("Sorry, it seems we have no SIGTSTP here. Try ! or S.");
  52: #endif SIGTSTP
  53:     return(0);
  54: }
  55: #endif SUSPEND

Defined functions

dosuspend defined in line 37; used 2 times
getioctls defined in line 19; used 1 times
setioctls defined in line 28; used 1 times

Defined variables

ltc defined in line 13; used 2 times
ltc0 defined in line 13; used 1 times
  • in line 22
termio defined in line 16; used 2 times
Last modified: 1987-08-30
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 2550
Valid CSS Valid XHTML 1.0 Strict