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

   > > i feel it involves too many `#ifdef`s in every applications.
   > > ```
   > > #if check config for /dev/random and/or /dev/urandom
   > > use getrandom
   > > #elif check config for arc4random_buf
   > > use arc4random_buf
   > > #else
   > > fallback or error
   > > #endif
   > > ```
   > 
   > Otherwise, you need if/else if, so I prefer to detect the error before 
running. For example, you may even not notice that: 
https://github.com/yamt/toywasm/blob/master/libwasi/wasi.c#L2452C12-L2452C12 
the above code mayn't work as expect if you forget to enable DEV_RANDOM or 
DEV_URANDOM. But with this patch, we can find and fix it.
   
   the cited code returns an error, doesn't it? at least it was my expectation.
   


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