From: Craig A. Berry Date: Mon, 6 Nov 2000 23:45:30 +0000 (-0500) Subject: configure.com and st-lock.t changes for X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c44c482642024dcc060fbe4eb4461ec18af07e2d;p=p5sagit%2Fp5-mst-13.2.git configure.com and st-lock.t changes for Message-Id: <0011079735.AA973576259@univpress.com> p4raw-id: //depot/perl@7589 --- diff --git a/configure.com b/configure.com index 8063bb6..46867e2 100644 --- a/configure.com +++ b/configure.com @@ -3476,6 +3476,54 @@ $ tmp = "fcntl" $ GOSUB inlibc $ d_fcntl = tmp $! +$! Check for fcntl locking capability +$! +$ echo4 "Checking if fcntl-based file locking works... " +$ tmp = "undef" +$ IF d_fcntl .EQS. "define" +$ THEN +$ OS +$ WS "#include " +$ WS "#if defined(__DECC) || defined(__DECCXX)" +$ WS "#include " +$ WS "#endif" +$ WS "#include " +$ WS "#include " +$ WS "int main() {" +$ WS "#if defined(F_SETLK) && defined(F_SETLKW)" +$ WS " struct flock flock;" +$ WS " int retval, fd;" +$ WS " fd = open(""try.c"", O_RDONLY);" +$ WS " flock.l_type = F_RDLCK;" +$ WS " flock.l_whence = SEEK_SET;" +$ WS " flock.l_start = flock.l_len = 0;" +$ WS " retval = fcntl(fd, F_SETLK, &flock);" +$ WS " close(fd);" +$ WS " (retval < 0 ? printf(""undef\n"") : printf(""define\n""));" +$ WS "#else" +$ WS " printf(""undef\n"");" +$ WS "#endif" +$ WS "}" +$ CS +$ GOSUB link_ok +$ IF compile_status .EQ. good_compile .AND. link_status .EQ. good_link +$ THEN +$ GOSUB just_mcr_it +$ IF tmp .EQS. "define" +$ THEN +$ echo4 "Yes, it seems to work." +$ ELSE +$ echo4 "Nope, it didn't work." +$ ENDIF +$ ELSE +$ echo4 "I'm unable to compile the test program, so I'll assume not." +$ tmp = "undef" +$ ENDIF +$ ELSE +$ echo4 "Nope, since you don't even have fcntl()." +$ ENDIF +$ d_fcntl_can_lock = tmp +$! $! Check for memchr $! $ OS diff --git a/t/lib/st-lock.t b/t/lib/st-lock.t index c29d0b7..694db16 100644 --- a/t/lib/st-lock.t +++ b/t/lib/st-lock.t @@ -25,7 +25,9 @@ sub BEGIN { print "1..0 # Skip: Storable was not built\n"; exit 0; } - if (!$Config{'d_flock'} && !$Config{'d_fcntl'} && !$Config{'d_lockf'}) { + if (!$Config{'d_flock'} && + !$Config{'d_fcntl_can_lock'} && + !$Config{'d_lockf'}) { print "1..0 # Skip: no flock or flock emulation on this platform\n"; exit 0; }