jeudi 28 janvier 2016

Is there a system call for random numbers?

As everyone knows, if you want a truly random number (perhaps to pass to srand()), you open /dev/random or /dev/urandom and read a few bytes. But is there a lighter-weight way to do it, perhaps a system call?

[P.S. Yes, I know, opening and reading /dev/random isn't going to take very long, either. But I'm just wondering if there are other options.]




Aucun commentaire:

Enregistrer un commentaire