# define MACOSX
#endif
-#ifdef SUNOS
-#include <sys/file.h> ///< Needed for O_NDELAY
-#endif
//============================================================================
#elif defined(__OpenBSD__)
# define DP_OS_NAME "OpenBSD"
# define DP_OS_STR "openbsd"
+#elif defined(__DragonFly__)
+# define DP_OS_NAME "DragonFlyBSD"
+# define DP_OS_STR "dragonflybsd"
#elif defined(MACOSX)
# define DP_OS_NAME "Mac OS X"
# define DP_OS_STR "osx"
#elif defined(__MORPHOS__)
# define DP_OS_NAME "MorphOS"
# define DP_OS_STR "morphos"
+#elif defined (sun) || defined (__sun)
+# if defined (__SVR4) || defined (__svr4__)
+# define DP_OS_NAME "Solaris"
+# define DP_OS_STR "solaris"
+# else
+# define DP_OS_NAME "SunOS"
+# define DP_OS_STR "sunos"
+# endif
#else
# define DP_OS_NAME "Unknown"
# define DP_OS_STR "unknown"
Sys_AllowProfiling(false);
#endif
#ifndef WIN32
- fcntl (0, F_SETFL, fcntl (0, F_GETFL, 0) & ~O_NDELAY);
+ fcntl (0, F_SETFL, fcntl (0, F_GETFL, 0) & ~O_NONBLOCK);
#endif
fflush(stdout);
SDL_Quit();
// change stdin to non blocking
#ifndef WIN32
- fcntl (0, F_SETFL, fcntl (0, F_GETFL, 0) & ~O_NDELAY);
+ fcntl (0, F_SETFL, fcntl (0, F_GETFL, 0) & ~O_NONBLOCK);
#endif
va_start (argptr,error);
#else
if(sys.outfd < 0)
return;
-#ifdef O_NDELAY
+#ifndef WIN32
// BUG: for some reason, NDELAY also affects stdout (1) when used on stdin (0).
// this is because both go to /dev/tty by default!
{
int origflags = fcntl (sys.outfd, F_GETFL, 0);
- fcntl (sys.outfd, F_SETFL, origflags & ~O_NDELAY);
+ fcntl (sys.outfd, F_SETFL, origflags & ~O_NONBLOCK);
#endif
#ifdef WIN32
#define write _write
break; // sorry, I cannot do anything about this error - without an output
text += written;
}
-#ifdef O_NDELAY
+#ifndef WIN32
fcntl (sys.outfd, F_SETFL, origflags);
}
#endif
sys.outfd = 1;
#ifndef WIN32
- fcntl(0, F_SETFL, fcntl (0, F_GETFL, 0) | O_NDELAY);
+ fcntl(0, F_SETFL, fcntl (0, F_GETFL, 0) | O_NONBLOCK);
#endif
// we don't know which systems we'll want to init, yet...
void Sys_Shutdown (void)
{
#ifndef WIN32
- fcntl (0, F_SETFL, fcntl (0, F_GETFL, 0) & ~O_NDELAY);
+ fcntl (0, F_SETFL, fcntl (0, F_GETFL, 0) & ~O_NONBLOCK);
#endif
fflush(stdout);
}
// change stdin to non blocking
#ifndef WIN32
- fcntl (0, F_SETFL, fcntl (0, F_GETFL, 0) & ~O_NDELAY);
+ fcntl (0, F_SETFL, fcntl (0, F_GETFL, 0) & ~O_NONBLOCK);
#endif
va_start (argptr,error);
dpvsnprintf (string, sizeof (string), error, argptr);
{
#ifndef WIN32
int origflags = fcntl (sys.outfd, F_GETFL, 0);
- fcntl (sys.outfd, F_SETFL, origflags & ~O_NDELAY);
+ fcntl (sys.outfd, F_SETFL, origflags & ~O_NONBLOCK);
#else
#define write _write
#endif
else
sys.outfd = 1;
#ifndef WIN32
- fcntl(0, F_SETFL, fcntl (0, F_GETFL, 0) | O_NDELAY);
+ fcntl(0, F_SETFL, fcntl (0, F_GETFL, 0) | O_NONBLOCK);
#endif
Host_Main();