static char *sccsid
= "@(#)lock.c 4.3 (Berkeley) %G%";
* Lock a terminal up until the knowledgeable Joe returns.
char masterp
[] = "hasta la vista\n";
char s
[BUFSIZ
], s1
[BUFSIZ
];
signal(SIGQUIT
, SIG_IGN
);
signal(SIGTSTP
, SIG_IGN
);
if (ioctl(0, TIOCGETP
, &tty
))
ntty
= tty
; ntty
.sg_flags
&= ~ECHO
;
ioctl(0, TIOCSETN
, &ntty
);
fgets(s
, sizeof s
, stdin
);
fgets(s1
, sizeof s1
, stdin
);
fgets(s
, sizeof s
, stdin
);
if (strcmp(s
, masterp
) == 0)
if (ioctl(0, TIOCGETP
, &ntty
))
ioctl(0, TIOCSETN
, &tty
);