Add FCNTL_CAN_LOCK.
authorAndy Dougherty <doughera@lafayette.edu>
Fri, 3 Nov 2000 15:32:14 +0000 (10:32 -0500)
committerJarkko Hietaniemi <jhi@iki.fi>
Sat, 4 Nov 2000 00:20:02 +0000 (00:20 +0000)
Subject: Re: [ID 20001030.011] Not OK: perl v5.7.0 +DEVEL7481 on VMS_AXP V7.1 (UNINSTALLED)
Message-ID: <Pine.SOL.4.10.10011031528090.29-100000@maxwell.phys.lafayette.edu>

Subject: Re: [ID 20001030.011] Not OK: perl v5.7.0 +DEVEL7481 on VMS_AXP V7.1 (UNINSTALLED)
From: Andy Dougherty <doughera@lafayette.edu>
In-Reply-To: <4.3.1.0.20001031222203.00b24b20@pop5.banet.net>
Message-ID: <Pine.SOL.4.10.10011031532170.29-100000@maxwell.phys.lafayette.edu>

p4raw-id: //depot/perl@7536

16 files changed:
Configure
Porting/Glossary
Porting/config.sh
Porting/config_H
config_h.SH
epoc/config.sh
pp_sys.c
uconfig.h
uconfig.sh
vos/config.alpha.def
vos/config.alpha.h
vos/config.ga.def
vos/config.ga.h
win32/config.bc
win32/config.gc
win32/config.vc

index ec9f940..89df03f 100755 (executable)
--- a/Configure
+++ b/Configure
@@ -20,7 +20,7 @@
 
 # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
 #
-# Generated on Wed Nov  1 16:26:50 EET 2000 [metaconfig 3.0 PL70]
+# Generated on Sat Nov  4 01:58:40 EET 2000 [metaconfig 3.0 PL70]
 # (with additional metaconfig patches by perlbug@perl.org)
 
 cat >/tmp/c1$$ <<EOF
@@ -348,6 +348,7 @@ d_endsent=''
 d_fchmod=''
 d_fchown=''
 d_fcntl=''
+d_fcntl_can_lock=''
 d_fd_macros=''
 d_fd_set=''
 d_fds_bits=''
@@ -8848,6 +8849,54 @@ eval $inlibc
 set fcntl d_fcntl
 eval $inlibc
 
+echo " "
+: See if fcntl-based locking works.
+$cat >try.c <<'EOCP'
+#include <stdlib.h>
+#include <unistd.h>
+#include <fcntl.h>
+int main() {
+#if defined(F_SETLK) && defined(F_SETLKW)
+     struct flock flock;
+     int retval, fd;
+     fd = open("try.c", O_RDONLY);
+     flock.l_type = F_RDLCK;
+     flock.l_whence = SEEK_SET;
+     flock.l_start = flock.l_len = 0;
+     retval = fcntl(fd, F_SETLK, &flock);
+     close(fd);
+     (retval < 0 ? exit(2) : exit(0));
+#else
+     exit(2);
+#endif
+}
+EOCP
+echo "Checking if fcntl-based file locking works... "
+case "$d_fcntl" in
+"$define")
+       set try
+       if eval $compile_ok; then
+               if ./try; then
+                       echo "Yes, it seems to work."
+                       val="$define"
+               else
+                       echo "Nope, it didn't work."
+                       val="$undef"
+               fi
+       else
+               echo "I'm unable to compile the test program, so I'll assume not."
+               val="$undef"
+       fi
+       ;;
+*) val="$undef";
+       echo "Nope, since you don't even have fcntl()."
+       ;;
+esac
+set d_fcntl_can_lock
+eval $setvar
+$rm -f try*
+
+
 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
 while $test $# -ge 2; do
        case "$1" in
@@ -15470,6 +15519,7 @@ d_eunice='$d_eunice'
 d_fchmod='$d_fchmod'
 d_fchown='$d_fchown'
 d_fcntl='$d_fcntl'
