Use POSIX_FILE_LOCKS if _POSIX_VERSION is defined in unistd.h
authorTheodore Tso <tytso@mit.edu>
Fri, 14 Oct 1994 04:58:50 +0000 (04:58 +0000)
committerTheodore Tso <tytso@mit.edu>
Fri, 14 Oct 1994 04:58:50 +0000 (04:58 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@4510 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/kdb/ChangeLog
src/lib/kdb/configure.in
src/lib/kdb/kdb_dbm.c

index 03af33eabd766ac74b949beeca57af69fc4d5a0c..32aaa96d6b2a2af93af378642371d0613bdc2efc 100644 (file)
@@ -1,3 +1,10 @@
+Fri Oct 14 00:57:33 1994  Theodore Y. Ts'o  (tytso@dcl)
+
+       * configure.in: Add test for unistd.h
+
+       * lock_file.c: Use POSIX_FILE_LOCKS if _POSIX_VERSION is defined
+               in unistd.h
+
 Tue Oct  4 15:08:03 1994  Theodore Y. Ts'o  (tytso@dcl)
 
        * kdb_dbm.c (decode_princ_contents): Add backwards compatibility
index 3215f2cc5de0e01672b0626692301d3c98abb044..4bf1be7cb4d830d208f3345932b90411050ef037 100644 (file)
@@ -6,6 +6,7 @@ AC_PROG_ARCHIVE
 AC_PROG_ARCHIVE_ADD
 AC_PROG_RANLIB
 AC_PROG_INSTALL
+AC_HAVE_HEADERS(unistd.h)
 AppendRule([all:: libkdb5.a])
 KRB_INCLUDE
 WITH_KRB5ROOT
index b9cb8f3218b6d05114a4c3d2fe62c0cb0a1764a8..a8e3366bd0ff6903b4ef895fab4e507ade3b440a 100644 (file)
@@ -22,6 +22,9 @@
  * 
  */
 
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
 
 #include <krb5/krb5.h>
 #include <krb5/dbm.h>
 #include <sys/types.h>
 #include <utime.h>
 
+#ifdef _POSIX_VERSION
+ /* Is there a better way to decide whether or not we should use flock */
+ /* vs. fcntl.  Example: broken SunOS tmpfs.... */
+#define POSIX_FILE_LOCKS
+#endif
+
 #if defined (POSIX_FILE_LOCKS) && !defined(unicos61)
 #include <fcntl.h>
 #endif