Change 33893 by [EMAIL PROTECTED] on 2008/05/20 23:11:00

        
        Integrate:
        [ 33431]
        Determine nv_overflows_integers_at on VMS.
        
        [ 33438]
        *Really* add nv_overflows_integers_at to the VMS configuration
        as 33431 should have done (and would have if I'd remembered to
        remove --dry-run from the patch command).
        
        [ 33550]
        Subject: [EMAIL PROTECTED] configure.com and vms.c fixes.
        From: "John E. Malmberg" <[EMAIL PROTECTED]>
        Date: Sun, 23 Mar 2008 14:29:25 -0500
        Message-id: <[EMAIL PROTECTED]>

Affected files ...

... //depot/maint-5.10/perl/configure.com#7 integrate
... //depot/maint-5.10/perl/vms/vms.c#5 integrate

Differences ...

==== //depot/maint-5.10/perl/configure.com#7 (text) ====
Index: perl/configure.com
--- perl/configure.com#6~33877~ 2008-05-20 02:41:34.000000000 -0700
+++ perl/configure.com  2008-05-20 16:11:00.000000000 -0700
@@ -3948,6 +3948,12 @@
 $ GOSUB inhdr
 $ i_sysmode = tmp
 $!
+$! Check for poll.h
+$!
+$ tmp = "sys/poll.h"
+$ gosub inhdr
+$ i_syspoll = tmp
+$!
 $! Check for sys/access.h
 $!
 $ tmp = "sys/access.h"
@@ -5510,6 +5516,73 @@
 $   echo "Your NVs can preserve only ''nv_preserves_uv_bits' bits of your 
UVs."        
 $ ENDIF
 $!
+$ nv_overflows_integers_at = "0"
+$ echo4 "Checking to find the largest integer value your NVs can hold..."
+$ OS
+$ WS "#include <stdio.h>"
+$ WS ""
+$ WS "typedef ''nvtype' NV;"
+$ WS ""
+$ WS "int"
+$ WS "main() {"
+$ WS "  NV value = 2;"
+$ WS "  int count = 1;"
+$ WS ""
+$ WS "  while(count < 256) {"
+$ WS "    volatile NV up = value + 1.0;"
+$ WS "    volatile NV negated = -value;"
+$ WS "    volatile NV down = negated - 1.0;"
+$ WS "    volatile NV got_up = up - value;"
+$ WS "    int up_good = got_up == 1.0;"
+$ WS "    int got_down = down - negated;"
+$ WS "    int down_good = got_down == -1.0;"
+$ WS ""
+$ WS "    if (down_good != up_good) {"
+$ WS "      fprintf(stderr,"
+$ WS "              ""Inconsistency - up %d %f; down %d %f; for 2**%d 
(%.20f)\n"","
+$ WS "              up_good, (double) got_up, down_good, (double) got_down,"
+$ WS "              count, (double) value);"
+$ WS "      return 1;"
+$ WS "    }"
+$ WS "    if (!up_good) {"
+$ WS "      while (1) {"
+$ WS "        if (count > 8) {"
+$ WS "          count -= 8;"
+$ WS "          fputs(""256.0"", stdout);"
+$ WS "        } else {"
+$ WS "          count--;"
+$ WS "          fputs(""2.0"", stdout);"
+$ WS "        }"
+$ WS "        if (!count) {"
+$ WS "          puts("""");"
+$ WS "          return 0;"
+$ WS "        }"
+$ WS "        fputs(""*"", stdout);"
+$ WS "      }"
+$ WS "    }"
+$ WS "    value *= 2;"
+$ WS "    ++count;"
+$ WS "  }"
+$ WS "  fprintf(stderr, ""Cannot overflow integer range, even at 2**%d 
(%.20f)\n"","
+$ WS "          count, (double) value);"
+$ WS "  return 1;"
+$ WS "}"
+$ CS
+$ GOSUB compile
+$ IF F$LENGTH(tmp) .GT. 0
+$ THEN
+$   IF F$EXTRACT(0,1,tmp) .EQS. "2"
+$   THEN
+$     echo "The largest integer your NVs can preserve is equal to ''tmp'"
+$     nv_overflows_integers_at = tmp
+$   ELSE
+$     echo "Cannot determine the largest integer value your NVs can hold, 
unexpected output"
+$     echo "''tmp'"
+$   ENDIF
+$ ELSE
+$   echo "Cannot determine the largest integer value your NVs can hold"
+$ ENDIF
+$!
 $! Check for signbit (must already know nvtype)
 $!
 $ echo4 "Checking to see if you have signbit() available to work on 
''nvtype'..."
@@ -5917,8 +5990,7 @@
 $ WC "d_nice='define'"
 $ WC "d_nl_langinfo='" + d_nl_langinfo + "'"
 $ WC "d_nv_preserves_uv='" + d_nv_preserves_uv + "'"
-$! Pending integrating the probe test
-$ WC "nv_overflows_integers_at='0'"
+$ WC "nv_overflows_integers_at='" + nv_overflows_integers_at + "'"
 $ WC "nv_preserves_uv_bits='" + nv_preserves_uv_bits + "'"
 $ WC "d_nv_zero_is_allbits_zero='define'"
 $ WC "d_off64_t='" + d_off64_t + "'"
@@ -6201,6 +6273,7 @@
 $ WC "i_sysmount='undef'"
 $ WC "i_sysndir='undef'"
 $ WC "i_sysparam='undef'"
+$ WC "i_syspoll='" + i_syspoll + "'"
 $ WC "i_sysresrc='undef'"
 $ WC "i_syssecrt='" + i_syssecrt + "'"
 $ WC "i_sysselct='undef'"

==== //depot/maint-5.10/perl/vms/vms.c#5 (text) ====
Index: perl/vms/vms.c
--- perl/vms/vms.c#4~33477~     2008-03-11 10:28:10.000000000 -0700
+++ perl/vms/vms.c      2008-05-20 16:11:00.000000000 -0700
@@ -2568,6 +2568,9 @@
        case RMS$_WLK:  /* Device write locked */
                unix_status = EACCES;
                break;
+       case RMS$_MKD:  /* Failed to mark for delete */
+               unix_status = EPERM;
+               break;
        /* case RMS$_NMF: */  /* No more files */
        }
     }
@@ -10423,7 +10426,7 @@
     if ((res = fflush(fp)) == 0 && fp) {
 #ifdef VMS_DO_SOCKETS
        Stat_t s;
-       if (fstat(fileno(fp), (stat_t *)&s) == 0 && !S_ISSOCK(s.st_mode))
+       if (fstat(fileno(fp), &s.crtl_stat) == 0 && !S_ISSOCK(s.st_mode))
 #endif
            res = fsync(fileno(fp));
     }
End of Patch.

Reply via email to