1993-08-02 21:16:36 +04:00
|
|
|
/*
|
|
|
|
* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef lint
|
1995-04-29 03:01:45 +04:00
|
|
|
static char rcsid[] = "$NetBSD: hack.ioctl.c,v 1.5 1995/04/28 23:01:45 mycroft Exp $";
|
1993-08-02 21:16:36 +04:00
|
|
|
#endif /* not lint */
|
1993-03-21 12:45:37 +03:00
|
|
|
|
|
|
|
/* This cannot be part of hack.tty.c (as it was earlier) since on some
|
|
|
|
systems (e.g. MUNIX) the include files <termio.h> and <sgtty.h>
|
|
|
|
define the same constants, and the C preprocessor complains. */
|
|
|
|
#include <stdio.h>
|
1995-04-29 03:01:45 +04:00
|
|
|
#include <termios.h>
|
1993-03-21 12:45:37 +03:00
|
|
|
#include "config.h"
|
1995-04-29 03:01:45 +04:00
|
|
|
struct termios termios;
|
1993-03-21 12:45:37 +03:00
|
|
|
|
|
|
|
getioctls() {
|
1995-04-29 03:01:45 +04:00
|
|
|
(void) tcgetattr(fileno(stdin), &termios);
|
1993-03-21 12:45:37 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
setioctls() {
|
1995-04-29 03:01:45 +04:00
|
|
|
(void) tcsetattr(fileno(stdin), TCSADRAIN, &termios);
|
1993-03-21 12:45:37 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef SUSPEND /* implies BSD */
|
|
|
|
#include <signal.h>
|
1995-01-07 07:36:41 +03:00
|
|
|
dosuspend() {
|
1993-03-21 12:45:37 +03:00
|
|
|
#ifdef SIGTSTP
|
|
|
|
if(signal(SIGTSTP, SIG_IGN) == SIG_DFL) {
|
|
|
|
settty((char *) 0);
|
|
|
|
(void) signal(SIGTSTP, SIG_DFL);
|
|
|
|
(void) kill(0, SIGTSTP);
|
|
|
|
gettty();
|
|
|
|
setftty();
|
|
|
|
docrt();
|
|
|
|
} else {
|
|
|
|
pline("I don't think your shell has job control.");
|
|
|
|
}
|
|
|
|
#else SIGTSTP
|
|
|
|
pline("Sorry, it seems we have no SIGTSTP here. Try ! or S.");
|
|
|
|
#endif SIGTSTP
|
|
|
|
return(0);
|
|
|
|
}
|
|
|
|
#endif SUSPEND
|