~ubuntu-branches/ubuntu/oneiric/daemontools/oneiric

« back to all changes in this revision

Viewing changes to daemontools-0.76/src/lock_exnb.c

  • Committer: Bazaar Package Importer
  • Author(s): Gerrit Pape
  • Date: 2008-04-16 21:20:38 UTC
  • Revision ID: james.westby@ubuntu.com-20080416212038-2ix54o7w5m8lpvni
Tags: upstream-0.76
ImportĀ upstreamĀ versionĀ 0.76

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Public domain. */
 
2
 
 
3
#include <sys/types.h>
 
4
#include <sys/file.h>
 
5
#include <fcntl.h>
 
6
#include "hasflock.h"
 
7
#include "lock.h"
 
8
 
 
9
#ifdef HASFLOCK
 
10
int lock_exnb(int fd) { return flock(fd,LOCK_EX | LOCK_NB); }
 
11
#else
 
12
int lock_exnb(int fd) { return lockf(fd,2,0); }
 
13
#endif