summaryrefslogtreecommitdiff
path: root/include/stdlib.h
diff options
context:
space:
mode:
authorConrad Meyer <cem@FreeBSD.org>2020-02-01 20:33:23 +0000
committerConrad Meyer <cem@FreeBSD.org>2020-02-01 20:33:23 +0000
commit672e12255da9b211d5318889ed9441ffc63c9f30 (patch)
treebaaf585238a927f84b973088667642b1ce66e562 /include/stdlib.h
parente656fa70dc685236bbb3a5136434e7011c84cb4f (diff)
downloadsrc-test2-672e12255da9b211d5318889ed9441ffc63c9f30.tar.gz
src-test2-672e12255da9b211d5318889ed9441ffc63c9f30.zip
Notes
Diffstat (limited to 'include/stdlib.h')
-rw-r--r--include/stdlib.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/include/stdlib.h b/include/stdlib.h
index 6adab32743d5..e84dca6ea42b 100644
--- a/include/stdlib.h
+++ b/include/stdlib.h
@@ -73,7 +73,11 @@ typedef struct {
#define EXIT_FAILURE 1
#define EXIT_SUCCESS 0
-#define RAND_MAX 0x7ffffffd
+/*
+ * I.e., INT_MAX; rand(3) returns a signed integer but must produce output in
+ * the range [0, RAND_MAX], so half of the possible output range is unused.
+ */
+#define RAND_MAX 0x7fffffff
__BEGIN_DECLS
#ifdef _XLOCALE_H_