aboutsummaryrefslogtreecommitdiff
path: root/libutil/op_lockfile.h
blob: fcc269cf7df9d21703523de383ed7d1b9aad4482 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/**
 * @file op_lockfile.h
 * PID-based lockfile management
 *
 * @remark Copyright 2002 OProfile authors
 * @remark Read the file COPYING
 *
 * @author John Levon
 * @author Philippe Elie
 */

#ifndef OP_LOCKFILE_H
#define OP_LOCKFILE_H

#ifdef __cplusplus
extern "C" {
#endif

#include <sys/types.h>

/**
 * op_write_lock_file - write a lock file
 * \return errno on failure, or 0 on success
 *
 * Write the pid into the given lock file. Stale
 * lock files are detected and reset.
 */
int op_write_lock_file(char const * file);

#ifdef __cplusplus
}
#endif

#endif /* OP_LOCKFILE_H */