In file included from /code/illumos-gate/proto/root_i386/usr/include/fcntl.h:40:0,
from ../screen/tgetch.c:536:
../screen/tgetch.c: In function '_fpk':
/code/illumos-gate/proto/root_i386/usr/include/sys/fcntl.h:243:3: error: typedef 'flock_t' locally defined but not used [-Werror=unused-local-typedefs]
} flock_t;
^~~~~~~
/code/illumos-gate/proto/root_i386/usr/include/sys/fcntl.h:273:3: error: typedef 'flock64_t' locally defined but not used [-Werror=unused-local-typedefs]
} flock64_t;
^~~~~~~~~
/code/illumos-gate/proto/root_i386/usr/include/sys/fcntl.h:355:3: error: typedef 'fshare_t' locally defined but not used [-Werror=unused-local-typedefs]
} fshare_t;
^~~~~~~~
cc1: all warnings being treated as errors
I'd recommend that you do the first include like this:
+#ifndef FIONREAD
+#include <fcntl.h>
+#endif /* FIONREAD */
and the second one like this:
+#ifdef SYSV
+#include <fcntl.h>
+#endif /* SYSV */
Doing it like that retains the conditional inclusion that was present in the original.