rem: stream->seekLow += stream->readEnd - stream->bufPtr + bytesWritten;
add: stream->seekLow += bytesWritten;
context: uio_fwrite(const void *buf, size_t size, size_t nmemb, uio_Stream *stream) {	ssize_t bytesToWrite;	ssize_t bytesWritten;	assert((stream->openFlags & O_ACCMODE) != O_RDONLY);	bytesToWrite = size * nmemb;	if (stream->writeStart == NULL)		stream->writeStart = stream->bufPtr;	if (bytesToWrite < stream->bufEnd - stream->bufPtr) {		// There's enough space in the write buffer to store everything.		memcpy(stream->bufPtr, buf, bytesToWrite);		stream->bufPtr += bytesToWrite;		return nmemb;	}	// Not enough space in the write buffer to write everything.	// Flush what's left in the write buffer, and then directly write 'buf'.	if (uio_Stream_flushWriteBuffer(stream) == -1) {		// errno is set		return 0;	}	bytesWritten = uio_write(stream->handle, buf, bytesToWrite);	if (bytesWritten != bytesToWrite) {		stream->status = uio_Stream_STATUS_ERROR;		if (bytesWritten == -1)			return 0;	}	stream->seekLow += stream->readEnd - stream->bufPtr + bytesWritten;	stream->readStart = stream->buf;	stream->bufPtr = stream->buf;	stream->readEnd = stream->buf;	stream->writeStart = NULL;	if (bytesWritten == bytesToWrite)		return nmemb;	return (size_t) bytesWritten / size;}