* License.....: MIT
*/
-#ifdef OSX
+#ifdef DARWIN
#include <stdio.h>
#endif
*/
#ifdef LINUX
-static struct termio savemodes;
+static struct termios savemodes;
static int havemodes = 0;
int tty_break()
{
- struct termio modmodes;
+ struct termios modmodes;
- if (ioctl (fileno (stdin), TCGETA, &savemodes) < 0) return -1;
+ if (tcgetattr (fileno (stdin), &savemodes) < 0) return -1;
havemodes = 1;
modmodes.c_cc[VMIN] = 1;
modmodes.c_cc[VTIME] = 0;
- return ioctl (fileno (stdin), TCSETAW, &modmodes);
+ return tcsetattr (fileno (stdin), TCSANOW, &modmodes);
}
int tty_getchar()
{
if (!havemodes) return 0;
- return ioctl (fileno (stdin), TCSETAW, &savemodes);
+ return tcsetattr (fileno (stdin), TCSADRAIN, &savemodes);
}
#endif
-#ifdef OSX
+#ifdef DARWIN
static struct termios savemodes;
static int havemodes = 0;
const int len = GetModuleFileName (NULL, exec_path, exec_path_len - 1);
- #elif OSX
+ #elif DARWIN
uint size = exec_path_len;
myfree (buf);
}
-#ifdef OSX
+#ifdef DARWIN
int pthread_setaffinity_np (pthread_t thread, size_t cpu_size, cpu_set_t *cpu_set)
{
int core;
if ((d = opendir (tmp_path)) != NULL)
{
- #ifdef OSX
+ #ifdef DARWIN
struct dirent e;
for (;;) {