Adds pid file support.

This commit is contained in:
Andrea Mazzoleni 2013-06-17 23:50:26 +02:00
parent 875081f530
commit bc2a837953
8 changed files with 149 additions and 14 deletions

15
util.h
View file

@ -486,5 +486,20 @@ static inline oathash_t oathashm(oathash_t hash, const unsigned char* value, uns
return hash;
}
/****************************************************************************/
/* pid */
/**
* Creates and locks the pid file.
* Returns -1 on error, otherwise it's the file handle to pass to pid_unlock().
*/
int pid_lock(const char* file);
/**
* Unlocks the pid file.
* Returns -1 on error.
*/
int pid_unlock(int f, const char* file);
#endif