home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume8 / help.jn / cbreak.c < prev    next >
Encoding:
C/C++ Source or Header  |  1989-08-19  |  490 b   |  28 lines

  1. #ifdef sequent
  2. #include <stdio.h>
  3. #include <sgtty.h>
  4.  
  5. cbreak()
  6. {
  7.     int i;
  8.     extern int errno;
  9.     struct sgttyb ttystatus;
  10.     char *a;
  11.     /* it is seemingly impossible to get lint to shut
  12.     up about this: */
  13.     a= &ttystatus.sg_ispeed;
  14.     errno=0;
  15.     i=ioctl(0,TIOCGETP,a);
  16.     if(i<0)
  17.     {int me;me=errno;fprintf(stderr,"errno %d\n",me);exit(3);}
  18.  
  19. #define F    ttystatus.sg_flags
  20.     F |= CBREAK;
  21.     i=ioctl(0,TIOCSETP,a);
  22.     if(i<0)
  23.     {int me;me=errno;fprintf(stderr,"errno %d\n",me);exit(4);}
  24. }
  25. #else
  26. cbreak(){}
  27. #endif
  28.