1 /* $NetBSD: myflock.h,v 1.3 2020/03/18 19:05:21 christos Exp $ */ 2 3 #ifndef _MYFLOCK_H_INCLUDED_ 4 #define _MYFLOCK_H_INCLUDED_ 5 6 /*++ 7 /* NAME 8 /* myflock 3h 9 /* SUMMARY 10 /* lock open file 11 /* SYNOPSIS 12 /* #include <myflock.h> 13 /* DESCRIPTION 14 /* .nf 15 16 /* 17 * External interface. 18 */ 19 extern int WARN_UNUSED_RESULT myflock(int, int, int); 20 21 /* 22 * Lock styles. 23 */ 24 #define MYFLOCK_STYLE_FLOCK 1 25 #define MYFLOCK_STYLE_FCNTL 2 26 27 /* 28 * Lock request types. 29 */ 30 #define MYFLOCK_OP_NONE 0 31 #define MYFLOCK_OP_SHARED 1 32 #define MYFLOCK_OP_EXCLUSIVE 2 33 #define MYFLOCK_OP_NOWAIT 4 34 35 #define MYFLOCK_OP_BITS \ 36 (MYFLOCK_OP_SHARED | MYFLOCK_OP_EXCLUSIVE | MYFLOCK_OP_NOWAIT) 37 38 /* LICENSE 39 /* .ad 40 /* .fi 41 /* The Secure Mailer license must be distributed with this software. 42 /* AUTHOR(S) 43 /* Wietse Venema 44 /* IBM T.J. Watson Research 45 /* P.O. Box 704 46 /* Yorktown Heights, NY 10598, USA 47 /* 48 /* Wietse Venema 49 /* Google, Inc. 50 /* 111 8th Avenue 51 /* New York, NY 10011, USA 52 /*--*/ 53 54 #endif 55