Commit 1412e3ce authored by rswindell's avatar rswindell
Browse files

Deuce's mod: support for Solaris build.

parent cbf1ae60
......@@ -50,6 +50,9 @@
#include <sys/kbio.h>
#elif defined(__linux__)
#include <sys/kd.h>
#elif defined(__solaris__)
#include <sys/kbio.h>
#include <sys/kbd.h>
#endif
#endif /* __unix__ */
......@@ -125,9 +128,17 @@ void DLLCALL unix_beep(int freq, int dur)
console_fd = open("/dev/console", O_NOCTTY);
if(console_fd != -1) {
#if defined(__solaris__)
ioctl(console_fd, KIOCCMD, KBD_CMD_BELL);
#else
ioctl(console_fd, KIOCSOUND, (int) (1193180 / freq));
#endif /* solaris */
SLEEP(dur);
#if defined(__solaris__)
ioctl(console_fd, KIOCCMD, KBD_CMD_NOBELL); /* turn off tone */
#else
ioctl(console_fd, KIOCSOUND, 0); /* turn off tone */
#endif /* solaris */
}
#endif
}
......@@ -217,7 +228,7 @@ char* DLLCALL os_version(char *str)
struct utsname unixver;
if(uname(&unixver)!=0)
if(uname(&unixver)<0)
sprintf(str,"Unix (uname errno: %d)",errno);
else
sprintf(str,"%s %s %s"
......
......@@ -101,6 +101,10 @@ extern "C" {
#define PLATFORM_DESC "OpenBSD"
#elif defined(BSD)
#define PLATFORM_DESC "BSD"
#elif defined(__solaris__)
#define PLATFORM_DESC "Solaris"
#elif defined(__sun__)
#define PLATFORM_DESC "SunOS"
#elif defined(__unix__)
#define PLATFORM_DESC "Unix"
#else
......
......@@ -58,10 +58,14 @@
#include <sys/types.h> /* For u_int32_t on FreeBSD */
#include <netinet/in.h> /* IPPROTO_IP */
#include <sys/socket.h> /* socket/bind/etc. */
#include <sys/ioctl.h> /* FIONBIO */
#include <sys/time.h> /* struct timeval */
#include <arpa/inet.h> /* inet_ntoa */
#include <unistd.h> /* close */
#if defined(__solaris__)
#include <sys/filio.h> /* FIONBIO */
#else
#include <sys/ioctl.h> /* FIONBIO */
#endif
#endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment