lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

On 12/30/2015 06:14 PM, Roberto Ierusalimschy wrote:
Sorry to take so long to answer...

Nah. Thanks for replying.

So, the first question I have is: do you folks plan to use a
kernel-provided randomness source like 'arc4random()' (under
*BSD) or 'getrandom()' (under Linux)?

No. As already discussed in the list, these functions are quite new
and non portable.

I see.

The second question is: would you approve if FreeBSD package of
Lua was to patch 'luai_makeseed' into 'arc4random()'? I'm asking
this because I've been using such a patch locally for a while,
but FreeBSD Lua maintainers would like your approval before
adding it to the ports collection.

Sure. But I would implement them a little differently:

1) The best option seems to be Daurnimator's suggestion. I guess you
could solve the problem with the include like this:

     -D__BSD_VISIBLE  -DLUA_USER_H='<stdlib.h>'  \
     -D'luai_makeseed()=cast(unsigned int, arc4random())'

Yeah, thanks. This seems to work fine.

(Interestingly, __BSD_VISIBLE is only needed in lua53, not in lua52).