#include <errno.h>
#include <fcntl.h>
#include <unistd.h>
+
+#ifdef HAVE_TERMIOS_H
#include <termios.h>
+#endif
#ifdef HAVE_INTTYPES_H
#include <inttypes.h>
#endif
#ifdef HAVE_SYS_PARAM_H
-#include <sys/ioctl.h>
+#include <sys/param.h>
#endif
/* SunOS really wants sys/socket.h BEFORE net/if.h,
#ifdef HAVE_MINGW
#include <windows.h>
-#include <winsock.h>
+#include <winsock2.h>
#endif
/* Include localisation support */