In article <5474.1508638...@andromeda.noi.kre.to>, Robert Elz <k...@munnari.oz.au> wrote: > Date: Sat, 21 Oct 2017 19:59:57 +0200 > From: Kamil Rytarowski <n...@gmx.com> > Message-ID: <513a5aac-d68e-a3da-bd28-9e5cd63ab...@gmx.com> > > | We can follow the <sys/timespec.h> approach. Add a dedicated header for > | a struct and include where needed. > >That's what I currently have, it is easy, clean, and works. Unfortunately >it is also costly - it slows compiles, consumes a file system block, and >an inode (plus more of each in cvs, and /usr/src), and means more to maintain. > >If I can find a (relatively) clean way to avoid it, I shall (which means >not simply having the structure duplicated in 2 different .h files, which >also works (would work), and is cheap, but is filthy...)
There is this: christos Index: termios.h =================================================================== RCS file: /cvsroot/src/sys/sys/termios.h,v retrieving revision 1.33 diff -u -u -r1.33 termios.h --- termios.h 31 Jul 2016 21:34:53 -0000 1.33 +++ termios.h 22 Oct 2017 03:08:19 -0000 @@ -284,15 +284,12 @@ #endif /* !_KERNEL */ -#if defined(_NETBSD_SOURCE) - /* * Include tty ioctl's that aren't just for backwards compatibility * with the old tty driver. These ioctl definitions were previously * in <sys/ioctl.h>. */ #include <sys/ttycom.h> -#endif /* * END OF PROTECTED INCLUDE. Index: ttycom.h =================================================================== RCS file: /cvsroot/src/sys/sys/ttycom.h,v retrieving revision 1.20 diff -u -u -r1.20 ttycom.h --- ttycom.h 19 Oct 2012 16:49:21 -0000 1.20 +++ ttycom.h 22 Oct 2017 03:08:19 -0000 @@ -58,6 +58,7 @@ unsigned short ws_ypixel; /* vertical size, pixels */ }; +#ifdef _NETBSD_SOURCE /* ptmget, for /dev/ptm pty getting ioctl TIOCPTMGET, and for TIOCPTSNAME */ struct ptmget { int cfd; @@ -164,4 +165,6 @@ #define STRIPDISC 6 /* metricom wireless IP discipline */ #define HDLCDISC 9 /* HDLC discipline */ +#endif + #endif /* !_SYS_TTYCOM_H_ */