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



Earlier I asked...

  | Could we perhaps use Christos' method, with the addition of modifying
  | <sys/ioctl.h> so that instead of just
  | 
  | #include <sys/ttycom.h>
  | 
  | it instead has ...
  | 
  | #if defined(_NETBSD_SOURCE)
  | #include <sys/ttycom.h>
  | #else
  | #define _NETBSD_SOURCE 1
  | #include <sys/ttycom.h>
  | #undef _NETBSD_SOURCE
  | #endif
  | 
  | ?
  | 
  | If that's acceptable (and works ...

So far the latter criterion ("works") seems to be just fine - doing it
this way allows a program compiled with -D_POSIX_SOURCE, and hence which
does not have _NETBSD_SOURCE) that uses <sys/ioctl.h> and the old ioctl()
method to get the window size to compile (and of course run) just fine.

That was your issue, wasn't it Kamil?

Obviously it works without _POSIX_SOURCE (and so with _NETBSD_SOURCE) as well.

A simple posix() only program (compiled with or without -D_POSIX_SOURCE)
that uses the new functions and <termios.h> also compiles (and runs) just fine.

A program compiled to use <termios.h> (no sys/ioctl.h) that attempts to
reference ioctl() or the TIOC... symbols gets warnings (no prototype for
ioctl) and errors (TIOC... undefined) which is all as it should be.

So, I think this one looks like the winner, but I will leave it for the
rest of you to ponder the "acceptable" part of the question above, while
I clean up the mess I have made in my source tree while trying all these
variations (a whole bunch of #if 0, and /* */ type things have appeared,
and need to go away again!)

kre




Home | Main Index | Thread Index | Old Index