#include <sys/types.h>Go to the source code of this file.
Data Structures | |
| struct | peer |
Functions | |
| 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. | |
| void | peer_release (struct peer *p) |
| Release a held peer lock and reap the peer. | |
| int | peer_try_lock (const char *path, short type, off_t start, off_t len) |
| Probe a lock range from a forked child. | |
|
extern |
Fork a peer that holds an fcntl lock until released.
F_SETLK/F_GETLK never conflict with or report the calling process's own locks, so a test that needs a genuinely contending lock forks a peer that takes it and parks.
| [out] | p | filled with the peer's pid and control pipes |
| [in] | path | file to lock |
| [in] | type | F_RDLCK or F_WRLCK |
| [in] | start | first byte of the range |
| [in] | len | range length (0 = to EOF) |
|
extern |
Release a held peer lock and reap the peer.
| [in] | p | peer filled by peer_hold_lock() |
|
extern |
Probe a lock range from a forked child.
Cross-process, so it sees locks this process holds (which its own F_GETLK never would).
| [in] | path | file to probe |
| [in] | type | F_RDLCK or F_WRLCK |
| [in] | start | first byte of the range |
| [in] | len | range length (0 = to EOF) |