juniskane commented on pull request #2497: URL: https://github.com/apache/incubator-nuttx/pull/2497#issuecomment-740781248
> > 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). Note that there are other places in the OS that use similar loop than here, consider fs/aio/aio_initialize.c: aioc_free() function, which calls aio_lock(), which calls nxsem_wait_uninterruptible() internally. Maybe some future commit will change all these to nxsem_wait_noncancelable()? Except that aio_lock() has additional logic for recursive locking -> not immediately obvious how to refactor it. ---------------------------------------------------------------- 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