* Do not define _BSD_SOURCE but define _DEFAULT_SOURCE instead.
[alpine.git] / imap / src / osdep / unix / flockcyg.h
blob0bc536235d6f4e8f2fd25f10b18ad7eb799862fb
1 /* ========================================================================
2 * Copyright 1988-2006 University of Washington
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
11 * ========================================================================
15 * Program: flock() emulation via fcntl() locking
17 * Author: Mark Crispin
18 * Networks and Distributed Computing
19 * Computing & Communications
20 * University of Washington
21 * Administration Building, AG-44
22 * Seattle, WA 98195
23 * Internet: MRC@CAC.Washington.EDU
25 * Date: 10 April 2001
26 * Last Edited: 30 August 2006
29 /* Cygwin does not seem to have the design flaw in fcntl() locking that
30 * most other systems do (see flocksim.c for details). If some cretin
31 * decides to implement that design flaw, then Cygwin will have to use
32 * flocksim. Also, we don't test NFS either
36 #define flock flocksim /* use ours instead of theirs */
38 #undef LOCK_SH
39 #define LOCK_SH 1 /* shared lock */
40 #undef LOCK_EX
41 #define LOCK_EX 2 /* exclusive lock */
42 #undef LOCK_NB
43 #define LOCK_NB 4 /* no blocking */
44 #undef LOCK_UN
45 #define LOCK_UN 8 /* unlock */
48 /* Function prototypes */
50 int flocksim (int fd,int operation);