pkarashchenko commented on code in PR #10110:
URL: https://github.com/apache/nuttx/pull/10110#discussion_r1286779099
##########
arch/risc-v/src/esp32c3/esp32c3_libc_stubs.c:
##########
@@ -59,12 +60,12 @@ struct _reent;
int _close_r(struct _reent *r, int fd)
{
- return close(fd);
+ return nx_close(fd);
Review Comment:
The main difference is setting `errno` that should not be done when newlib
is called from kernel.
@gustavonihei do we expect that newlib stubs are called from the application
layer?
For the return codes we can go with
```
int _close_r(struct _reent *r, int fd)
{
if (nx_close(fd) < 0)
{
return ERROR;
}
return OK;
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]