X-Git-Url: https://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=junkcode%2Frusty%40rustcorp.com.au-ntdb%2Ftest%2Flock-tracking.h;fp=junkcode%2Frusty%40rustcorp.com.au-ntdb%2Ftest%2Flock-tracking.h;h=f2c9c44653ba47a1e36605b46e037b6bc87fc1bb;hp=0000000000000000000000000000000000000000;hb=1aab74723e837a0fd8091e264a325bb2cdcdd0fa;hpb=979071e8587d4819a7f78613b68d29e222e5db63 diff --git a/junkcode/rusty@rustcorp.com.au-ntdb/test/lock-tracking.h b/junkcode/rusty@rustcorp.com.au-ntdb/test/lock-tracking.h new file mode 100644 index 00000000..f2c9c446 --- /dev/null +++ b/junkcode/rusty@rustcorp.com.au-ntdb/test/lock-tracking.h @@ -0,0 +1,25 @@ +#ifndef LOCK_TRACKING_H +#define LOCK_TRACKING_H +#include + +/* Set this if you want a callback after fnctl unlock. */ +extern void (*unlock_callback)(int fd); + +/* Replacement fcntl. */ +int fcntl_with_lockcheck(int fd, int cmd, ... /* arg */ ); + +/* Discard locking info: returns number of locks outstanding. */ +unsigned int forget_locking(void); + +/* Number of errors in locking. */ +extern int locking_errors; + +/* Suppress lock checking. */ +extern bool suppress_lockcheck; + +/* Make all locks non-blocking. */ +extern bool nonblocking_locks; + +/* Number of times we failed a lock because we made it non-blocking. */ +extern int locking_would_block; +#endif /* LOCK_TRACKING_H */