summaryrefslogtreecommitdiffstats
path: root/hack/hack.ioctl.c
diff options
context:
space:
mode:
authorcgd <cgd@NetBSD.org>1993-03-21 09:45:37 +0000
committercgd <cgd@NetBSD.org>1993-03-21 09:45:37 +0000
commit77e3814f0c0e3dea4d0032e25666f77e6f83bfff (patch)
tree7eddfcbf3dd12089e71dc3fafb0a106c5c5766c7 /hack/hack.ioctl.c
parente81d63576b2e46ab90da7d75fa155ea57ee4d32e (diff)
downloadbsdgames-darwin-77e3814f0c0e3dea4d0032e25666f77e6f83bfff.tar.gz
bsdgames-darwin-77e3814f0c0e3dea4d0032e25666f77e6f83bfff.tar.zst
bsdgames-darwin-77e3814f0c0e3dea4d0032e25666f77e6f83bfff.zip
initial import of 386bsd-0.1 sources
Diffstat (limited to 'hack/hack.ioctl.c')
-rw-r--r--hack/hack.ioctl.c53
1 files changed, 53 insertions, 0 deletions
diff --git a/hack/hack.ioctl.c b/hack/hack.ioctl.c
new file mode 100644
index 00000000..6669ceab
--- /dev/null
+++ b/hack/hack.ioctl.c
@@ -0,0 +1,53 @@
+/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
+/* hack.ioctl.c - version 1.0.2 */
+
+/* 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>
+#include "config.h"
+#ifdef BSD
+#include <sgtty.h>
+struct ltchars ltchars, ltchars0;
+#else
+#include <termio.h> /* also includes part of <sgtty.h> */
+struct termio termio;
+#endif BSD
+
+getioctls() {
+#ifdef BSD
+ (void) ioctl(fileno(stdin), (int) TIOCGLTC, (char *) &ltchars);
+ (void) ioctl(fileno(stdin), (int) TIOCSLTC, (char *) &ltchars0);
+#else
+ (void) ioctl(fileno(stdin), (int) TCGETA, &termio);
+#endif BSD
+}
+
+setioctls() {
+#ifdef BSD
+ (void) ioctl(fileno(stdin), (int) TIOCSLTC, (char *) &ltchars);
+#else
+ (void) ioctl(fileno(stdin), (int) TCSETA, &termio);
+#endif BSD
+}
+
+#ifdef SUSPEND /* implies BSD */
+dosuspend() {
+#include <signal.h>
+#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