netatalk  4.6.0
Free and Open Source Apple Filing Protocol (AFP) Server
Loading...
Searching...
No Matches
peer_lock.h
Go to the documentation of this file.
1#ifndef PEER_LOCK_H
2#define PEER_LOCK_H
3
4#include <sys/types.h>
5
6/* A forked peer holding a byte-range lock on a path until released. */
7struct peer {
8 pid_t pid;
9 int to_child; /* parent writes 1 byte here to tell the peer to exit */
10 int from_child; /* peer writes 1 byte here once the lock is held */
11};
12
13extern int peer_hold_lock(struct peer *p, const char *path, short type,
14 off_t start, off_t len);
15extern void peer_release(struct peer *p);
16extern int peer_try_lock(const char *path, short type, off_t start,
17 off_t len);
18
19#endif /* PEER_LOCK_H */
int peer_hold_lock(struct peer *p, const char *path, short type, off_t start, off_t len)
Fork a peer that holds an fcntl lock until released.
Definition peer_lock.c:40
void peer_release(struct peer *p)
Release a held peer lock and reap the peer.
Definition peer_lock.c:117
int peer_try_lock(const char *path, short type, off_t start, off_t len)
Probe a lock range from a forked child.
Definition peer_lock.c:141
Definition include/atalk/directory.h:140
Definition peer_lock.h:7
int to_child
Definition peer_lock.h:9
pid_t pid
Definition peer_lock.h:8
int from_child
Definition peer_lock.h:10