X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Ffailtest%2Ffailtest.h;h=473f9e7950fa498e5d56a613353b049e69c82084;hb=5069685c5ec19f6d29cb0bd5eefd534c617119cc;hp=8aae82b352d007d81e94ba4c64104266107b2e92;hpb=f0002cb9e4f6f403a25ad50252c06694439900f0;p=ccan diff --git a/ccan/failtest/failtest.h b/ccan/failtest/failtest.h index 8aae82b3..473f9e79 100644 --- a/ccan/failtest/failtest.h +++ b/ccan/failtest/failtest.h @@ -2,6 +2,7 @@ #define CCAN_FAILTEST_H #include #include +#include #include /** @@ -38,6 +39,7 @@ enum failtest_call_type { FAILTEST_PIPE, FAILTEST_READ, FAILTEST_WRITE, + FAILTEST_FCNTL, }; struct calloc_call { @@ -67,10 +69,12 @@ struct open_call { struct pipe_call { int ret; int fds[2]; + bool closed[2]; }; struct read_call { ssize_t ret; + off_t off; int fd; void *buf; size_t count; @@ -81,6 +85,18 @@ struct write_call { int fd; const void *buf; size_t count; + off_t off; +}; + +struct fcntl_call { + int ret; + int fd; + int cmd; + union { + struct flock fl; + long l; + int i; + } arg; }; /** @@ -106,6 +122,8 @@ struct failtest_call { bool fail; /* What we set errno to. */ int error; + /* How do we clean this up? */ + void (*cleanup)(void *u); /* The actual call data. */ union { struct calloc_call calloc; @@ -115,6 +133,7 @@ struct failtest_call { struct pipe_call pipe; struct read_call read; struct write_call write; + struct fcntl_call fcntl; } u; };