+d_fcntl_can_lock='$d_fcntl_can_lock'
 d_fd_macros='$d_fd_macros'
 d_fd_set='$d_fd_set'
 d_fds_bits='$d_fds_bits'
index 40e468d..3c51bef 100644 (file)
@@ -545,6 +545,10 @@ d_fcntl (d_fcntl.U):
        This variable conditionally defines the HAS_FCNTL symbol, and indicates
        whether the fcntl() function exists
 
+d_fcntl_can_lock (d_fcntl_can_lock.U):
+       This variable conditionally defines the FCNTL_CAN_LOCK symbol
+       and indicates whether file locking with fcntl() works.
+
 d_fd_macros (d_fd_set.U):
        This variable contains the eventual value of the HAS_FD_MACROS symbol,
        which indicates if your C compiler knows about the macros which
index 2c9a49e..46f5d20 100644 (file)
@@ -8,7 +8,7 @@
 
 # Package name      : perl5
 # Source directory  : /m/fs/work/work/permanent/perl/pp4/perl
-# Configuration time: Tue Oct 24 21:07:39 EET DST 2000
+# Configuration time: Sat Nov  4 02:04:31 EET 2000
 # Configured by     : jhi
 # Target system     : osf1 alpha.hut.fi v4.0 878 alpha 
 
@@ -62,7 +62,7 @@ ccsymbols='__alpha=1 __LANGUAGE_C__=1 __osf__=1 __unix__=1 _LONGLONG=1 _SYSTYPE_
 ccversion='V5.6-082'
 cf_by='jhi'
 cf_email='yourname@yourhost.yourplace.com'
-cf_time='Tue Oct 24 21:07:39 EET DST 2000'
+cf_time='Sat Nov  4 02:04:31 EET 2000'
 charsize='1'
 chgrp=''
 chmod=''
@@ -145,6 +145,7 @@ d_eunice='undef'
 d_fchmod='define'
 d_fchown='define'
 d_fcntl='define'
+d_fcntl_can_lock='define'
 d_fd_macros='define'
 d_fd_set='define'
 d_fds_bits='define'
index 3cbfeae..4cc858b 100644 (file)
@@ -17,7 +17,7 @@
 /*
  * Package name      : perl5
  * Source directory  : /m/fs/work/work/permanent/perl/pp4/perl
- * Configuration time: Tue Oct 24 21:07:39 EET DST 2000
+ * Configuration time: Sat Nov  4 02:04:31 EET 2000
  * Configured by     : jhi
  * Target system     : osf1 alpha.hut.fi v4.0 878 alpha 
  */
 #define HAS_SETPGRP            /**/
 #define USE_BSD_SETPGRP        /**/
 
+/* FCNTL_CAN_LOCK:
+ *     This symbol, if defined, indicates that fcntl() can be used
+ *     for file locking.  Normally on Unix systems this is defined.
+ *     It may be undefined on VMS.
+ */
+#define FCNTL_CAN_LOCK         /**/
+
 #endif
index e34d920..a630627 100644 (file)
@@ -3204,5 +3204,12 @@ sed <<!GROK!THIS! >$CONFIG_H -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un
 #$d_setpgrp HAS_SETPGRP                /**/
 #$d_bsdsetpgrp USE_BSD_SETPGRP /**/
 
+/* FCNTL_CAN_LOCK:
+ *     This symbol, if defined, indicates that fcntl() can be used
+ *     for file locking.  Normally on Unix systems this is defined.
+ *     It may be undefined on VMS.
+ */
+#$d_fcntl_can_lock FCNTL_CAN_LOCK              /**/
+
 #endif
 !GROK!THIS!
index e760d67..8c37c58 100644 (file)
@@ -138,6 +138,7 @@ d_eunice='undef'
 d_fchmod='undef'
 d_fchown='undef'
 d_fcntl='undef'
+d_fcntl_can_lock='undef'
 d_fd_macros='undef'
 d_fd_set='define'
 d_fds_bits='undef'
index 28ffcda..239e3f7 100644 (file)
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -150,7 +150,7 @@ extern int h_errno;
 #    include <fcntl.h>
 #  endif
 
