summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog1
-rw-r--r--src/system.h5
2 files changed, 6 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 09e03e3..b9842de 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -15,6 +15,7 @@
 	* Added default implementation of killpg.
 	* Disable ulimit if there is no getrlimit.
 	* Disable histcmd completely when SMALL is defined.
+	* Added default definition for SSIZE_MAX.
 
 2005-10-26  Herbert Xu <herbert@gondor.apana.org.au>
 
diff --git a/src/system.h b/src/system.h
index 1242e24..833e162 100644
--- a/src/system.h
+++ b/src/system.h
@@ -26,9 +26,14 @@
  * SUCH DAMAGE.
  */
 
+#include <limits.h>
 #include <signal.h>
 #include <sys/types.h>
 
+#ifndef SSIZE_MAX
+#define SSIZE_MAX ((ssize_t)((size_t)-1 >> 1))
+#endif
+
 static inline void sigclearmask(void)
 {
 #ifdef HAVE_SIGSETMASK