summaryrefslogtreecommitdiff
path: root/configure.com
diff options
context:
space:
mode:
authorCraig A. Berry <craigberry@mac.com>2000-11-06 18:45:30 -0500
committerJarkko Hietaniemi <jhi@iki.fi>2000-11-07 12:56:39 +0000
commitc44c482642024dcc060fbe4eb4461ec18af07e2d (patch)
tree1cfd674246b43b9ed0f449335c8924396b5f1e98 /configure.com
parentf91328b77ca256011ef4b589e0aec2eb124e44ec (diff)
downloadperl-c44c482642024dcc060fbe4eb4461ec18af07e2d.tar.gz
configure.com and st-lock.t changes for
Message-Id: <0011079735.AA973576259@univpress.com> p4raw-id: //depot/perl@7589
Diffstat (limited to 'configure.com')
-rw-r--r--configure.com48
1 files changed, 48 insertions, 0 deletions
diff --git a/configure.com b/configure.com
index 8063bb6a8e..46867e2b8d 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 <stdio.h>"
+$ WS "#if defined(__DECC) || defined(__DECCXX)"
+$ WS "#include <stdlib.h>"
+$ WS "#endif"
+$ WS "#include <fcntl.h>"
+$ WS "#include <unistd.h>"
+$ 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