Hello, we're getting the hang of embedded linux, and we have a call to the POSIX command (in unistd.h) "write" that sometimes returns -1 indicating failure, and we have no idea why (happen to be writing to a USB port).
So I did a little digging and found that a lot of these POSIX commands set something called errno when they fail, which appears to be a centralized error code, which seemed like something we could use. We included "errno.h" and set the errno to zero before the call that sometimes fails, and then after it fails it is set to 11.
So trying to figure out what that means, consulted this link:
which actually doesn't have an 11, so I assumed that it means 3011, which sorta fits because it is ESTDOUT "The stdout stream cannot be opened.", not very useful but the right direction. However, consulting this page:
does NOT list ESTDOUT as one of the possible errnos.
* are we misinterpreting our value of ESTDOUT?
* does that error make sense for the write command
* why would the write command intermittently fail to a USB port?
Thanks very much for any insight!