diff options
author | aiju <devnull@localhost> | 2017-05-04 17:42:12 +0000 |
---|---|---|
committer | aiju <devnull@localhost> | 2017-05-04 17:42:12 +0000 |
commit | f681cf835af1e5c9e016e5245c24165b029a5e38 (patch) | |
tree | 43453c10a803a5e64b47dc3474e603715cd76bcc /sys/man/2 | |
parent | 414d29e98f8d5242cc68161e61b66b7171e96634 (diff) |
bio: add support for custom I/O handler via Biofn
Diffstat (limited to 'sys/man/2')
-rw-r--r-- | sys/man/2/bio | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/sys/man/2/bio b/sys/man/2/bio index ae8adf291..1f15cd76f 100644 --- a/sys/man/2/bio +++ b/sys/man/2/bio @@ -84,6 +84,9 @@ int Bbuffered(Biobufhdr *bp) .B void Blethal(Biobufhdr *bp, void (*errorf)(char *)) .PP +.B +void Biofn(Biobufhdr *bp, int (*iof)(Biohdr *, void *, long)) +.PP .SH DESCRIPTION These routines implement fast buffered I/O. I/O on different file descriptors is independent. @@ -338,6 +341,18 @@ to be called in case of an error happening on read/write. An argument of .B nil will have the program terminated in case of error. +.PP +If +.I Biofn +is called with a non-nil +.I iof +function, then that function is called for I/O in lieu of +.IR read (2) +and +.IR write (2). +A nil argument for +.I iof +restores normal behaviour. .SH SOURCE .B /sys/src/libbio .SH SEE ALSO |