|
Put data in buffer.
- Parameters:
-
| data | A pointer to the data |
| len | Number of bytes to write |
| must_fit | Data must fit in buffer |
- Returns:
- Number of bytes written
This function tries to put new data in the circular buffer. It returns the number of bytes that actually got written, which may be < len. If must_fit is TRUE then there must be enough space available in the buffer to write the whole data block. When there's not enough room, 0 will be returned.
This function has an interesting side effect: when there are no readers, the buffer is never filled! |