Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!batcomputer!itsgw!steinmetz!uunet!auspex!guy From: guy@auspex.UUCP (Guy Harris) Newsgroups: comp.unix.wizards Subject: Re: Porting the BSD 4.3 Tahoe distribution to System V Keywords: stty ioctl sgtty termio stdio Message-ID: <1000@auspex.UUCP> Date: 11 Feb 89 09:50:15 GMT References: <464@visdc.UUCP> Reply-To: guy@auspex.UUCP (Guy Harris) Organization: Auspex Systems, Santa Clara Lines: 41 > A: Is there is any documentation, especially of the include files, > somewhere in the release. Any man(1) entries? If by "the release" you mean "4.3-tahoe", check out "/usr/src/man". > B: What is the difference between the ioctl(2) system call > utilizing the include file and the ioctl(2) call > using . My system has both include files, but they are > clearly not compatible. I have no documentation for sgttyb.h on > my machine and including both in the same source file causes > complaints about redefining things. My version of sgtty.h does > not define CBREAK. Is CBREAK equivalent to RAW? Oh boy. Your system probably has the S5 version of the -style "ioctl"s, which are not compatible with the V7 ones that BSD uses. You probably want to rewrite the tty-munging code. CBREAK is not equivalent to RAW; RAW turns off all input and output processing, while CBREAK merely turns off erase/kill processing. Turning CBREAK on is equivalent to turning ICANON off in the -style "ioctl"s. > C: The BDS software, (for libcurses), uses a stty() system call > with a pointer to a sgtty structure. I have stty() in the libc > archive, but it is not documented. The result of using it seems > to be a hung terminal. To make the BSD software work, does > everything have to be rewritten in terms of ioctl() calls and > termio.h defines? See above. Yes, you probably want rewrite it all in therms of the stuff. "stty" is an old V6ism that in V7 and S3/S5 turned into the TIOCSETP "ioctl" (and "gtty" is another old V6ism that in V7 and S3/S5 turned into TIOCGETP). > D: The BSD software often deals directly with variables defined in > stdio.h. The scanw.c routine of libcurses, contains the line > junk._flag = _IOREAD|_IOSTRG; What does _IOSTRG mean? Is is > equivalent to _IOMYBUF? _IOSTRG means "this buffer is a string, not a file; don't try doing I/O on it." I think the S5 equivalent is setting "junk._file" to _NFILE.