ack/plat/pdpv7/libsys
George Koehler 5db312a1c0 Prevent crash in isatty()
The existing code allocated 2 bytes (char*), but gtty() needs 6 bytes
(struct sgttyb), so isatty() smashed the stack and corrupted its
return address, probably causing SIGBUS or SIGSEGV.

Fix by switching to TIOCGETD, which needs 2 bytes.  TIOCGETD isn't in
the manual for tty(4), but does appear in
https://minnie.tuhs.org//cgi-bin/utree.pl?file=V7/usr/sys/dev/tty.c

This fixes hilo_c.pdpv7 and hilo_mod.pdpv7 in simh-pdp11.
2018-06-15 00:48:29 -04:00
..
_alarm.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
_close.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
_creat.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
_dup.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
_execl.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
_exit.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
_fork.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
_fstat.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
_ftime.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
_getpid.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
_gtty.c Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
_ioctl.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
_kill.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
_link.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
_lseek.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
_open.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
_pause.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
_pipe.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
_read.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
_sbrk.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
_unlink.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
_wait.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
_write.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
access.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
acct.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
alarm.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
build.lua Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
chdir.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
chmod.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
chown.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
chroot.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
cleanup.c Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
close.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
creat.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
dup.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
errno.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
execl.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
execle.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
execv.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
execve.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
exit.c Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
fetchi.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
fork.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
fperr.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
fstat.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
ftime.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
getgid.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
getgrp.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
getpid.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
getppid.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
getuid.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
gldav.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
gtty.c Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
ioctl.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
isatty.c Prevent crash in isatty() 2018-06-15 00:48:29 -04:00
kill.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
killbkg.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
killpg.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
link.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
lock.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
login.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
lseek.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
lstat.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
mknod.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
mount.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
mpxcall.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
nice.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
nostk.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
open.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
pause.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
phys.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
pipe.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
profil.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
ptrace.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
qfstat.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
qstat.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
quota.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
read.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
readlink.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
reboot.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
renice.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
rtp.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
sbrk.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
setgid.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
setgrp.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
setuid.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
signal.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
stat.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
stime.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
stty.c Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
submit.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
symlink.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
sync.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
sys.h Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
time.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
times.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
ucall.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
umask.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
umount.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
unlink.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
utime.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
vfork.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
vhangup.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
wait.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00
write.s Made the cgg and the cg code generator work; use this to beat the PDP/11 2018-02-23 22:31:46 +01:00