Before this fix, it would fail to build with gcc-14 with the error:
conftest.c: In function 'main':
conftest.c:265:11: error: implicit declaration of function 'ioctl'
[-Wimplicit-function-declaration]
265 | int foo = ioctl (0, FIONREAD, &foo);
| ^~~~~
Solaris documents ioctl() as being defined in <unistd.h>.
* configure.ac: Fix FIONREAD check with gcc-14 on Solaris.
Ref:
https://lists.gnu.org/r/emacs-devel/2024-10/msg00195.html
Copyright-paperwork-exempt: yes
(cherry picked from commit
5e5689a2a40cd16d7593a0c7ddea5511adc3bf22)
#ifdef USG5_4
# include <sys/filio.h>
#endif
+ #ifdef HAVE_UNISTD_H
+ # include <unistd.h> /* defines ioctl() on Solaris */
+ #endif
]],
[[int foo = ioctl (0, FIONREAD, &foo);]])],
[emacs_cv_usable_FIONREAD=yes],