diff -ru tcl_old/generic/tclInt.h tcl_new/generic/tclInt.h
--- tcl_old/generic/tclInt.h	2013-03-18 15:30:32.000000000 +0100
+++ tcl_new/generic/tclInt.h	2013-03-18 17:18:55.584583800 +0100
@@ -50,6 +50,9 @@
 #else
 #include <string.h>
 #endif
+#if defined(__SCO_VERSION__) && defined(__USLC__) && defined(HAVE_STRINGS_H) /* needed by SCO UnixWare */
+#include <strings.h>
+#endif
 #ifdef STDC_HEADERS
 #include <stddef.h>
 #else
diff -ru tcl_old/unix/tclUnixCompat.c tcl_new/unix/tclUnixCompat.c
--- tcl_old/unix/tclUnixCompat.c	2013-03-18 15:30:32.000000000 +0100
+++ tcl_new/unix/tclUnixCompat.c	2013-03-18 16:14:53.456649100 +0100
@@ -197,7 +197,11 @@
      */
 
     if (tsdPtr->pbuf == NULL) {
+#ifndef _SC_GETPW_R_SIZE_MAX /* needed by SCO UnixWare */
+	tsdPtr->pbuflen = -1;
+#else
 	tsdPtr->pbuflen = (int) sysconf(_SC_GETPW_R_SIZE_MAX);
+#endif
 	if (tsdPtr->pbuflen < 1) {
 	    tsdPtr->pbuflen = 1024;
 	}
@@ -277,7 +281,11 @@
      */
 
     if (tsdPtr->pbuf == NULL) {
+#ifndef _SC_GETPW_R_SIZE_MAX /* needed by SCO UnixWare */
+	tsdPtr->pbuflen = -1;
+#else
 	tsdPtr->pbuflen = (int) sysconf(_SC_GETPW_R_SIZE_MAX);
+#endif
 	if (tsdPtr->pbuflen < 1) {
 	    tsdPtr->pbuflen = 1024;
 	}
@@ -380,7 +388,11 @@
      */
 
     if (tsdPtr->gbuf == NULL) {
-	tsdPtr->gbuflen = (int) sysconf(_SC_GETGR_R_SIZE_MAX);
+#ifndef _SC_GETGR_R_SIZE_MAX /* needed by SCO UnixWare */
+    tsdPtr->gbuflen = -1;
+#else
+    tsdPtr->gbuflen = (int) sysconf(_SC_GETGR_R_SIZE_MAX);
+#endif
 	if (tsdPtr->gbuflen < 1) {
 	    tsdPtr->gbuflen = 1024;
 	}
@@ -460,7 +472,11 @@
      */
 
     if (tsdPtr->gbuf == NULL) {
+#ifndef _SC_GETGR_R_SIZE_MAX /* needed by SCO UnixWare */
+	tsdPtr->gbuflen = -1;
+#else
 	tsdPtr->gbuflen = (int) sysconf(_SC_GETGR_R_SIZE_MAX);
+#endif
 	if (tsdPtr->gbuflen < 1) {
 	    tsdPtr->gbuflen = 1024;
 	}
