diff options
Diffstat (limited to 'hack/hack.ioctl.c')
| -rw-r--r-- | hack/hack.ioctl.c | 45 |
1 files changed, 28 insertions, 17 deletions
diff --git a/hack/hack.ioctl.c b/hack/hack.ioctl.c index fccd359f..d9fece93 100644 --- a/hack/hack.ioctl.c +++ b/hack/hack.ioctl.c @@ -1,32 +1,43 @@ +/* $NetBSD: hack.ioctl.c,v 1.6 1997/10/19 16:58:07 christos Exp $ */ + /* * Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ +#include <sys/cdefs.h> #ifndef lint -static char rcsid[] = "$NetBSD: hack.ioctl.c,v 1.5 1995/04/28 23:01:45 mycroft Exp $"; -#endif /* not lint */ +__RCSID("$NetBSD: hack.ioctl.c,v 1.6 1997/10/19 16:58:07 christos Exp $"); +#endif /* not lint */ -/* 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> +/* + * 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 <termios.h> -#include "config.h" -struct termios termios; +#include "hack.h" +#include "extern.h" +struct termios termios; -getioctls() { +void +getioctls() +{ (void) tcgetattr(fileno(stdin), &termios); } -setioctls() { +void +setioctls() +{ (void) tcsetattr(fileno(stdin), TCSADRAIN, &termios); } -#ifdef SUSPEND /* implies BSD */ +#ifdef SUSPEND /* implies BSD */ #include <signal.h> -dosuspend() { +int +dosuspend() +{ #ifdef SIGTSTP - if(signal(SIGTSTP, SIG_IGN) == SIG_DFL) { + if (signal(SIGTSTP, SIG_IGN) == SIG_DFL) { settty((char *) 0); (void) signal(SIGTSTP, SIG_DFL); (void) kill(0, SIGTSTP); @@ -36,9 +47,9 @@ dosuspend() { } else { pline("I don't think your shell has job control."); } -#else SIGTSTP +#else /* SIGTSTP */ pline("Sorry, it seems we have no SIGTSTP here. Try ! or S."); -#endif SIGTSTP - return(0); +#endif /* SIGTSTP */ + return (0); } -#endif SUSPEND +#endif /* SUSPEND */ |
