User Details
- User Since
- Dec 16 2020, 10:54 AM (174 w, 22 h)
Jan 1 2021
All the suggested updates have been made.
Dec 28 2020
Made all the requested updates. Used terminology from https://standards.ieee.org/project/1003_1.html to justify writing .St -p1003.1 Base Specifications, Issue 8.
@kib All of your comments are very helpful. I am working on the improvements now.
Added the fact that SIGWINCH is only sent to those processes in the foreground process group that have the terminal as their controlling terminal.
Dec 27 2020
Dec 26 2020
Dec 25 2020
@kib I will definitely keep my promise. May I please have until the end of the weekend to work on this? I might actually be done way before that, in which case I will submit it immediately after I am done.
Dec 24 2020
Updated license.
Removed SCCS line.
I have made the requested changes. Notes:
The winsize related material should currently be under __BSD_VISIBLE guard.
Dec 22 2020
Removes #include <sys/ttycom.h> from termios.h to prevent including unnecessary definitions in the posix header. Since struct winsize is still needed, it is now separately defined in sys/_termios.h with appropriate guards added.
@kib Beautiful! Thank you for the explanation :D I will do my homework right away.
Dec 21 2020
To further strengthen my argument, I would like to point out that since our tcgetwinsize() and tcsetwinsize() are using ioctl()+TIOCGWINSZ/TIOCSWINSZ to implement tcgetwinsize()/tcsetwinsze(), our struct winsize must be the same as the one being used by sys/ioctl.h, which is included from sys/ttycom.h. Also, like NetBSD, musl libc does not directly define struct winsize in their termios.h either; see https://git.musl-libc.org/cgit/musl/tree/include/termios.h; they are defining it by including <bits/alltypes.h>. Sorry for playing devil's advocate, but I want to make sure that I learn things right: why should we place the tcgetwinsize(), tcsetwinsize() declarations under __POSIX_VISIBLE when they are not a part of POSIX *yet*?
Dec 19 2020
Straightforward question: Why does struct winsize have to be defined explicitly in this file even though struct termios does not? The CURRENT POSIX specs demand that struct termios be defined in termios.h. Someone please answer this. If this is answered, then I will not hesitate to explicitly define struct winsize here anymore, even though redundant definitions in various files instead of a central location [ sys/ttycom.h ] seems like bad practice.
Another note: won't defining the same struct [ struct winsize ] in 2 different places [ sys/ttycom.h and termios.h ] just make it harder to maintain in case we need to modify the definition in the future? sys/ttycom.h already provides appropriate guards that will prevent multiple definition in case one's program includes both termios.h and sys/ioctl.h.
@yuripv I have added you to the reviewer list.
Sorry here is the exact link to the current termios.h POSIX specification: https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/termios.h.html. Please note the line "The <termios.h> header shall define the termios structure, which shall include at least the following members..."; then note that the FreeBSD termios.h does not directly define struct termios; instead, it imports the definition from #include <sys/_termios.h>.
@kib I moved the patches here from Bugzilla. I have also updated them. Can you please take another look at them?
Dec 18 2020
Dec 17 2020
Restored empty lines in tcgetattr() and introduced empty lines in tcgetwinsize(), tcsetwinsize() as suggested by @yuripv [ style(9) ].
sys/ttycom.h contains the definition of struct winsize needed for tcgetwinsize() and tcsetwinsize(); I have moved it to the protected block right before the tcgetwinsize() and the tcsetwinsize() declarations. Please compare that with the NetBSD header: https://github.com/NetBSD/src/blob/trunk/sys/sys/termios.h. In fact, both the NetBSD and the OpenBSD versions of termios.h only have sys/ttydefaults.h in the last block after the #endif /* !_TERMIOS_H_ */: