patacongo commented on pull request #2497:
URL: https://github.com/apache/incubator-nuttx/pull/2497#issuecomment-740768984


   > We must therefore handle ECANCELED from nxsem_wait_uninterruptible() 
ourselves instead of silently returning without any random bytes.
   
   getrandom() is not a cancellation point and must not implement any 
cancellation point logic.  It should not use nxsem_wait_uninterruptible()  but 
should use something like nxsem_wait_noncancelable().  
nxsem_wait-noncancelable() has not been formalized but would simply ignore the 
ECANCELED error (as well as the EINTR error).
   
   In that case, getrandom would correctly ignore the cancellation request and 
simply call nxsem_wait() again.
   
    ECANCELED should only occur in the deferred cancellation mode.  In other 
modes, the task calling getrandom() will be terminated immediately with no 
return value. (I think anyway.  I haven't looked at the code in a long time).  
In the deferred cancellation mode, cancellation can only occur at a few 
cancellation points; getrandom() is not a cancellatoin point.
   
   


----------------------------------------------------------------
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.

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


Reply via email to