2016-09-06 17:08:46 +00:00
|
|
|
/**
|
2016-09-11 20:20:15 +00:00
|
|
|
* Author......: See docs/credits.txt
|
2016-09-06 17:08:46 +00:00
|
|
|
* License.....: MIT
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _LOCKING_H
|
|
|
|
#define _LOCKING_H
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
#include <errno.h>
|
|
|
|
#include <fcntl.h>
|
|
|
|
|
2016-09-07 20:29:57 +00:00
|
|
|
#if defined (F_SETLKW)
|
2016-09-06 17:08:46 +00:00
|
|
|
|
2016-10-09 20:41:55 +00:00
|
|
|
int lock_file (FILE *fp);
|
2016-09-06 17:08:46 +00:00
|
|
|
void unlock_file (FILE *fp);
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
2016-10-09 20:41:55 +00:00
|
|
|
#define lock_file(dummy) 0
|
|
|
|
#define unlock_file(dummy)
|
2016-09-06 17:08:46 +00:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif // _LOCKING_H
|