/*
+ * $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;
}
return( rc );
}
-# endif sun __svr4__
+#endif /* !HAVE_FLOCK */