Transmitting BREAK
gwyn%brl-vld at sri-unix.UUCP
gwyn%brl-vld at sri-unix.UUCP
Mon Feb 13 21:23:32 AEST 1984
From: Doug Gwyn (VLD/VMB) <gwyn at brl-vld>
/* sendbreak -- send BREAK to terminal */
#include <fcntl.h>
#include <sys/ioctl.h>
extern void exit(), perror();
extern int ioctl(), open();
main( argc, argv )
int argc;
char *argv[];
{
register char *tty; /* terminal file name */
register int fd; /* terminal file descriptor */
if ( argc < 2 )
tty = "/dev/tty";
else
tty = argv[1];
if ( (fd = open( tty, O_RDONLY )) < 0
|| ioctl( fd, TCSBRK, 0 ) < 0
) {
perror( tty );
exit( 1 );
}
exit( 0 );
}
More information about the Comp.unix
mailing list