]> granicus.if.org Git - nethack/commitdiff
U555 - solaris compilation bits
authorcohrs <cohrs>
Wed, 30 Jul 2003 23:19:56 +0000 (23:19 +0000)
committercohrs <cohrs>
Wed, 30 Jul 2003 23:19:56 +0000 (23:19 +0000)
- If you have Gnome installed on solaris, the GETRES support wouldn't build.
I don't have access to a solaris system with Gnome installed, but hacked
unixconf.h to force the GETRES code itself to be compiled.  So, I believe the
unixres.c change will work for folks really using Gnome on Solaris.
Whether the rest of the gnome code will build there is beyond me.
- I accidentally left TIMED_DELAY defined and the Solaris build failed.
While solaris has usleep(), this is not part of SVR4 as far as I can tell.
But, SysV does have poll, so I implemented msleep() for SysV systems in
terms of poll.  So, you can now define TIMED_DELAY on any SYSV build.

doc/fixes34.2
include/extern.h
sys/unix/unixres.c
sys/unix/unixunix.c

index 137644702d6b5a3fdeefc214f5306ae268ed2425..90c72210b5057b5836cc501874689e89dc440f1b 100644 (file)
@@ -138,6 +138,7 @@ unix: don't autosave if hangup occurs after game is over
 linux: add example use of nroff on recent Linux distros
 linux: use random() by default instead of lrand48()
 OpenBSD: time() prototype and correct default Mail program
+Gnome: compilation problems on Solaris
 
 
 General New Features
@@ -149,4 +150,5 @@ Platform- and/or Interface-Specific New Features
 win32tty: keystroke handlers can be dynamically loaded to assist in resolving
        internationalization issues
 win32tty: add Ray Chason's code for international keyboard handling
+Solaris (and other SystemV variants): TIMED_DELAY support
 
index 976bb1b8cff5466fecb789dcd36fbd39c56fa5f3..0e16dd5790b3daf003daf248de42e36fb19dde8f 100644 (file)
@@ -2070,6 +2070,9 @@ E void VDECL(error, (const char *,...)) PRINTF_F(1,2);
 #ifdef UNIX
 E void NDECL(getlock);
 E void FDECL(regularize, (char *));
+# if defined(TIMED_DELAY) && !defined(msleep) && defined(SYSV)
+E void FDECL(msleep, (unsigned));
+# endif
 # ifdef SHELL
 E int NDECL(dosh);
 # endif /* SHELL */
index 8c234e57361edfb91584a1a453073cc07639758d..3e7f9899dbf632a27e1172f62b1d9fcda20b2cdf 100644 (file)
@@ -61,6 +61,10 @@ uid_t *ruid, *euid, *suid;
 
 #   else       /* SYS_getresuid */
 
+#ifdef SVR4
+#include <sys/stat.h>
+#endif /* SVR4 */
+
 static int
 real_getresuid(ruid, euid, suid)
 uid_t *ruid, *euid, *suid;
index ed17c91c10e6c12682ab450a7994ad69b84693a4..6950b820b771e4754708217baa219e36217f4af5 100644 (file)
@@ -219,6 +219,21 @@ register char *s;
 #endif
 }
 
+#if defined(TIMED_DELAY) && !defined(msleep) && defined(SYSV)
+#include <poll.h>
+
+void
+msleep(msec)
+unsigned msec;                         /* milliseconds */
+{
+       struct pollfd unused;
+       int msecs = msec;               /* poll API is signed */
+
+       if (msecs < 0) msecs = 0;       /* avoid infinite sleep */
+       (void) poll(&unused, (unsigned long)0, msecs);
+}
+#endif /* TIMED_DELAY for SYSV */
+
 #ifdef SHELL
 int
 dosh()