This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

_sys_read and the return value

I use _sys_read() in Retarget.c to wrap read functions of special file handles created.
In the manual (http://www.keil.com/support/man/docs/armlib/armlib_cihjhgbc.htm), it is written:
The return value is one of the following:
- The number of characters not read
- An error indication
- An EOF indicator

What exactly do I have to return, if I have an error and like to return an "error indication"?
I thought it would be -1. But this ends in a internal Keil-Library problem later on. I end up in a dead lock (not immediately, but after some other library operations).

Can someone help me? Thanks!
- Adrian

0