-#  if defined(HAS_FCNTL) && defined(F_SETLK) && defined (F_SETLKW)
+#  if defined(HAS_FCNTL) && defined(FCNTL_CAN_LOCK)
 #    define FLOCK fcntl_emulate_flock
 #    define FCNTL_EMULATE_FLOCK
 #  else /* no flock() or fcntl(F_SETLK,...) */
index 67cc252..c67806a 100644 (file)
--- a/uconfig.h
+++ b/uconfig.h
 /*#define HAS_SETPGRP          / **/
 /*#define USE_BSD_SETPGRP      / **/
 
+/* FCNTL_CAN_LOCK:
+ *     This symbol, if defined, indicates that fcntl() can be used
+ *     for file locking.  Normally on Unix systems this is defined.
+ *     It may be undefined on VMS.
+ */
+/*#define FCNTL_CAN_LOCK               / **/
+
 #endif
index eb8e052..d267115 100755 (executable)
@@ -76,6 +76,7 @@ d_eunice='undef'
 d_fchmod='undef'
 d_fchown='undef'
 d_fcntl='undef'
+d_fcntl_can_lock='undef'
 d_fd_macros='undef'
 d_fd_set='undef'
 d_fds_bits='undef'
index 84e1e0e..c14b9ce 100644 (file)
@@ -58,6 +58,7 @@ $d_eofnblk='define'
 $d_fchmod='define'
 $d_fchown='undef'
 $d_fcntl='define'
+$d_fcntl_can_lock='define'
 $d_fd_set='undef'
 $d_fgetpos='define'
 $d_flexfnam='define'
index 30463be..0b264db 100644 (file)
  */
 #define HAS_FCNTL              /**/
 
+/* FCNTL_CAN_LOCK:
+ *     This symbol, if defined, indicates that fcntl() can be used
+ *     for file locking.  Normally on Unix systems this is defined.
+ *     It may be undefined on VMS.
+ */
+#define FCNTL_CAN_LOCK         /**/
+
 /* HAS_FGETPOS:
  *     This symbol, if defined, indicates that the fgetpos routine is
  *     available to get the file position indicator, similar to ftell().
index c6ab96b..f88060f 100644 (file)
@@ -58,6 +58,7 @@ $d_eofnblk='define'
 $d_fchmod='define'
 $d_fchown='undef'
 $d_fcntl='define'
+$d_fcntl_can_lock='define'
 $d_fd_set='undef'
 $d_fgetpos='define'
 $d_flexfnam='define'
index ae5cf93..d09b89b 100644 (file)
  */
 #define HAS_FCNTL              /**/
 
+/* FCNTL_CAN_LOCK:
+ *     This symbol, if defined, indicates that fcntl() can be used
+ *     for file locking.  Normally on Unix systems this is defined.
+ *     It may be undefined on VMS.
+ */
+#define FCNTL_CAN_LOCK         /**/
+
 /* HAS_FGETPOS:
  *     This symbol, if defined, indicates that the fgetpos routine is
  *     available to get the file position indicator, similar to ftell().
index afc148c..f7ade89 100644 (file)
@@ -129,6 +129,7 @@ d_eunice='undef'
 d_fchmod='undef'
 d_fchown='undef'
 d_fcntl='undef'
+d_fcntl_can_lock='undef'
 d_fd_macros='define'
 d_fd_set='define'
 d_fds_bits='define'
index b196486..197282d 100644 (file)
@@ -129,6 +129,7 @@ d_eunice='undef'
 d_fchmod='undef'
 d_fchown='undef'
 d_fcntl='undef'
+d_fcntl_can_lock='undef'
 d_fd_macros='define'
 d_fd_set='define'
 d_fds_bits='define'
index 071b464..340080e 100644 (file)
@@ -129,6 +129,7 @@ d_eunice='undef'
 d_fchmod='undef'
 d_fchown='undef'
 d_fcntl='undef'
+d_fcntl_can_lock='undef'
 d_fd_macros='define'
 d_fd_set='define'
 d_fds_bits='define'