]> arthur.barton.de Git - netatalk.git/blobdiff - libatalk/compat/flock.c
massive commenting/autoconf changes
[netatalk.git] / libatalk / compat / flock.c
index 45ec45da14bc30dd33629c2c3670f3aef4e5aa32..1a7f644c9a3400f1ceed120bf96a35a0dfbeb5c1 100644 (file)
@@ -1,24 +1,35 @@
 /*
+ * $Id: flock.c,v 1.4 2001-06-29 14:14:46 rufustfirefly Exp $
+ *
  * Copyright (c) 1996 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
  */
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif /* HAVE_CONFIG_H */
+
 static int     _flock_dummy;
 
-# if defined( sun ) && defined( __svr4__ )
+#ifndef HAVE_FLOCK
 
 #include <sys/types.h>
+#ifdef HAVE_FCNTL_H
 #include <fcntl.h>
+#endif /* HAVE_FCNTL_H */
 #include <errno.h>
 
-#include </usr/ucbinclude/sys/file.h>
+#define LOCK_SH         1
+#define LOCK_EX         2
+#define LOCK_NB         4
+#define LOCK_UN         8
 
 int flock( fd, operation )
     int                fd;
     int                operation;
 {
-    flock_t    l;
-    int                rc, op;
+    struct flock       l;
+    int                        rc, op;
 
     if ( operation & LOCK_NB ) {
        op = F_SETLK;
@@ -49,4 +60,4 @@ int flock( fd, operation )
     }
     return( rc );
 }
-# endif sun __svr4__
+#endif /* !HAVE_FLOCK */