<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/random.c, branch v3_3_11</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>merge revision(s) 1181a682a6c314c92686e3701defa1eb44068c4e, 0cec4a14fb832aed4b498a21ec0c19765642d408, d84a811f31a65821642b165d712f380c0cc060e0: [Backport #21448]</title>
<updated>2025-07-20T06:43:31+00:00</updated>
<author>
<name>nagachika</name>
<email>nagachika@ruby-lang.org</email>
</author>
<published>2025-07-20T06:43:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=9b9f244b9837d2f3f1128591823eabe55f1a3204'/>
<id>9b9f244b9837d2f3f1128591823eabe55f1a3204</id>
<content type='text'>
	[Bug #21448] Use `getentropy(2)` only on macOS

	If this is not a system call, then it is using getrandom (which would
	have been tried already), and cannot be used as a replacement for the
	random devices.

	Restore getrandom(2) path for Linux with glibc 2.36 or later

	This is a follow-up to commit b120f5e38d9c (avoid fork-unsafe arc4random
	implementations, 2018-09-04).

	Avoid defining a no-op fill_random_bytes_syscall() if arc4random_buf(3)
	exists, but we are unsure if it is fork-safe. Check for other options
	instead. IOW, see if getrandom(2) is available.

	glibc 2.36, released in 2022, started to provide arc4random_buf(3) on
	Linux. This causes fill_random_bytes_syscall() to use neither of them
	and makes Random.urandom solely rely on getentropy(3) via
	fill_random_bytes_urandom().

	While the glibc implementation is safe, I did not add it to the list
	because using getrandom(2) directly is preferable on Linux.

	[Bug #21448] Reorder trials in `fill_random_bytes`

	First try dedicated system calls, such as `getrandom` or `getentropy`,
	next possible libraries, then fallback to `/dev/urandom`.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	[Bug #21448] Use `getentropy(2)` only on macOS

	If this is not a system call, then it is using getrandom (which would
	have been tried already), and cannot be used as a replacement for the
	random devices.

	Restore getrandom(2) path for Linux with glibc 2.36 or later

	This is a follow-up to commit b120f5e38d9c (avoid fork-unsafe arc4random
	implementations, 2018-09-04).

	Avoid defining a no-op fill_random_bytes_syscall() if arc4random_buf(3)
	exists, but we are unsure if it is fork-safe. Check for other options
	instead. IOW, see if getrandom(2) is available.

	glibc 2.36, released in 2022, started to provide arc4random_buf(3) on
	Linux. This causes fill_random_bytes_syscall() to use neither of them
	and makes Random.urandom solely rely on getentropy(3) via
	fill_random_bytes_urandom().

	While the glibc implementation is safe, I did not add it to the list
	because using getrandom(2) directly is preferable on Linux.

	[Bug #21448] Reorder trials in `fill_random_bytes`

	First try dedicated system calls, such as `getrandom` or `getentropy`,
	next possible libraries, then fallback to `/dev/urandom`.
</pre>
</div>
</content>
</entry>
<entry>
<title>Free everything at shutdown</title>
<updated>2023-12-07T20:52:35+00:00</updated>
<author>
<name>Adam Hess</name>
<email>adamhess1991@gmail.com</email>
</author>
<published>2023-10-12T18:15:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=6816e8efcff3be75f8020cd1b0ea57d3cd664bbc'/>
<id>6816e8efcff3be75f8020cd1b0ea57d3cd664bbc</id>
<content type='text'>
when the RUBY_FREE_ON_SHUTDOWN environment variable is set, manually free memory at shutdown.

Co-authored-by: Nobuyoshi Nakada &lt;nobu@ruby-lang.org&gt;
Co-authored-by: Peter Zhu &lt;peter@peterzhu.ca&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
when the RUBY_FREE_ON_SHUTDOWN environment variable is set, manually free memory at shutdown.

Co-authored-by: Nobuyoshi Nakada &lt;nobu@ruby-lang.org&gt;
Co-authored-by: Peter Zhu &lt;peter@peterzhu.ca&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[DOC] Improve Random::Formatter docs</title>
<updated>2022-12-11T16:49:56+00:00</updated>
<author>
<name>zverok</name>
<email>zverok.offline@gmail.com</email>
</author>
<published>2022-01-12T20:05:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=381a373ab92e2a5869e75f43815993cef39d32cf'/>
<id>381a373ab92e2a5869e75f43815993cef39d32cf</id>
<content type='text'>
* Make its usage more obvious (by providing more detailed
  examples);
* Include mention of it into Random itself;
* Small cleanups of docs.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Make its usage more obvious (by providing more detailed
  examples);
* Include mention of it into Random itself;
* Small cleanups of docs.
</pre>
</div>
</content>
</entry>
<entry>
<title>[Bug #19100] Add `init_int32` function to `rb_random_interface_t`</title>
<updated>2022-11-10T03:06:13+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2022-11-09T10:36:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=b7e8876704648cee6866591ac1aca7a54faff742'/>
<id>b7e8876704648cee6866591ac1aca7a54faff742</id>
<content type='text'>
Distinguish initialization by single word from initialization by
array.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Distinguish initialization by single word from initialization by
array.
</pre>
</div>
</content>
</entry>
<entry>
<title>Add version to the interface of Random extensions</title>
<updated>2022-11-10T02:59:45+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2022-11-08T00:06:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=6eaed20e145c1ab4c9c4ccf669d0ebea934f4d36'/>
<id>6eaed20e145c1ab4c9c4ccf669d0ebea934f4d36</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Respect `USE_COMMON_RANDOM` macro by a command line option [ci skip]</title>
<updated>2022-10-17T09:36:09+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2022-10-17T06:34:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=f6bf5e2c5f07a0e99a6f3dbc29035f911a4e477f'/>
<id>f6bf5e2c5f07a0e99a6f3dbc29035f911a4e477f</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix debug messages [ci skip]</title>
<updated>2022-10-17T09:36:08+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2022-10-17T06:33:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=b584c106d9f432431094136be67f11853bd3eb9c'/>
<id>b584c106d9f432431094136be67f11853bd3eb9c</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Expand tabs [ci skip]</title>
<updated>2022-07-21T16:42:04+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2022-07-21T16:23:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=5b21e94bebed90180d8ff63dad03b8b948361089'/>
<id>5b21e94bebed90180d8ff63dad03b8b948361089</id>
<content type='text'>
[Misc #18891]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[Misc #18891]
</pre>
</div>
</content>
</entry>
<entry>
<title>[DOC] Mark up the code for Kernel#rand as the same as Random#rand</title>
<updated>2022-01-13T02:34:09+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2022-01-13T02:34:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=5a75151a0166ded78fc87ef5891a6877ba0950db'/>
<id>5a75151a0166ded78fc87ef5891a6877ba0950db</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove deprecated Random::DEFAULT [Feature #17351]</title>
<updated>2022-01-01T09:55:52+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2022-01-01T02:36:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=fae0b664315c23ef7db451f6241d256c12217051'/>
<id>fae0b664315c23ef7db451f6241d256c12217051</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
