- 
                Notifications
    
You must be signed in to change notification settings  - Fork 1.1k
 
Closed
Description
I'm using fwrite() to stdout to implement a protobuf message protocol for a project over USB CDC.
When I send enough data at once, some bytes are silently lost.
Either:
- there needs to be a way to properly check when data is being dropped rather than sent (the fwrite API already returns the number of bytes written, but it's improperly returned by the SDK)
 - there needs to be a blocking API created, that guarantees all data is sent
 - the current API needs to be made blocking until all data is sent
 
The obvious solution is to return the correct number of bytes to _write, and by extension fread.
Simply dropping data is not acceptable in nearly all applications, and there is no documentation on this, which led me to spend a frustrating amount of time debugging the issue. Nobody would reasonably expect this behavior for all but the simplest of text logging.
KubaO and maqifrnswa