File: buffer_flush.3

package info (click to toggle)
libowfat 0.27-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 3,412 kB
  • ctags: 1,147
  • sloc: ansic: 12,294; makefile: 42
file content (27 lines) | stat: -rw-r--r-- 1,041 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
.TH buffer_flush 3
.SH NAME
buffer_flush \- feed buffer to write function
.SH SYNTAX
.B #include <buffer.h>

int \fBbuffer_flush\fP(buffer* \fIb\fR);
.SH DESCRIPTION
buffer_flush feeds a string \fId\fR[0], \fId\fR[1], ...,
\fId\fR[\fIdlen\fR-1] to the write operation by calling

  \fBop\fR(\fIfd\fR,\fId\fR,\fIdlen\fR)

If \fBop\fR successfully handles one or more bytes at the beginning of
the string, it must return the number of bytes handled; if this number
is smaller than \fIdlen\fR, buffer_flush will call \fBop\fR again with
the rest of the string. If \fBop\fR does not handle any bytes, and does
not encounter an error, it must return 0, or return -1 with \fIerrno\fR
set to EINTR; in either case, buffer_flush will immediately call \fBop\fR
again. If \fBop\fR encounters an error, it must return -1 with errno set to
something other than EINTR; buffer_flush will pass the error to the
caller.

On success, buffer_flush returns 0. On error, buffer_flush returns -1,
setting \fIerrno\fR appropriately.
.SH "SEE ALSO"
buffer_init(3)