]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/basic/lockfile-util.h
d49251d266a7c437c628a32f278a4e11580bf0c8
[thirdparty/systemd.git] / src / basic / lockfile-util.h
1 /* SPDX-License-Identifier: LGPL-2.1+ */
2 #pragma once
3
4 /***
5 Copyright 2011 Lennart Poettering
6 ***/
7
8 #include <stddef.h>
9
10 #include "macro.h"
11 #include "missing.h"
12
13 typedef struct LockFile {
14 char *path;
15 int fd;
16 int operation;
17 } LockFile;
18
19 int make_lock_file(const char *p, int operation, LockFile *ret);
20 int make_lock_file_for(const char *p, int operation, LockFile *ret);
21 void release_lock_file(LockFile *f);
22
23 #define LOCK_FILE_INIT { .fd = -1, .path = NULL }