juniskane commented on pull request #2497: URL: https://github.com/apache/incubator-nuttx/pull/2497#issuecomment-741598652
> Please fix the low entropy case too: > https://github.com/apache/incubator-nuttx/pull/2497/files#diff-ee6b9d93e85a2c9b845acc6c4fdcef1c9cca9ee4166cadd7b15f889f221065e7L330 This patch fixes a real bug. The low entropy / API interface design discussion is a separate item not really related to this PR. > But, anyway this PR doesn't resolve the real problem, we should follow FreeBSD and Linux prototype: > https://man7.org/linux/man-pages/man2/getrandom.2.html > https://www.freebsd.org/cgi/man.cgi?query=getrandom&sektion=2&manpath=freebsd-release-ports > If we allow the contributor to modify the public function prototype, NuttX will lose the compability in the long run. Compatibility with what? getrandom() is Linux / Glibc specific non-portable interface not commonly used elsewhere. OpenBSD, NetBSD and Mac use arc4random() functions, which are also available for FreeBSD and Android (with a different name I recall) as well. > If you still insist to not change getrandom prototype to confirm the standard, I will create a patch remove it from the code base because it is a bad showcase which violate INVIOLABLES rule. getrandom() is a Linux / Glibc specific function. It is not part of any standard. What standard are you talking about? Please specify exact chapter and verse quatation from this (so far unknown) standard that specifies the prototype and behavior of getrandom(). Linux man pages are not a standard! Your prototype is not any more correct than the existing one. Which INVIOLABLES rule says that NuttX APIs must conform to Linux man pages? ---------------------------------------------------------------- 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