fsautoproc
Basic file transformation automation management utility
Loading...
Searching...
No Matches
fl.h
Go to the documentation of this file.
1
3#ifndef FSAUTOPROC_FL_H
4#define FSAUTOPROC_FL_H
5
8struct flock_s {
9 const char* path;
10 int fd;
11 _Bool open;
12};
13
20#define flinit(fp) ((struct flock_s){.path = (fp), .fd = -1, .open = 0})
21
27int fllock(struct flock_s* fl);
28
33int flunlock(struct flock_s* fl);
34
35#endif//FSAUTOPROC_FL_H
int fllock(struct flock_s *fl)
Locks the file at the given path. If a file descriptor cannot be obtained, or the file cannot be lock...
Definition fl.c:25
int flunlock(struct flock_s *fl)
Unlocks the file at the given path. If the file is not open, or the file cannot be unlocked,...
Definition fl.c:32
File lock structure for managing a single file path.
Definition fl.h:8
const char * path
File path to lock.
Definition fl.h:9
int fd
File descriptor once opened.
Definition fl.h:10
_Bool open
Open status of the file.
Definition fl.h:11