home *** CD-ROM | disk | FTP | other *** search
/ minnie.tuhs.org / unixen.tar / unixen / PDP-11 / Trees / V7 / usr / src / cmd / uucp / ioctl.c < prev    next >
Encoding:
C/C++ Source or Header  |  1979-01-10  |  492 b   |  32 lines

  1. #include "uucp.h"
  2. #include <sgtty.h>
  3.  
  4. /*******
  5.  *    ioctl(fn, com, ttbuf)    for machines without ioctl
  6.  *    int fn, com;
  7.  *    struct sgttyb *ttbuf;
  8.  *
  9.  *    return codes - same as stty and gtty
  10.  */
  11.  
  12. ioctl(fn, com, ttbuf)
  13. int fn, com;
  14. struct sgttyb *ttbuf;
  15. {
  16.     struct sgttyb tb;
  17.  
  18.     switch (com) {
  19.     case TIOCHPCL:
  20.         gtty(fn, &tb);
  21.         tb.sg_flags |= 1;
  22.         return(stty(fn, &tb));
  23.     case TIOCGETP:
  24.         return(gtty(fn, ttbuf));
  25.     case TIOCSETP:
  26.         return(stty(fn, ttbuf));
  27.     case TIOCEXCL:
  28.     default:
  29.         return(-1);
  30.     }
  31. }
  32.