summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Dougherty <doughera@lafayette.edu>2000-11-03 10:32:14 -0500
committerJarkko Hietaniemi <jhi@iki.fi>2000-11-04 00:20:02 +0000
commit9d9004a9b2b7cfeace32230c040f124d0607259a (patch)
tree0cf651529d27bf0a78abd5481bed14f31785ca39
parenta318903f974eb7986b0c4d33f6d08004a0b9b551 (diff)
downloadperl-9d9004a9b2b7cfeace32230c040f124d0607259a.tar.gz
Add FCNTL_CAN_LOCK.
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
-rwxr-xr-xConfigure52
-rw-r--r--Porting/Glossary4
-rw-r--r--Porting/config.sh5
-rw-r--r--Porting/config_H9
-rw-r--r--config_h.SH7
-rw-r--r--epoc/config.sh1
-rw-r--r--pp_sys.c2
-rw-r--r--uconfig.h7
-rwxr-xr-xuconfig.sh1
-rw-r--r--vos/config.alpha.def1
-rw-r--r--vos/config.alpha.h7
-rw-r--r--vos/config.ga.def1
-rw-r--r--vos/config.ga.h7
-rw-r--r--win32/config.bc1
-rw-r--r--win32/config.gc1
-rw-r--r--win32/config.vc1
16 files changed, 102 insertions, 5 deletions
diff --git a/Configure b/Configure
index ec9f940d5c..89df03f37f 100755
--- 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'
diff --git a/Porting/Glossary b/Porting/Glossary
index 40e468d56a..3c51bef7b6 100644
--- a/Porting/Glossary
+++ b/Porting/Glossary
@@ -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
diff --git a/Porting/config.sh b/Porting/config.sh
index 2c9a49e235..46f5d20174 100644
--- a/Porting/config.sh
+++ b/Porting/config.sh
@@ -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'
diff --git a/Porting/config_H b/Porting/config_H
index 3cbfeaebf9..4cc858bb63 100644
--- a/Porting/config_H
+++ b/Porting/config_H
@@ -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
*/
@@ -3184,4 +3184,11 @@
#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
diff --git a/config_h.SH b/config_h.SH
index e34d920718..a6306274db 100644
--- a/config_h.SH
+++ b/config_h.SH
@@ -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!
diff --git a/epoc/config.sh b/epoc/config.sh
index e760d671cf..8c37c58df6 100644
--- a/epoc/config.sh
+++ b/epoc/config.sh
@@ -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'
diff --git a/pp_sys.c b/pp_sys.c
index 28ffcda5e1..239e3f79bb 100644
--- 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,...) */
diff --git a/uconfig.h b/uconfig.h
index 67cc252e2b..c67806a3bb 100644
--- a/uconfig.h
+++ b/uconfig.h
@@ -3180,4 +3180,11 @@
/*#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
diff --git a/uconfig.sh b/uconfig.sh
index eb8e052437..d2671154b5 100755
--- a/uconfig.sh
+++ b/uconfig.sh
@@ -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'
diff --git a/vos/config.alpha.def b/vos/config.alpha.def
index 84e1e0e108..c14b9ce3ea 100644
--- a/vos/config.alpha.def
+++ b/vos/config.alpha.def
@@ -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'
diff --git a/vos/config.alpha.h b/vos/config.alpha.h
index 30463bef9e..0b264db3f2 100644
--- a/vos/config.alpha.h
+++ b/vos/config.alpha.h
@@ -165,6 +165,13 @@
*/
#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().
diff --git a/vos/config.ga.def b/vos/config.ga.def
index c6ab96b1f6..f88060fd2a 100644
--- a/vos/config.ga.def
+++ b/vos/config.ga.def
@@ -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'
diff --git a/vos/config.ga.h b/vos/config.ga.h
index ae5cf93129..d09b89b5fd 100644
--- a/vos/config.ga.h
+++ b/vos/config.ga.h
@@ -165,6 +165,13 @@
*/
#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().
diff --git a/win32/config.bc b/win32/config.bc
index afc148c252..f7ade892ab 100644
--- a/win32/config.bc
+++ b/win32/config.bc
@@ -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'
diff --git a/win32/config.gc b/win32/config.gc
index b196486825..197282db22 100644
--- a/win32/config.gc
+++ b/win32/config.gc
@@ -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'
diff --git a/win32/config.vc b/win32/config.vc
index 071b4649ec..340080e616 100644
--- a/win32/config.vc
+++ b/win32/config.vc
@@ -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'