3 ms·
getline is POSIX, but not C. I feel like the functionality is so fundamental to writing C as securely as the language allows that it ought to be promoted to bei
by beefhash 8y ago
getline is POSIX, but not C. I feel like the functionality is so fundamental to writing C as securely as the language allows that it ought to be promoted to being in the C standard.
arc4random is in complete POSIX limbo as far as I can tell. First started as a rename to posix_random[1] and then OpenBSD slammed the door shut by withdrawing it and now we're at risk of getting the worst of both worlds with Linux's getrandom[2].
[1] http://austingroupbugs.net/view.php?id=859 http://austingroupbugs.net/view.php?id=859
[2] http://austingroupbugs.net/view.php?id=1134 http://austingroupbugs.net/view.php?id=1134
- xxpor 8y agoHow does getline work when you don't have FILE?
- beefhash 8y agoFILE is part of the standard, see 7.21.3 and e.g. 7.21.5.3. Section numbers as per C11 latest public draft; I don't have two hundred bucks to spend on an actual copy of the standard.
- KMag 8y agoarc4random() and getrandom() are orthogonal. The former generates cryptographical pseudorandom data in-process, periodically re-seeding from an OS entropy source. The latter in an interface to an OS entropy source.
- beefhash 8y agoYes, they are orthogonal. However, chances are POSIX can only be convinced to add one. And I'd rather they add the one that can't be misused by a programmer.