From: Andy Dougherty Date: Fri, 3 Nov 2000 15:32:14 +0000 (-0500) Subject: Add FCNTL_CAN_LOCK. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9d9004a9b2b7cfeace32230c040f124d0607259a;p=p5sagit%2Fp5-mst-13.2.git Add FCNTL_CAN_LOCK. Subject: Re: [ID 20001030.011] Not OK: perl v5.7.0 +DEVEL7481 on VMS_AXP V7.1 (UNINSTALLED) Message-ID: Subject: Re: [ID 20001030.011] Not OK: perl v5.7.0 +DEVEL7481 on VMS_AXP V7.1 (UNINSTALLED) From: Andy Dougherty In-Reply-To: <4.3.1.0.20001031222203.00b24b20@pop5.banet.net> Message-ID: p4raw-id: //depot/perl@7536 --- diff --git a/Configure b/Configure index ec9f940..89df03f 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$$ <try.c <<'EOCP' +#include +#include +#include +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 40e468d..3c51bef 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 2c9a49e..46f5d20 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 3cbfeae..4cc858b 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 e34d920..a630627 100644 --- a/config_h.SH +++ b/config_h.SH @@ -3204,5 +3204,12 @@ sed <$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 e760d67..8c37c58 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 28ffcda..239e3f7 100644 --- a/pp_sys.c +++ b/pp_sys.c @@ -150,7 +150,7 @@ extern int h_errno; # include # 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 67cc252..c67806a 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 eb8e052..d267115 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 84e1e0e..c14b9ce 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 30463be..0b264db 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 c6ab96b..f88060f 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 ae5cf93..d09b89b 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 afc148c..f7ade89 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 b196486..197282d 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 071b464..340080e 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'