home *** CD-ROM | disk | FTP | other *** search
/ minnie.tuhs.org / unixen.tar / unixen / PDP-11 / Trees / V7 / usr / src / libc / gen / pkon.c < prev    next >
Encoding:
C/C++ Source or Header  |  1979-05-05  |  554 b   |  43 lines

  1. #include <sgtty.h>
  2.  
  3. struct    piocb {
  4.     unsigned t;
  5.     short    psize;
  6.     short    mode;
  7.     short    state;
  8.     char    window;
  9. };
  10. pkon(fd, size)
  11. {
  12.     if (size&037 || size > 128) {
  13.         write(2,"bad packet size\n",16);
  14.         return(-1);
  15.     }
  16.     return(turnon(fd, size, 2, 0));
  17. }
  18. turnon(fd,psize,window,mode)
  19. {
  20. struct piocb p;
  21.  
  22.     p.window = window;
  23.     p.psize = psize;
  24.     p.mode = mode;
  25.     p.t = 1;
  26.     if (ioctl(fd,TIOCSETD,&p) < 0 || ioctl(fd,DIOCGETP,&p) < 0) {
  27.         return(-1);
  28.     }
  29.     return(p.psize);
  30. }
  31.  
  32. pkoff(fd)
  33. {
  34. struct piocb p;
  35.  
  36.     close(fd);
  37.     return;
  38. /*
  39.     p.t = 0;
  40.     return(ioctl(fd,TIOCSETD,&p));
  41. */
  42. }
  43.