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



    Date:        Sun, 22 Oct 2017 12:44:54 -0400
    From:        christos%zoulas.com@localhost (Christos Zoulas)
    Message-ID:  <20171022164454.08B6617FDAE%rebar.astron.com@localhost>

  | Yes, and they should (have that defined) since this header is really part
  | of the implementation and should not be included directlty for portability
  | reasoons.

sys/ttycom.h right - that shouldn't be included, but sys/ioctl.h is
fairly widely used, (that imports sys/ttycom.h) and has never needed
_NETBSD_SOURCE to work.

  | I think it is certainly the easiest and most minimum impact solution.

For the record, "it" is moving the _NETBSD_SOURCE guards from around the
#include of sys/ttycom.h in <termios.h> to inside sys/ttycom.h

I am beginning to agree.  I have ruled out simply moving struct winsize
from ttycom.h to termios.h - that breaks in-tree code, and if it breaks
that, it will; break external code as well.   Since I care about long term
stability of the API, that one is not something I would be happy with.

So, unless someone has some other way (other than duplicating the struct 
winsize definition) I think there are just two approaches - either a new
header file, or the one discussed here.

The new header file method certainly works, but has costs.   The method you
proposed seems to work fine as well, the only issue I can see is with
programs that are being compiled on NetBSD, which manage to undefine
_NETBSD_SOURCE (that is, not to have it be defined) without defining one
of the other feature test macros which imply that an interface which does
not support ioctl is being used (and so, <sys/ioctl.h> should not be being
used.

Since the down side is so low, and it avoids the extra header costs, I am
leaning towards your method.

While doing this is not urgent, it would be nice to get it all included
in NetBSD-8 so we have something of a deadline - so I will wait a couple
more days to see if there are more opinions (and to allow those who do not
deal with NetBSD over weekends...) and then, if nothing has changed,
commit this method.

kre



Home | Main Index | Thread Index | Old Index