[DOC] Process._fork does not get called by Process.daemon

As discussed in [Bug #18911], I'm adding some documentation to
`Process._fork` to clarify that it is not expected to cover
calls to `Process.daemon`.

[Bug #18911]: https://bugs.ruby-lang.org/issues/18911

Co-authored-by: Yusuke Endoh <mame@ruby-lang.org>
This commit is contained in:
Ivo Anjo 2022-08-05 10:40:48 +01:00 committed by GitHub
parent f310ac1cb2
commit 74817f3d37
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
Notes: git 2022-08-05 18:41:17 +09:00
Merged: https://github.com/ruby/ruby/pull/6170

Merged-By: nobu <nobu@ruby-lang.org>

View File

@ -4353,6 +4353,13 @@ rb_call_proc__fork(void)
* This method is not for casual code but for application monitoring
* libraries. You can add custom code before and after fork events
* by overriding this method.
*
* Note: Process.daemon may be implemented using fork(2) BUT does not go
* through this method.
* Thus, depending on your reason to hook into this method, you
* may also want to hook into that one.
* See {this issue}[https://bugs.ruby-lang.org/issues/18911] for a
* more detailed discussion of this.
*/
VALUE
rb_proc__fork(VALUE _obj)