libbio: add aux pointer to bio

This allows us to attach additional context
to the biobuf so can read from some sort of
data structure without a global variable.
This commit is contained in:
Ori Bernstein 2020-11-01 11:42:54 -08:00
parent b5086c1863
commit dbd54342fd
2 changed files with 12 additions and 1 deletions

View file

@ -34,6 +34,7 @@ struct Biobufhdr
uchar* gbuf; /* pointer to good data in buf */
void (*errorf)(char *); /* called on error if not nil */
int (*iof)(Biobufhdr*, void *, long); /* called to do i/o */
void *aux; /* user data */
};
struct Biobuf