2 * $Id: flock.c,v 1.4 2001-06-29 14:14:46 rufustfirefly Exp $
4 * Copyright (c) 1996 Regents of The University of Michigan.
5 * All Rights Reserved. See COPYRIGHT.
10 #endif /* HAVE_CONFIG_H */
12 static int _flock_dummy;
16 #include <sys/types.h>
19 #endif /* HAVE_FCNTL_H */
27 int flock( fd, operation )
34 if ( operation & LOCK_NB ) {
40 if ( operation & LOCK_EX ) {
44 if ( operation & LOCK_SH ) {
48 if ( operation & LOCK_UN ) {
56 if (( rc = fcntl( fd, F_SETLK, &l )) < 0 ) {
57 if ( errno == EAGAIN || errno == EACCES ) {
63 #endif /* !HAVE_FLOCK */