RANDOM(3POSIX)

🌈 RANDOM(3POSIX) β€” POSIX Programmer's Manual πŸ’…

okay bestie, welcome to the POSIX Programmer's Manual section for random(3POSIX). Pull up a chair, grab a boba, we're doing this πŸ§‹βœ¨


🚨 PROLOG 🚨

okay so first things first, real talk: this page is part of the POSIX Programmer's Manual. That means it's the spec, the platonic ideal, the blueprint πŸ’–

⚠️ but listen β€” the Linux implementation of this interface may differ (so pls go consult the corresponding Linux manual page for the deets on actual Linux behavior), or the interface may not even be implemented on Linux at all 😭 no cap.

so like. it's giving "spec vs. reality," and you gotta know which one you're looking at. iykyk 🫢


✨ NAME ✨

random β€” generate pseudo-random number 🎲

yes that's the whole job. random numbers. iconic behavior honestly πŸ‘‘


πŸŽ€ SYNOPSIS πŸŽ€

#include <stdlib.h>

long random(void);

that's it. that's the vibe. one include, one function, no arguments, returns a long πŸ’œ


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so the entire description is literally just:

Refer to initstate().

and that's not me being lazy, that's the actual manual page, fr fr πŸ’€. the lore lives in initstate(), so go read that one, bestie. that's where the whole state-seeding situation is explained. this page is just the doorway πŸšͺ✨


okay legal era, but we still slay responsibly:

Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. πŸ’–

βš–οΈ In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. (referee = the one who actually decides, so respect the original, periodt πŸ‘‘)

The original Standard can be obtained online at http://www.opengroup.org/unix/online.html .

Also, any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format β€” so don't come for the standard, it's not the standard's fault πŸ™ˆ. To report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html .


and that's the whole page, bestie!! πŸŽ€ shoutout to IEEE/The Open Group, 2017 for the source and the date, and to RANDOM(3POSIX) for being the shortest little king in the manual. mwah πŸ’‹ bye!! πŸŒΈπŸ¦‹βœ¨