netatalk
4.6.0
Free and Open Source Apple Filing Protocol (AFP) Server
Toggle main menu visibility
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. */
7
struct
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
13
extern
int
peer_hold_lock
(
struct
peer
*p,
const
char
*
path
,
short
type,
14
off_t start, off_t len);
15
extern
void
peer_release
(
struct
peer
*p);
16
extern
int
peer_try_lock
(
const
char
*
path
,
short
type, off_t start,
17
off_t len);
18
19
#endif
/* PEER_LOCK_H */
peer_hold_lock
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
peer_release
void peer_release(struct peer *p)
Release a held peer lock and reap the peer.
Definition
peer_lock.c:117
peer_try_lock
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
path
Definition
include/atalk/directory.h:140
peer
Definition
peer_lock.h:7
peer::to_child
int to_child
Definition
peer_lock.h:9
peer::pid
pid_t pid
Definition
peer_lock.h:8
peer::from_child
int from_child
Definition
peer_lock.h:10
test
afpd
peer_lock.h
Generated by
1.18.0