yamt commented on PR #16742:
URL: https://github.com/apache/nuttx/pull/16742#issuecomment-3116238071

   > > > This commit disable interrupts before and after host-APIs, make sure 
that errno is correct.
   > 
   > the interrupt must be disabled, since many host API can't work well if the 
interrupt happen in side their function.
   > 
   > > i feel this approach is very hard to maintain.
   > > it's simpler (and probably more efficient) to save/restore errno in the 
"interrupts" instead. what do you think?
   > 
   > your mean restore errno before enabling interrupt? It doesn't work since 
host main thread manage all nuttx thread and errno will lose if another nuttx 
thread switch in and call some host api which may overwrite the errno value 
before old thread has the chance to retrieve it.
   
   i meant to save/restore in interrupt handlers.
   as you know, it's a common practice for unix to save/restore errno in signal 
handlers.
   i don't see any reason it doesn't work for sim.
   


-- 
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: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to