tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: FYI: POSIX update - SIGWINCH and 'struct winsize' (etc) to be added

On Sat, Oct 21, 2017 at 03:42:20PM +0700, Robert Elz wrote:
 >     Date:        Sat, 21 Oct 2017 02:49:33 +0000 (UTC)
 >     From: (Christos Zoulas)
 >     Message-ID:  <osecjt$ot$>
 >   | That is <sys/termios.h> already; termios.h is a symlink to that.
 >   | Try to move it there. I doubt it will cause any disruption. We might
 >   | be able to save creating another header.
 > After reflection, maybe not, struct winsize used to be obtained from
 > <sys/ioctl.h>, tty(4) still says that's where to get it from (that can
 > perhaps be updated, sometime after winsize becomes exposed by termios.h,
 > I don't thing pushing progs to include sys/ttycom.h would be rational.)

That can be changed. In fact, tty.4 should be updated to refer to the
new functions the same way it refers to tcgetattr/tcsetattr.

There is really not very much software that manipulates the window
size without also manipulating the terminal settings, and therefore
already includes termios.h, so source-level breakage will be limited
   - crap software that thinks it should be issuing TIOCGETA (etc.)
     itself without including termios.h (should be patched or taken
     out and shot for everyone's benefit)

   - really ancient software that manipulates the window size but uses
     uses sgtty.h to manipulate the terminal settings (should also be

I think we can tolerate this, but it might be a good idea to run a
bulk build to see just how much, if anything, breaks.

 > It looks as if a new header (sad as it may seem for such a trivial purpose)
 > is needed after all.
 > If that happens, would it be reasonable to make the new header #error
 > if it isn't being included from either termios.h or ttycom.h ?  (ie:
 > no-one else is supposed to know it exists...)

Yes, although I tend to think that the setup required to cause #error
is not worthwhile and that it's sufficient to put a notice like

    * This header file is not a supported public interface.
    * Application code that wants to use the declarations in it
    * should include <termios.h>. You have been warned.

at the top of the header and let idiots hang themselves if they

David A. Holland

Home | Main Index | Thread Index | Old Index