Mercurial > dropbear
diff fuzz-wrapfd.h @ 1740:dfbe947bdf0d fuzz
Make wrapfd share a common buffer for all FDs
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Thu, 15 Oct 2020 22:46:24 +0800 |
parents | e75dab5bec71 |
children | 97ad26e397a5 |
line wrap: on
line diff
--- a/fuzz-wrapfd.h Thu Oct 15 19:55:15 2020 +0800 +++ b/fuzz-wrapfd.h Thu Oct 15 22:46:24 2020 +0800 @@ -5,15 +5,13 @@ enum wrapfd_mode { UNUSED = 0, - PLAIN, - INPROGRESS, - RANDOMIN + COMMONBUF, // using the common buffer }; -void wrapfd_setup(void); +// buf is a common buffer read by all wrapped FDs. doesn't take ownership of buf +void wrapfd_setup(buffer *buf); void wrapfd_setseed(uint32_t seed); -// doesn't take ownership of buf. buf is optional. -void wrapfd_add(int fd, buffer *buf, enum wrapfd_mode mode); +int wrapfd_new(); // called via #defines for read/write/select int wrapfd_read(int fd, void *out, size_t count);