home *** CD-ROM | disk | FTP | other *** search
/ minnie.tuhs.org / unixen.tar / unixen / PDP-11 / Bug_Fixes / Net.v7bugs / 0026 < prev    next >
Encoding:
Text File  |  1981-08-05  |  852 b   |  41 lines

  1. Areed.183
  2. net.v7bugs
  3. utzoo!decvax!ucbvax!ihnss!cbosg!harpo!chico!duke!reed!valer
  4. Fri Jul 31 20:51:10 1981
  5. proc on q
  6. /*
  7.  *    This program helps generate the "proc on q"
  8.  *    diagnostic.  By putting a 9600 keyboard in
  9.  *    CBREAK mode and pounding on the keyboard,
  10.  *    we have been able to consistently produce the
  11.  *    diagnostic in the first line or two of typing.
  12.  *    This diagnostic comes from an interrupt window
  13.  *    in the following code in sig.c:
  14.  *        if(p->p_stat == SSLEEP && p->p_pri > PZERO)
  15.  *            setrun(p);
  16.  *    The fix is to bracket the code as follows:
  17.  *        s = spl6();
  18.  *        <above code>
  19.  *        splx(s);
  20.  */
  21. brkpt() { }
  22. main()
  23. {
  24.     char    c;
  25.     int    child;
  26.  
  27.     switch(child = fork()) {
  28.     case 0:
  29.         for (signal(5, brkpt); ; )
  30.             read(0, &c, 1);
  31.     case -1:
  32.         perror("fork");
  33.         break;
  34.     default:
  35.         sleep(2);
  36.         printf("start typing\n");
  37.         for ( ; ; )
  38.             kill(child, 5);
  39.     }
  40. }
  41.