Posted for discussion. Some downstream projects (e.g. ElectroBSD) have removed the TIOCSTI #define and implementation; I'm curious what you think about #ifdefs like this to allow the test to build in this case.
Of course a downstream patch set could just include disconnecting the test, but this allows for a minimal change to remove TIOCSTI.