IOKit is a private framework in iOS, so it can't be used (and
no headers are provided, so it doesn't even compile).
#endif
/* sys/time.h (for timeval) is required when using osx 10.3 (but not 10.4) */
#endif
/* sys/time.h (for timeval) is required when using osx 10.3 (but not 10.4) */
+/* IOKit is a private framework in iOS, so exclude there */
+#if defined(__APPLE__) && !defined(HOST_IOS)
#include <sys/time.h>
#include <IOKit/IOKitLib.h>
#include <IOKit/serial/IOSerialKeys.h>
#include <sys/time.h>
#include <IOKit/IOKitLib.h>
#include <IOKit/serial/IOSerialKeys.h>
if (cfsetospeed (&newtio, baud_rate) < 0 || cfsetispeed (&newtio, baud_rate) < 0)
return FALSE;
} else {
if (cfsetospeed (&newtio, baud_rate) < 0 || cfsetispeed (&newtio, baud_rate) < 0)
return FALSE;
} else {
-#if __linux__ || __APPLE__
+#if __linux__ || (defined(__APPLE__) && !defined(HOST_IOS))
/* On Linux to set a custom baud rate, we must set the
* "standard" baud_rate to 38400. On Apple we set it purely
/* On Linux to set a custom baud rate, we must set the
* "standard" baud_rate to 38400. On Apple we set it purely
+#elif defined(__APPLE__) && !defined(HOST_IOS)
speed_t speed = baud_rate;
if (ioctl(fd, IOSSIOSPEED, &speed) == -1)
return FALSE;
speed_t speed = baud_rate;
if (ioctl(fd, IOSSIOSPEED, &speed) == -1)
return FALSE;