rbs 4.0.0.dev.5 → 4.0.1.dev.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (194) hide show
  1. checksums.yaml +4 -4
  2. data/.clang-format +1 -0
  3. data/.github/workflows/c-check.yml +8 -4
  4. data/.github/workflows/comments.yml +3 -1
  5. data/.github/workflows/dependabot.yml +1 -1
  6. data/.github/workflows/ruby.yml +10 -0
  7. data/.github/workflows/rust.yml +95 -0
  8. data/CHANGELOG.md +323 -0
  9. data/Rakefile +12 -29
  10. data/Steepfile +1 -0
  11. data/config.yml +393 -37
  12. data/core/array.rbs +218 -188
  13. data/core/basic_object.rbs +9 -8
  14. data/core/class.rbs +6 -5
  15. data/core/comparable.rbs +45 -31
  16. data/core/complex.rbs +52 -40
  17. data/core/dir.rbs +57 -45
  18. data/core/encoding.rbs +5 -5
  19. data/core/enumerable.rbs +96 -91
  20. data/core/enumerator.rbs +4 -3
  21. data/core/errno.rbs +3 -2
  22. data/core/errors.rbs +31 -29
  23. data/core/exception.rbs +12 -12
  24. data/core/fiber.rbs +36 -36
  25. data/core/file.rbs +186 -113
  26. data/core/file_test.rbs +2 -2
  27. data/core/float.rbs +41 -32
  28. data/core/gc.rbs +78 -70
  29. data/core/hash.rbs +70 -60
  30. data/core/integer.rbs +32 -28
  31. data/core/io/buffer.rbs +36 -36
  32. data/core/io/wait.rbs +7 -7
  33. data/core/io.rbs +120 -135
  34. data/core/kernel.rbs +189 -139
  35. data/core/marshal.rbs +3 -3
  36. data/core/match_data.rbs +14 -12
  37. data/core/math.rbs +69 -67
  38. data/core/method.rbs +6 -6
  39. data/core/module.rbs +146 -85
  40. data/core/nil_class.rbs +4 -3
  41. data/core/numeric.rbs +35 -32
  42. data/core/object.rbs +6 -8
  43. data/core/object_space.rbs +11 -10
  44. data/core/pathname.rbs +131 -81
  45. data/core/proc.rbs +65 -33
  46. data/core/process.rbs +219 -201
  47. data/core/ractor.rbs +15 -11
  48. data/core/random.rbs +4 -3
  49. data/core/range.rbs +52 -47
  50. data/core/rational.rbs +5 -5
  51. data/core/rbs/unnamed/argf.rbs +58 -51
  52. data/core/rbs/unnamed/env_class.rbs +18 -13
  53. data/core/rbs/unnamed/main_class.rbs +123 -0
  54. data/core/rbs/unnamed/random.rbs +7 -5
  55. data/core/regexp.rbs +236 -197
  56. data/core/ruby.rbs +1 -1
  57. data/core/ruby_vm.rbs +32 -30
  58. data/core/rubygems/config_file.rbs +5 -5
  59. data/core/rubygems/errors.rbs +1 -1
  60. data/core/rubygems/requirement.rbs +5 -5
  61. data/core/rubygems/rubygems.rbs +5 -3
  62. data/core/set.rbs +17 -16
  63. data/core/signal.rbs +2 -2
  64. data/core/string.rbs +311 -292
  65. data/core/struct.rbs +26 -25
  66. data/core/symbol.rbs +25 -24
  67. data/core/thread.rbs +40 -34
  68. data/core/time.rbs +47 -42
  69. data/core/trace_point.rbs +34 -31
  70. data/core/true_class.rbs +2 -2
  71. data/core/unbound_method.rbs +10 -10
  72. data/core/warning.rbs +7 -7
  73. data/docs/collection.md +1 -1
  74. data/docs/config.md +171 -0
  75. data/docs/inline.md +110 -4
  76. data/docs/syntax.md +13 -12
  77. data/ext/rbs_extension/ast_translation.c +489 -135
  78. data/ext/rbs_extension/class_constants.c +8 -0
  79. data/ext/rbs_extension/class_constants.h +4 -0
  80. data/ext/rbs_extension/legacy_location.c +28 -51
  81. data/ext/rbs_extension/legacy_location.h +37 -0
  82. data/ext/rbs_extension/main.c +12 -20
  83. data/include/rbs/ast.h +423 -195
  84. data/include/rbs/lexer.h +2 -2
  85. data/include/rbs/location.h +25 -44
  86. data/include/rbs/parser.h +2 -2
  87. data/include/rbs/util/rbs_constant_pool.h +0 -3
  88. data/include/rbs.h +8 -0
  89. data/lib/rbs/ast/ruby/annotations.rb +157 -4
  90. data/lib/rbs/ast/ruby/members.rb +374 -22
  91. data/lib/rbs/cli/validate.rb +5 -60
  92. data/lib/rbs/collection/config/lockfile_generator.rb +6 -2
  93. data/lib/rbs/definition_builder.rb +60 -27
  94. data/lib/rbs/errors.rb +0 -11
  95. data/lib/rbs/inline_parser.rb +1 -1
  96. data/lib/rbs/parser_aux.rb +20 -7
  97. data/lib/rbs/prototype/helpers.rb +57 -0
  98. data/lib/rbs/prototype/rb.rb +1 -26
  99. data/lib/rbs/prototype/rbi.rb +1 -20
  100. data/lib/rbs/test/type_check.rb +3 -0
  101. data/lib/rbs/types.rb +62 -52
  102. data/lib/rbs/unit_test/type_assertions.rb +35 -8
  103. data/lib/rbs/version.rb +1 -1
  104. data/lib/rbs.rb +0 -1
  105. data/rbs.gemspec +1 -1
  106. data/rust/.gitignore +1 -0
  107. data/rust/Cargo.lock +378 -0
  108. data/rust/Cargo.toml +7 -0
  109. data/rust/ruby-rbs/Cargo.toml +22 -0
  110. data/rust/ruby-rbs/build.rs +764 -0
  111. data/rust/ruby-rbs/examples/locations.rs +60 -0
  112. data/rust/ruby-rbs/src/lib.rs +1 -0
  113. data/rust/ruby-rbs/src/node/mod.rs +742 -0
  114. data/rust/ruby-rbs/tests/sanity.rs +47 -0
  115. data/rust/ruby-rbs/vendor/rbs/config.yml +1 -0
  116. data/rust/ruby-rbs-sys/Cargo.toml +23 -0
  117. data/rust/ruby-rbs-sys/build.rs +204 -0
  118. data/rust/ruby-rbs-sys/src/lib.rs +50 -0
  119. data/rust/ruby-rbs-sys/vendor/rbs/include +1 -0
  120. data/rust/ruby-rbs-sys/vendor/rbs/src +1 -0
  121. data/rust/ruby-rbs-sys/wrapper.h +1 -0
  122. data/sig/ast/ruby/annotations.rbs +191 -4
  123. data/sig/ast/ruby/members.rbs +21 -1
  124. data/sig/cli/validate.rbs +1 -6
  125. data/sig/definition_builder.rbs +2 -0
  126. data/sig/errors.rbs +0 -8
  127. data/sig/method_types.rbs +1 -1
  128. data/sig/parser.rbs +17 -13
  129. data/sig/prototype/helpers.rbs +2 -0
  130. data/sig/types.rbs +10 -11
  131. data/sig/unit_test/spy.rbs +0 -8
  132. data/sig/unit_test/type_assertions.rbs +11 -0
  133. data/src/ast.c +339 -161
  134. data/src/lexstate.c +1 -1
  135. data/src/location.c +7 -47
  136. data/src/parser.c +674 -480
  137. data/src/util/rbs_constant_pool.c +0 -4
  138. data/stdlib/bigdecimal/0/big_decimal.rbs +16 -16
  139. data/stdlib/cgi-escape/0/escape.rbs +4 -4
  140. data/stdlib/coverage/0/coverage.rbs +4 -3
  141. data/stdlib/date/0/date.rbs +33 -28
  142. data/stdlib/date/0/date_time.rbs +24 -23
  143. data/stdlib/did_you_mean/0/did_you_mean.rbs +17 -16
  144. data/stdlib/erb/0/erb.rbs +64 -53
  145. data/stdlib/etc/0/etc.rbs +55 -50
  146. data/stdlib/fileutils/0/fileutils.rbs +138 -125
  147. data/stdlib/forwardable/0/forwardable.rbs +10 -10
  148. data/stdlib/io-console/0/io-console.rbs +2 -2
  149. data/stdlib/json/0/json.rbs +135 -108
  150. data/stdlib/monitor/0/monitor.rbs +3 -3
  151. data/stdlib/net-http/0/net-http.rbs +159 -134
  152. data/stdlib/objspace/0/objspace.rbs +8 -7
  153. data/stdlib/open-uri/0/open-uri.rbs +8 -8
  154. data/stdlib/open3/0/open3.rbs +36 -35
  155. data/stdlib/openssl/0/openssl.rbs +144 -129
  156. data/stdlib/optparse/0/optparse.rbs +18 -14
  157. data/stdlib/pathname/0/pathname.rbs +2 -2
  158. data/stdlib/pp/0/pp.rbs +9 -8
  159. data/stdlib/prettyprint/0/prettyprint.rbs +7 -7
  160. data/stdlib/pstore/0/pstore.rbs +35 -30
  161. data/stdlib/psych/0/psych.rbs +61 -8
  162. data/stdlib/psych/0/store.rbs +2 -4
  163. data/stdlib/pty/0/pty.rbs +9 -6
  164. data/stdlib/random-formatter/0/random-formatter.rbs +2 -2
  165. data/stdlib/ripper/0/ripper.rbs +20 -17
  166. data/stdlib/securerandom/0/securerandom.rbs +1 -1
  167. data/stdlib/shellwords/0/shellwords.rbs +2 -2
  168. data/stdlib/socket/0/addrinfo.rbs +7 -7
  169. data/stdlib/socket/0/basic_socket.rbs +3 -3
  170. data/stdlib/socket/0/ip_socket.rbs +10 -8
  171. data/stdlib/socket/0/socket.rbs +10 -9
  172. data/stdlib/socket/0/tcp_server.rbs +1 -1
  173. data/stdlib/socket/0/tcp_socket.rbs +1 -1
  174. data/stdlib/socket/0/udp_socket.rbs +1 -1
  175. data/stdlib/socket/0/unix_server.rbs +1 -1
  176. data/stdlib/stringio/0/stringio.rbs +55 -54
  177. data/stdlib/strscan/0/string_scanner.rbs +46 -44
  178. data/stdlib/tempfile/0/tempfile.rbs +24 -20
  179. data/stdlib/time/0/time.rbs +7 -5
  180. data/stdlib/tsort/0/tsort.rbs +7 -6
  181. data/stdlib/uri/0/common.rbs +26 -18
  182. data/stdlib/uri/0/file.rbs +2 -2
  183. data/stdlib/uri/0/generic.rbs +2 -2
  184. data/stdlib/uri/0/http.rbs +2 -2
  185. data/stdlib/uri/0/ldap.rbs +2 -2
  186. data/stdlib/uri/0/mailto.rbs +3 -3
  187. data/stdlib/uri/0/rfc2396_parser.rbs +6 -5
  188. data/stdlib/zlib/0/deflate.rbs +4 -3
  189. data/stdlib/zlib/0/gzip_reader.rbs +4 -4
  190. data/stdlib/zlib/0/gzip_writer.rbs +14 -12
  191. data/stdlib/zlib/0/inflate.rbs +1 -1
  192. data/stdlib/zlib/0/need_dict.rbs +1 -1
  193. metadata +23 -5
  194. data/.github/workflows/valgrind.yml +0 -42
data/core/process.rbs CHANGED
@@ -98,8 +98,8 @@
98
98
  # What the word "executable" means here is depending on platforms.
99
99
  #
100
100
  # Even if the file considered "executable", its content may not be in proper
101
- # executable format. In that case, Ruby tries to run it by using `/bin/sh`
102
- # on a Unix-like system, like system(3) does.
101
+ # executable format. In that case, Ruby tries to run it by using
102
+ # <code>/bin/sh</code> on a Unix-like system, like system(3) does.
103
103
  #
104
104
  # File.write('shell_command', 'echo $SHELL', perm: 0o755)
105
105
  # system('./shell_command') # prints "/bin/sh" or something.
@@ -157,7 +157,7 @@
157
157
  #
158
158
  # Optional trailing argument `options` is a hash of execution options.
159
159
  #
160
- # #### Working Directory (`:chdir`)
160
+ # #### Working Directory (<code>:chdir</code>)
161
161
  #
162
162
  # By default, the working directory for the new process is the same as that of
163
163
  # the current process:
@@ -169,7 +169,8 @@
169
169
  #
170
170
  # /var
171
171
  #
172
- # Use option `:chdir` to set the working directory for the new process:
172
+ # Use option <code>:chdir</code> to set the working directory for the new
173
+ # process:
173
174
  #
174
175
  # Process.spawn('ruby -e "puts Dir.pwd"', {chdir: '/tmp'})
175
176
  #
@@ -194,42 +195,43 @@
194
195
  #
195
196
  # There are these shorthand symbols for fds:
196
197
  #
197
- # * `:in`: Specifies file descriptor 0 (STDIN).
198
- # * `:out`: Specifies file descriptor 1 (STDOUT).
199
- # * `:err`: Specifies file descriptor 2 (STDERR).
198
+ # * <code>:in</code>: Specifies file descriptor 0 (STDIN).
199
+ # * <code>:out</code>: Specifies file descriptor 1 (STDOUT).
200
+ # * <code>:err</code>: Specifies file descriptor 2 (STDERR).
200
201
  #
201
202
  # The value given with a source is one of:
202
203
  #
203
204
  # * *n*: Redirects to fd *n* in the parent process.
204
205
  # * `filepath`: Redirects from or to the file at `filepath` via
205
- # `open(filepath, mode, 0644)`, where `mode` is `'r'` for source `:in`, or
206
- # `'w'` for source `:out` or `:err`.
207
- # * `[filepath]`: Redirects from the file at `filepath` via `open(filepath,
208
- # 'r', 0644)`.
209
- # * `[filepath, mode]`: Redirects from or to the file at `filepath` via
210
- # `open(filepath, mode, 0644)`.
211
- # * `[filepath, mode, perm]`: Redirects from or to the file at `filepath` via
212
- # `open(filepath, mode, perm)`.
213
- # * `[:child, fd]`: Redirects to the redirected `fd`.
214
- # * `:close`: Closes the file descriptor in child process.
206
+ # <code>open(filepath, mode, 0644)</code>, where `mode` is <code>'r'</code>
207
+ # for source <code>:in</code>, or <code>'w'</code> for source
208
+ # <code>:out</code> or <code>:err</code>.
209
+ # * <code>[filepath]</code>: Redirects from the file at `filepath` via
210
+ # <code>open(filepath, 'r', 0644)</code>.
211
+ # * <code>[filepath, mode]</code>: Redirects from or to the file at `filepath`
212
+ # via <code>open(filepath, mode, 0644)</code>.
213
+ # * <code>[filepath, mode, perm]</code>: Redirects from or to the file at
214
+ # `filepath` via <code>open(filepath, mode, perm)</code>.
215
+ # * <code>[:child, fd]</code>: Redirects to the redirected `fd`.
216
+ # * <code>:close</code>: Closes the file descriptor in child process.
215
217
  #
216
218
  # See [Access Modes](rdoc-ref:File@Access+Modes) and [File
217
219
  # Permissions](rdoc-ref:File@File+Permissions).
218
220
  #
219
- # #### Environment Variables (`:unsetenv_others`)
221
+ # #### Environment Variables (<code>:unsetenv_others</code>)
220
222
  #
221
223
  # By default, the new process inherits environment variables from the parent
222
- # process; use execution option key `:unsetenv_others` with value `true` to
223
- # clear environment variables in the new process.
224
+ # process; use execution option key <code>:unsetenv_others</code> with value
225
+ # `true` to clear environment variables in the new process.
224
226
  #
225
227
  # Any changes specified by execution option `env` are made after the new process
226
228
  # inherits or clears its environment variables; see [Execution
227
229
  # Environment](rdoc-ref:Process@Execution+Environment).
228
230
  #
229
- # #### File-Creation Access (`:umask`)
231
+ # #### File-Creation Access (<code>:umask</code>)
230
232
  #
231
- # Use execution option `:umask` to set the file-creation access for the new
232
- # process; see [Access Modes](rdoc-ref:File@Access+Modes):
233
+ # Use execution option <code>:umask</code> to set the file-creation access for
234
+ # the new process; see [Access Modes](rdoc-ref:File@Access+Modes):
233
235
  #
234
236
  # command = 'ruby -e "puts sprintf(\"0%o\", File.umask)"'
235
237
  # options = {:umask => 0644}
@@ -239,28 +241,29 @@
239
241
  #
240
242
  # 0644
241
243
  #
242
- # #### Process Groups (`:pgroup` and `:new_pgroup`)
244
+ # #### Process Groups (<code>:pgroup</code> and <code>:new_pgroup</code>)
243
245
  #
244
246
  # By default, the new process belongs to the same [process
245
247
  # group](https://en.wikipedia.org/wiki/Process_group) as the parent process.
246
248
  #
247
- # To specify a different process group. use execution option `:pgroup` with one
248
- # of the following values:
249
+ # To specify a different process group. use execution option
250
+ # <code>:pgroup</code> with one of the following values:
249
251
  #
250
252
  # * `true`: Create a new process group for the new process.
251
253
  # * *pgid*: Create the new process in the process group whose id is *pgid*.
252
254
  #
253
- # On Windows only, use execution option `:new_pgroup` with value `true` to
254
- # create a new process group for the new process.
255
+ # On Windows only, use execution option <code>:new_pgroup</code> with value
256
+ # `true` to create a new process group for the new process.
255
257
  #
256
258
  # #### Resource Limits
257
259
  #
258
260
  # Use execution options to set resource limits.
259
261
  #
260
- # The keys for these options are symbols of the form `:rlimit_*resource_name`*,
261
- # where *resource_name* is the downcased form of one of the string resource
262
- # names described at method Process.setrlimit. For example, key `:rlimit_cpu`
263
- # corresponds to resource limit `'CPU'`.
262
+ # The keys for these options are symbols of the form
263
+ # <code>:rlimit_<i>resource_name</i></code>, where *resource_name* is the
264
+ # downcased form of one of the string resource names described at method
265
+ # Process.setrlimit. For example, key <code>:rlimit_cpu</code> corresponds to
266
+ # resource limit <code>'CPU'</code>.
264
267
  #
265
268
  # The value for such as key is one of:
266
269
  #
@@ -271,13 +274,14 @@
271
274
  #
272
275
  # By default, the new process inherits file descriptors from the parent process.
273
276
  #
274
- # Use execution option `:close_others => true` to modify that inheritance by
275
- # closing non-standard fds (3 and greater) that are not otherwise redirected.
277
+ # Use execution option <code>:close_others => true</code> to modify that
278
+ # inheritance by closing non-standard fds (3 and greater) that are not otherwise
279
+ # redirected.
276
280
  #
277
281
  # ### Execution Shell
278
282
  #
279
- # On a Unix-like system, the shell invoked is `/bin/sh`; the entire string
280
- # `command_line` is passed as an argument to [shell option
283
+ # On a Unix-like system, the shell invoked is <code>/bin/sh</code>; the entire
284
+ # string `command_line` is passed as an argument to [shell option
281
285
  # -c](https://pubs.opengroup.org/onlinepubs/9699919799.2018edition/utilities/sh.
282
286
  # html).
283
287
  #
@@ -295,21 +299,23 @@
295
299
  #
296
300
  # On Windows, the shell invoked is determined by environment variable
297
301
  # `RUBYSHELL`, if defined, or `COMSPEC` otherwise; the entire string
298
- # `command_line` is passed as an argument to `-c` option for `RUBYSHELL`, as
299
- # well as `/bin/sh`, and [/c
302
+ # `command_line` is passed as an argument to <code>-c</code> option for
303
+ # `RUBYSHELL`, as well as <code>/bin/sh</code>, and [/c
300
304
  # option](https://learn.microsoft.com/en-us/windows-server/administration/window
301
305
  # s-commands/cmd) for `COMSPEC`. The shell is invoked automatically in the
302
306
  # following cases:
303
307
  #
304
- # * The command is a built-in of `cmd.exe`, such as `echo`.
305
- # * The executable file is a batch file; its name ends with `.bat` or `.cmd`.
308
+ # * The command is a built-in of <code>cmd.exe</code>, such as `echo`.
309
+ # * The executable file is a batch file; its name ends with <code>.bat</code>
310
+ # or <code>.cmd</code>.
306
311
  #
307
312
  # Note that the command will still be invoked as `command_line` form even when
308
- # called in `exe_path` form, because `cmd.exe` does not accept a script name
309
- # like `/bin/sh` does but only works with `/c` option.
313
+ # called in `exe_path` form, because <code>cmd.exe</code> does not accept a
314
+ # script name like <code>/bin/sh</code> does but only works with <code>/c</code>
315
+ # option.
310
316
  #
311
- # The standard shell `cmd.exe` performs environment variable expansion but does
312
- # not have globbing functionality:
317
+ # The standard shell <code>cmd.exe</code> performs environment variable
318
+ # expansion but does not have globbing functionality:
313
319
  #
314
320
  # Example:
315
321
  #
@@ -405,7 +411,7 @@ module Process
405
411
  # - Process._fork -> integer
406
412
  # -->
407
413
  # An internal API for fork. Do not call this method directly. Currently, this is
408
- # called via Kernel#fork, Process.fork, and IO.popen with `"-"`.
414
+ # called via Kernel#fork, Process.fork, and IO.popen with <code>"-"</code>.
409
415
  #
410
416
  # This method is not for casual code but for application monitoring libraries.
411
417
  # You can add custom code before and after fork events by overriding this
@@ -453,17 +459,17 @@ module Process
453
459
  # Process.clock_getres(:CLOCK_PROCESS_CPUTIME_ID, :second) # => 0
454
460
  #
455
461
  # In addition to the values for `unit` supported in Process.clock_gettime, this
456
- # method supports `:hertz`, the integer number of clock ticks per second (which
457
- # is the reciprocal of `:float_second`):
462
+ # method supports <code>:hertz</code>, the integer number of clock ticks per
463
+ # second (which is the reciprocal of <code>:float_second</code>):
458
464
  #
459
465
  # Process.clock_getres(:TIMES_BASED_CLOCK_PROCESS_CPUTIME_ID, :hertz) # => 100.0
460
466
  # Process.clock_getres(:TIMES_BASED_CLOCK_PROCESS_CPUTIME_ID, :float_second) # => 0.01
461
467
  #
462
468
  # **Accuracy**: Note that the returned resolution may be inaccurate on some
463
469
  # platforms due to underlying bugs. Inaccurate resolutions have been reported
464
- # for various clocks including `:CLOCK_MONOTONIC` and `:CLOCK_MONOTONIC_RAW` on
465
- # Linux, macOS, BSD or AIX platforms, when using ARM processors, or when using
466
- # virtualization.
470
+ # for various clocks including <code>:CLOCK_MONOTONIC</code> and
471
+ # <code>:CLOCK_MONOTONIC_RAW</code> on Linux, macOS, BSD or AIX platforms, when
472
+ # using ARM processors, or when using virtualization.
467
473
  #
468
474
  def self.clock_getres: (Symbol | Integer clock_id, ?Symbol unit) -> (Float | Integer)
469
475
 
@@ -482,74 +488,77 @@ module Process
482
488
  # Optional argument `unit` should be a symbol that specifies the unit to be used
483
489
  # in the returned clock time; see below.
484
490
  #
485
- # **Argument `clock_id`**
491
+ # <strong>Argument `clock_id`</strong>
486
492
  #
487
493
  # Argument `clock_id` specifies the clock whose time is to be returned; it may
488
- # be a constant such as `Process::CLOCK_REALTIME`, or a symbol shorthand such as
489
- # `:CLOCK_REALTIME`.
494
+ # be a constant such as <code>Process::CLOCK_REALTIME</code>, or a symbol
495
+ # shorthand such as <code>:CLOCK_REALTIME</code>.
490
496
  #
491
497
  # The supported clocks depend on the underlying operating system; this method
492
498
  # supports the following clocks on the indicated platforms (raises Errno::EINVAL
493
499
  # if called with an unsupported clock):
494
500
  #
495
- # * `:CLOCK_BOOTTIME`: Linux 2.6.39.
496
- # * `:CLOCK_BOOTTIME_ALARM`: Linux 3.0.
497
- # * `:CLOCK_MONOTONIC`: SUSv3 to 4, Linux 2.5.63, FreeBSD 3.0, NetBSD 2.0,
498
- # OpenBSD 3.4, macOS 10.12, Windows-2000.
499
- # * `:CLOCK_MONOTONIC_COARSE`: Linux 2.6.32.
500
- # * `:CLOCK_MONOTONIC_FAST`: FreeBSD 8.1.
501
- # * `:CLOCK_MONOTONIC_PRECISE`: FreeBSD 8.1.
502
- # * `:CLOCK_MONOTONIC_RAW`: Linux 2.6.28, macOS 10.12.
503
- # * `:CLOCK_MONOTONIC_RAW_APPROX`: macOS 10.12.
504
- # * `:CLOCK_PROCESS_CPUTIME_ID`: SUSv3 to 4, Linux 2.5.63, FreeBSD 9.3,
505
- # OpenBSD 5.4, macOS 10.12.
506
- # * `:CLOCK_PROF`: FreeBSD 3.0, OpenBSD 2.1.
507
- # * `:CLOCK_REALTIME`: SUSv2 to 4, Linux 2.5.63, FreeBSD 3.0, NetBSD 2.0,
508
- # OpenBSD 2.1, macOS 10.12, Windows-8/Server-2012. Time.now is recommended
509
- # over +:CLOCK_REALTIME:.
510
- # * `:CLOCK_REALTIME_ALARM`: Linux 3.0.
511
- # * `:CLOCK_REALTIME_COARSE`: Linux 2.6.32.
512
- # * `:CLOCK_REALTIME_FAST`: FreeBSD 8.1.
513
- # * `:CLOCK_REALTIME_PRECISE`: FreeBSD 8.1.
514
- # * `:CLOCK_SECOND`: FreeBSD 8.1.
515
- # * `:CLOCK_TAI`: Linux 3.10.
516
- # * `:CLOCK_THREAD_CPUTIME_ID`: SUSv3 to 4, Linux 2.5.63, FreeBSD 7.1, OpenBSD
517
- # 5.4, macOS 10.12.
518
- # * `:CLOCK_UPTIME`: FreeBSD 7.0, OpenBSD 5.5.
519
- # * `:CLOCK_UPTIME_FAST`: FreeBSD 8.1.
520
- # * `:CLOCK_UPTIME_PRECISE`: FreeBSD 8.1.
521
- # * `:CLOCK_UPTIME_RAW`: macOS 10.12.
522
- # * `:CLOCK_UPTIME_RAW_APPROX`: macOS 10.12.
523
- # * `:CLOCK_VIRTUAL`: FreeBSD 3.0, OpenBSD 2.1.
501
+ # * <code>:CLOCK_BOOTTIME</code>: Linux 2.6.39.
502
+ # * <code>:CLOCK_BOOTTIME_ALARM</code>: Linux 3.0.
503
+ # * <code>:CLOCK_MONOTONIC</code>: SUSv3 to 4, Linux 2.5.63, FreeBSD 3.0,
504
+ # NetBSD 2.0, OpenBSD 3.4, macOS 10.12, Windows-2000.
505
+ # * <code>:CLOCK_MONOTONIC_COARSE</code>: Linux 2.6.32.
506
+ # * <code>:CLOCK_MONOTONIC_FAST</code>: FreeBSD 8.1.
507
+ # * <code>:CLOCK_MONOTONIC_PRECISE</code>: FreeBSD 8.1.
508
+ # * <code>:CLOCK_MONOTONIC_RAW</code>: Linux 2.6.28, macOS 10.12.
509
+ # * <code>:CLOCK_MONOTONIC_RAW_APPROX</code>: macOS 10.12.
510
+ # * <code>:CLOCK_PROCESS_CPUTIME_ID</code>: SUSv3 to 4, Linux 2.5.63, FreeBSD
511
+ # 9.3, OpenBSD 5.4, macOS 10.12.
512
+ # * <code>:CLOCK_PROF</code>: FreeBSD 3.0, OpenBSD 2.1.
513
+ # * <code>:CLOCK_REALTIME</code>: SUSv2 to 4, Linux 2.5.63, FreeBSD 3.0,
514
+ # NetBSD 2.0, OpenBSD 2.1, macOS 10.12, Windows-8/Server-2012. Time.now is
515
+ # recommended over +:CLOCK_REALTIME:.
516
+ # * <code>:CLOCK_REALTIME_ALARM</code>: Linux 3.0.
517
+ # * <code>:CLOCK_REALTIME_COARSE</code>: Linux 2.6.32.
518
+ # * <code>:CLOCK_REALTIME_FAST</code>: FreeBSD 8.1.
519
+ # * <code>:CLOCK_REALTIME_PRECISE</code>: FreeBSD 8.1.
520
+ # * <code>:CLOCK_SECOND</code>: FreeBSD 8.1.
521
+ # * <code>:CLOCK_TAI</code>: Linux 3.10.
522
+ # * <code>:CLOCK_THREAD_CPUTIME_ID</code>: SUSv3 to 4, Linux 2.5.63, FreeBSD
523
+ # 7.1, OpenBSD 5.4, macOS 10.12.
524
+ # * <code>:CLOCK_UPTIME</code>: FreeBSD 7.0, OpenBSD 5.5.
525
+ # * <code>:CLOCK_UPTIME_FAST</code>: FreeBSD 8.1.
526
+ # * <code>:CLOCK_UPTIME_PRECISE</code>: FreeBSD 8.1.
527
+ # * <code>:CLOCK_UPTIME_RAW</code>: macOS 10.12.
528
+ # * <code>:CLOCK_UPTIME_RAW_APPROX</code>: macOS 10.12.
529
+ # * <code>:CLOCK_VIRTUAL</code>: FreeBSD 3.0, OpenBSD 2.1.
524
530
  #
525
531
  # Note that SUS stands for Single Unix Specification. SUS contains POSIX and
526
- # clock_gettime is defined in the POSIX part. SUS defines `:CLOCK_REALTIME` as
527
- # mandatory but `:CLOCK_MONOTONIC`, `:CLOCK_PROCESS_CPUTIME_ID`, and
528
- # `:CLOCK_THREAD_CPUTIME_ID` are optional.
532
+ # clock_gettime is defined in the POSIX part. SUS defines
533
+ # <code>:CLOCK_REALTIME</code> as mandatory but <code>:CLOCK_MONOTONIC</code>,
534
+ # <code>:CLOCK_PROCESS_CPUTIME_ID</code>, and
535
+ # <code>:CLOCK_THREAD_CPUTIME_ID</code> are optional.
529
536
  #
530
537
  # Certain emulations are used when the given `clock_id` is not supported
531
538
  # directly:
532
539
  #
533
- # * Emulations for `:CLOCK_REALTIME`:
540
+ # * Emulations for <code>:CLOCK_REALTIME</code>:
534
541
  #
535
- # * `:GETTIMEOFDAY_BASED_CLOCK_REALTIME`: Use gettimeofday() defined by
536
- # SUS (deprecated in SUSv4). The resolution is 1 microsecond.
537
- # * `:TIME_BASED_CLOCK_REALTIME`: Use time() defined by ISO C. The
538
- # resolution is 1 second.
542
+ # * <code>:GETTIMEOFDAY_BASED_CLOCK_REALTIME</code>: Use gettimeofday()
543
+ # defined by SUS (deprecated in SUSv4). The resolution is 1 microsecond.
544
+ # * <code>:TIME_BASED_CLOCK_REALTIME</code>: Use time() defined by ISO C.
545
+ # The resolution is 1 second.
539
546
  #
540
- # * Emulations for `:CLOCK_MONOTONIC`:
547
+ # * Emulations for <code>:CLOCK_MONOTONIC</code>:
541
548
  #
542
- # * `:MACH_ABSOLUTE_TIME_BASED_CLOCK_MONOTONIC`: Use mach_absolute_time(),
543
- # available on Darwin. The resolution is CPU dependent.
544
- # * `:TIMES_BASED_CLOCK_MONOTONIC`: Use the result value of times()
545
- # defined by POSIX, thus:
549
+ # * <code>:MACH_ABSOLUTE_TIME_BASED_CLOCK_MONOTONIC</code>: Use
550
+ # mach_absolute_time(), available on Darwin. The resolution is CPU
551
+ # dependent.
552
+ # * <code>:TIMES_BASED_CLOCK_MONOTONIC</code>: Use the result value of
553
+ # times() defined by POSIX, thus:
546
554
  # > Upon successful completion, times() shall return the elapsed real
547
555
  # time, in clock ticks, since an arbitrary point in the past (for
548
556
  # example, system start-up time).
549
557
  #
550
558
  # > For example, GNU/Linux returns a value based on jiffies and it is
551
559
  # monotonic. However, 4.4BSD uses gettimeofday() and it is not
552
- # monotonic. (FreeBSD uses `:CLOCK_MONOTONIC` instead, though.)
560
+ # monotonic. (FreeBSD uses <code>:CLOCK_MONOTONIC</code> instead,
561
+ # though.)
553
562
  #
554
563
  # The resolution is the clock tick. "getconf CLK_TCK" command shows the
555
564
  # clock ticks per second. (The clock ticks-per-second is defined by HZ
@@ -557,40 +566,40 @@ module Process
557
566
  # type, the resolution is 10 millisecond and cannot represent over 497
558
567
  # days.
559
568
  #
560
- # * Emulations for `:CLOCK_PROCESS_CPUTIME_ID`:
561
- #
562
- # * `:GETRUSAGE_BASED_CLOCK_PROCESS_CPUTIME_ID`: Use getrusage() defined
563
- # by SUS. getrusage() is used with RUSAGE_SELF to obtain the time only
564
- # for the calling process (excluding the time for child processes). The
565
- # result is addition of user time (ru_utime) and system time (ru_stime).
566
- # The resolution is 1 microsecond.
567
- # * `:TIMES_BASED_CLOCK_PROCESS_CPUTIME_ID`: Use times() defined by POSIX.
568
- # The result is addition of user time (tms_utime) and system time
569
- # (tms_stime). tms_cutime and tms_cstime are ignored to exclude the time
570
- # for child processes. The resolution is the clock tick. "getconf
571
- # CLK_TCK" command shows the clock ticks per second. (The clock ticks
572
- # per second is defined by HZ macro in older systems.) If it is 100, the
573
- # resolution is 10 millisecond.
574
- # * `:CLOCK_BASED_CLOCK_PROCESS_CPUTIME_ID`: Use clock() defined by ISO C.
575
- # The resolution is `1/CLOCKS_PER_SEC`. `CLOCKS_PER_SEC` is the C-level
576
- # macro defined by time.h. SUS defines `CLOCKS_PER_SEC` as 1000000;
577
- # other systems may define it differently. If `CLOCKS_PER_SEC` is
578
- # 1000000 (as in SUS), the resolution is 1 microsecond. If
579
- # `CLOCKS_PER_SEC` is 1000000 and clock_t is a 32-bit integer type, it
580
- # cannot represent over 72 minutes.
581
- #
582
- # **Argument `unit`**
583
- #
584
- # Optional argument `unit` (default `:float_second`) specifies the unit for the
585
- # returned value.
586
- #
587
- # * `:float_microsecond`: Number of microseconds as a float.
588
- # * `:float_millisecond`: Number of milliseconds as a float.
589
- # * `:float_second`: Number of seconds as a float.
590
- # * `:microsecond`: Number of microseconds as an integer.
591
- # * `:millisecond`: Number of milliseconds as an integer.
592
- # * `:nanosecond`: Number of nanoseconds as an integer.
593
- # * `:second`: Number of seconds as an integer.
569
+ # * Emulations for <code>:CLOCK_PROCESS_CPUTIME_ID</code>:
570
+ #
571
+ # * <code>:GETRUSAGE_BASED_CLOCK_PROCESS_CPUTIME_ID</code>: Use
572
+ # getrusage() defined by SUS. getrusage() is used with RUSAGE_SELF to
573
+ # obtain the time only for the calling process (excluding the time for
574
+ # child processes). The result is addition of user time (ru_utime) and
575
+ # system time (ru_stime). The resolution is 1 microsecond.
576
+ # * <code>:TIMES_BASED_CLOCK_PROCESS_CPUTIME_ID</code>: Use times()
577
+ # defined by POSIX. The result is addition of user time (tms_utime) and
578
+ # system time (tms_stime). tms_cutime and tms_cstime are ignored to
579
+ # exclude the time for child processes. The resolution is the clock
580
+ # tick. "getconf CLK_TCK" command shows the clock ticks per second. (The
581
+ # clock ticks per second is defined by HZ macro in older systems.) If it
582
+ # is 100, the resolution is 10 millisecond.
583
+ # * <code>:CLOCK_BASED_CLOCK_PROCESS_CPUTIME_ID</code>: Use clock()
584
+ # defined by ISO C. The resolution is <code>1/CLOCKS_PER_SEC</code>.
585
+ # `CLOCKS_PER_SEC` is the C-level macro defined by time.h. SUS defines
586
+ # `CLOCKS_PER_SEC` as 1000000; other systems may define it differently.
587
+ # If `CLOCKS_PER_SEC` is 1000000 (as in SUS), the resolution is 1
588
+ # microsecond. If `CLOCKS_PER_SEC` is 1000000 and clock_t is a 32-bit
589
+ # integer type, it cannot represent over 72 minutes.
590
+ #
591
+ # <strong>Argument `unit`</strong>
592
+ #
593
+ # Optional argument `unit` (default <code>:float_second</code>) specifies the
594
+ # unit for the returned value.
595
+ #
596
+ # * <code>:float_microsecond</code>: Number of microseconds as a float.
597
+ # * <code>:float_millisecond</code>: Number of milliseconds as a float.
598
+ # * <code>:float_second</code>: Number of seconds as a float.
599
+ # * <code>:microsecond</code>: Number of microseconds as an integer.
600
+ # * <code>:millisecond</code>: Number of milliseconds as an integer.
601
+ # * <code>:nanosecond</code>: Number of nanoseconds as an integer.
602
+ # * <code>:second</code>: Number of seconds as an integer.
594
603
  #
595
604
  # Examples:
596
605
  #
@@ -611,15 +620,15 @@ module Process
611
620
  #
612
621
  # The underlying function, clock_gettime(), returns a number of nanoseconds.
613
622
  # Float object (IEEE 754 double) is not enough to represent the return value for
614
- # `:CLOCK_REALTIME`. If the exact nanoseconds value is required, use
615
- # `:nanosecond` as the `unit`.
623
+ # <code>:CLOCK_REALTIME</code>. If the exact nanoseconds value is required, use
624
+ # <code>:nanosecond</code> as the `unit`.
616
625
  #
617
626
  # The origin (time zero) of the returned value is system-dependent, and may be,
618
627
  # for example, system start up time, process start up time, the Epoch, etc.
619
628
  #
620
- # The origin in `:CLOCK_REALTIME` is defined as the Epoch: `1970-01-01 00:00:00
621
- # UTC`; some systems count leap seconds and others don't, so the result may vary
622
- # across systems.
629
+ # The origin in <code>:CLOCK_REALTIME</code> is defined as the Epoch:
630
+ # <code>1970-01-01 00:00:00 UTC</code>; some systems count leap seconds and
631
+ # others don't, so the result may vary across systems.
623
632
  #
624
633
  def self.clock_gettime: (Symbol | Integer clock_id) -> Float
625
634
  | (Symbol | Integer clock_id, :float_second | :float_millisecond | :float_microsecond unit) -> Float
@@ -906,29 +915,29 @@ module Process
906
915
  #
907
916
  # Argument `signal` specifies the signal to be sent; the argument may be:
908
917
  #
909
- # * An integer signal number: e.g., `-29`, `0`, `29`.
910
- # * A signal name (string), with or without leading `'SIG'`, and with or
911
- # without a further prefixed minus sign (`'-'`): e.g.:
918
+ # * An integer signal number: e.g., <code>-29</code>, `0`, `29`.
919
+ # * A signal name (string), with or without leading <code>'SIG'</code>, and
920
+ # with or without a further prefixed minus sign (<code>'-'</code>): e.g.:
912
921
  #
913
- # * `'SIGPOLL'`.
914
- # * `'POLL'`,
915
- # * `'-SIGPOLL'`.
916
- # * `'-POLL'`.
922
+ # * <code>'SIGPOLL'</code>.
923
+ # * <code>'POLL'</code>,
924
+ # * <code>'-SIGPOLL'</code>.
925
+ # * <code>'-POLL'</code>.
917
926
  #
918
- # * A signal symbol, with or without leading `'SIG'`, and with or without a
919
- # further prefixed minus sign (`'-'`): e.g.:
927
+ # * A signal symbol, with or without leading <code>'SIG'</code>, and with or
928
+ # without a further prefixed minus sign (<code>'-'</code>): e.g.:
920
929
  #
921
- # * `:SIGPOLL`.
922
- # * `:POLL`.
923
- # * `:'-SIGPOLL'`.
924
- # * `:'-POLL'`.
930
+ # * <code>:SIGPOLL</code>.
931
+ # * <code>:POLL</code>.
932
+ # * <code>:'-SIGPOLL'</code>.
933
+ # * <code>:'-POLL'</code>.
925
934
  #
926
935
  # If `signal` is:
927
936
  #
928
- # * A non-negative integer, or a signal name or symbol without prefixed `'-'`,
929
- # each process with process ID `id` is signalled.
930
- # * A negative integer, or a signal name or symbol with prefixed `'-'`, each
931
- # process group with group ID `id` is signalled.
937
+ # * A non-negative integer, or a signal name or symbol without prefixed
938
+ # <code>'-'</code>, each process with process ID `id` is signalled.
939
+ # * A negative integer, or a signal name or symbol with prefixed
940
+ # <code>'-'</code>, each process group with group ID `id` is signalled.
932
941
  #
933
942
  # Use method Signal.list to see which signals are supported by Ruby on the
934
943
  # underlying platform; the method returns a hash of the string names and
@@ -1064,40 +1073,46 @@ module Process
1064
1073
  #
1065
1074
  # Argument `resource` specifies the resource whose limits are to be set; the
1066
1075
  # argument may be given as a symbol, as a string, or as a constant beginning
1067
- # with `Process::RLIMIT_` (e.g., `:CORE`, `'CORE'`, or `Process::RLIMIT_CORE`.
1076
+ # with <code>Process::RLIMIT_</code> (e.g., <code>:CORE</code>,
1077
+ # <code>'CORE'</code>, or <code>Process::RLIMIT_CORE</code>.
1068
1078
  #
1069
1079
  # The resources available and supported are system-dependent, and may include
1070
1080
  # (here expressed as symbols):
1071
1081
  #
1072
- # * `:AS`: Total available memory (bytes) (SUSv3, NetBSD, FreeBSD, OpenBSD
1073
- # except 4.4BSD-Lite).
1074
- # * `:CORE`: Core size (bytes) (SUSv3).
1075
- # * `:CPU`: CPU time (seconds) (SUSv3).
1076
- # * `:DATA`: Data segment (bytes) (SUSv3).
1077
- # * `:FSIZE`: File size (bytes) (SUSv3).
1078
- # * `:MEMLOCK`: Total size for mlock(2) (bytes) (4.4BSD, GNU/Linux).
1079
- # * `:MSGQUEUE`: Allocation for POSIX message queues (bytes) (GNU/Linux).
1080
- # * `:NICE`: Ceiling on process's nice(2) value (number) (GNU/Linux).
1081
- # * `:NOFILE`: File descriptors (number) (SUSv3).
1082
- # * `:NPROC`: Number of processes for the user (number) (4.4BSD, GNU/Linux).
1083
- # * `:NPTS`: Number of pseudo terminals (number) (FreeBSD).
1084
- # * `:RSS`: Resident memory size (bytes) (4.2BSD, GNU/Linux).
1085
- # * `:RTPRIO`: Ceiling on the process's real-time priority (number)
1082
+ # * <code>:AS</code>: Total available memory (bytes) (SUSv3, NetBSD, FreeBSD,
1083
+ # OpenBSD except 4.4BSD-Lite).
1084
+ # * <code>:CORE</code>: Core size (bytes) (SUSv3).
1085
+ # * <code>:CPU</code>: CPU time (seconds) (SUSv3).
1086
+ # * <code>:DATA</code>: Data segment (bytes) (SUSv3).
1087
+ # * <code>:FSIZE</code>: File size (bytes) (SUSv3).
1088
+ # * <code>:MEMLOCK</code>: Total size for mlock(2) (bytes) (4.4BSD,
1089
+ # GNU/Linux).
1090
+ # * <code>:MSGQUEUE</code>: Allocation for POSIX message queues (bytes)
1086
1091
  # (GNU/Linux).
1087
- # * `:RTTIME`: CPU time for real-time process (us) (GNU/Linux).
1088
- # * `:SBSIZE`: All socket buffers (bytes) (NetBSD, FreeBSD).
1089
- # * `:SIGPENDING`: Number of queued signals allowed (signals) (GNU/Linux).
1090
- # * `:STACK`: Stack size (bytes) (SUSv3).
1092
+ # * <code>:NICE</code>: Ceiling on process's nice(2) value (number)
1093
+ # (GNU/Linux).
1094
+ # * <code>:NOFILE</code>: File descriptors (number) (SUSv3).
1095
+ # * <code>:NPROC</code>: Number of processes for the user (number) (4.4BSD,
1096
+ # GNU/Linux).
1097
+ # * <code>:NPTS</code>: Number of pseudo terminals (number) (FreeBSD).
1098
+ # * <code>:RSS</code>: Resident memory size (bytes) (4.2BSD, GNU/Linux).
1099
+ # * <code>:RTPRIO</code>: Ceiling on the process's real-time priority (number)
1100
+ # (GNU/Linux).
1101
+ # * <code>:RTTIME</code>: CPU time for real-time process (us) (GNU/Linux).
1102
+ # * <code>:SBSIZE</code>: All socket buffers (bytes) (NetBSD, FreeBSD).
1103
+ # * <code>:SIGPENDING</code>: Number of queued signals allowed (signals)
1104
+ # (GNU/Linux).
1105
+ # * <code>:STACK</code>: Stack size (bytes) (SUSv3).
1091
1106
  #
1092
1107
  # Arguments `cur_limit` and `max_limit` may be:
1093
1108
  #
1094
1109
  # * Integers (`max_limit` should not be smaller than `cur_limit`).
1095
- # * Symbol `:SAVED_MAX`, string `'SAVED_MAX'`, or constant
1096
- # `Process::RLIM_SAVED_MAX`: saved maximum limit.
1097
- # * Symbol `:SAVED_CUR`, string `'SAVED_CUR'`, or constant
1098
- # `Process::RLIM_SAVED_CUR`: saved current limit.
1099
- # * Symbol `:INFINITY`, string `'INFINITY'`, or constant
1100
- # `Process::RLIM_INFINITY`: no limit on resource.
1110
+ # * Symbol <code>:SAVED_MAX</code>, string <code>'SAVED_MAX'</code>, or
1111
+ # constant <code>Process::RLIM_SAVED_MAX</code>: saved maximum limit.
1112
+ # * Symbol <code>:SAVED_CUR</code>, string <code>'SAVED_CUR'</code>, or
1113
+ # constant <code>Process::RLIM_SAVED_CUR</code>: saved current limit.
1114
+ # * Symbol <code>:INFINITY</code>, string <code>'INFINITY'</code>, or constant
1115
+ # <code>Process::RLIM_INFINITY</code>: no limit on resource.
1101
1116
  #
1102
1117
  # This example raises the soft limit of core size to the hard limit to try to
1103
1118
  # make core dump possible:
@@ -1164,8 +1179,8 @@ module Process
1164
1179
  # - Process.wait(pid = -1, flags = 0) -> integer
1165
1180
  # -->
1166
1181
  # Waits for a suitable child process to exit, returns its process ID, and sets
1167
- # `$?` to a Process::Status object containing information on that process. Which
1168
- # child it waits for depends on the value of the given `pid`:
1182
+ # <code>$?</code> to a Process::Status object containing information on that
1183
+ # process. Which child it waits for depends on the value of the given `pid`:
1169
1184
  #
1170
1185
  # * Positive integer: Waits for the child process whose process ID is `pid`:
1171
1186
  #
@@ -1211,7 +1226,7 @@ module Process
1211
1226
  # Process.wait(0) returned pid 225788, which is child 0 pid.
1212
1227
  # Raised Errno::ECHILD, because child 1 process group ID differs from parent process group ID.
1213
1228
  #
1214
- # * `-1` (default): Waits for any child process:
1229
+ # * <code>-1</code> (default): Waits for any child process:
1215
1230
  #
1216
1231
  # parent_pgpid = Process.getpgid(Process.pid)
1217
1232
  # puts "Parent process group ID is #{parent_pgpid}."
@@ -1243,7 +1258,8 @@ module Process
1243
1258
  # true
1244
1259
  # true
1245
1260
  #
1246
- # * Less than `-1`: Waits for any child whose process group ID is `-pid`:
1261
+ # * Less than <code>-1</code>: Waits for any child whose process group ID is
1262
+ # <code>-pid</code>:
1247
1263
  #
1248
1264
  # parent_pgpid = Process.getpgid(Process.pid)
1249
1265
  # puts "Parent process group ID is #{parent_pgpid}."
@@ -1329,8 +1345,8 @@ module Process
1329
1345
  # - Process.wait(pid = -1, flags = 0) -> integer
1330
1346
  # -->
1331
1347
  # Waits for a suitable child process to exit, returns its process ID, and sets
1332
- # `$?` to a Process::Status object containing information on that process. Which
1333
- # child it waits for depends on the value of the given `pid`:
1348
+ # <code>$?</code> to a Process::Status object containing information on that
1349
+ # process. Which child it waits for depends on the value of the given `pid`:
1334
1350
  #
1335
1351
  # * Positive integer: Waits for the child process whose process ID is `pid`:
1336
1352
  #
@@ -1376,7 +1392,7 @@ module Process
1376
1392
  # Process.wait(0) returned pid 225788, which is child 0 pid.
1377
1393
  # Raised Errno::ECHILD, because child 1 process group ID differs from parent process group ID.
1378
1394
  #
1379
- # * `-1` (default): Waits for any child process:
1395
+ # * <code>-1</code> (default): Waits for any child process:
1380
1396
  #
1381
1397
  # parent_pgpid = Process.getpgid(Process.pid)
1382
1398
  # puts "Parent process group ID is #{parent_pgpid}."
@@ -1408,7 +1424,8 @@ module Process
1408
1424
  # true
1409
1425
  # true
1410
1426
  #
1411
- # * Less than `-1`: Waits for any child whose process group ID is `-pid`:
1427
+ # * Less than <code>-1</code>: Waits for any child whose process group ID is
1428
+ # <code>-pid</code>:
1412
1429
  #
1413
1430
  # parent_pgpid = Process.getpgid(Process.pid)
1414
1431
  # puts "Parent process group ID is #{parent_pgpid}."
@@ -1483,13 +1500,14 @@ module Process
1483
1500
  # running applications.
1484
1501
  #
1485
1502
  # This method is expected to be called at the end of the application boot. If
1486
- # the application is deployed using a pre-forking model, `Process.warmup` should
1487
- # be called in the original process before the first fork.
1503
+ # the application is deployed using a pre-forking model,
1504
+ # <code>Process.warmup</code> should be called in the original process before
1505
+ # the first fork.
1488
1506
  #
1489
1507
  # The actual optimizations performed are entirely implementation specific and
1490
1508
  # may change in the future without notice.
1491
1509
  #
1492
- # On CRuby, `Process.warmup`:
1510
+ # On CRuby, <code>Process.warmup</code>:
1493
1511
  #
1494
1512
  # * Performs a major GC.
1495
1513
  # * Compacts the heap.
@@ -1832,9 +1850,9 @@ end
1832
1850
  # <!-- rdoc-file=process.c -->
1833
1851
  # A Process::Status contains information about a system process.
1834
1852
  #
1835
- # Thread-local variable `$?` is initially `nil`. Some methods assign to it a
1836
- # Process::Status object that represents a system process (either running or
1837
- # terminated):
1853
+ # Thread-local variable <code>$?</code> is initially `nil`. Some methods assign
1854
+ # to it a Process::Status object that represents a system process (either
1855
+ # running or terminated):
1838
1856
  #
1839
1857
  # `ruby -e "exit 99"`
1840
1858
  # stat = $? # => #<Process::Status: pid 1262862 exit 99>
@@ -1912,8 +1930,8 @@ class Process::Status < Object
1912
1930
  # rdoc-file=process.c
1913
1931
  # - exited? -> true or false
1914
1932
  # -->
1915
- # Returns `true` if the process exited normally (for example using an `exit()`
1916
- # call or finishing the program), `false` if not.
1933
+ # Returns `true` if the process exited normally (for example using an
1934
+ # <code>exit()</code> call or finishing the program), `false` if not.
1917
1935
  #
1918
1936
  def exited?: () -> bool
1919
1937
 
@@ -2108,8 +2126,8 @@ module Process::Sys
2108
2126
  # - Process::Sys.setregid(rid, eid) -> nil
2109
2127
  # -->
2110
2128
  # Sets the (group) real and/or effective group IDs of the current process to
2111
- # *rid* and *eid*, respectively. A value of `-1` for either means to leave that
2112
- # ID unchanged. Not available on all platforms.
2129
+ # *rid* and *eid*, respectively. A value of <code>-1</code> for either means to
2130
+ # leave that ID unchanged. Not available on all platforms.
2113
2131
  #
2114
2132
  def self.setregid: (Integer rid, Integer eid) -> nil
2115
2133
 
@@ -2118,8 +2136,8 @@ module Process::Sys
2118
2136
  # - Process::Sys.setresgid(rid, eid, sid) -> nil
2119
2137
  # -->
2120
2138
  # Sets the (group) real, effective, and saved user IDs of the current process to
2121
- # *rid*, *eid*, and *sid* respectively. A value of `-1` for any value means to
2122
- # leave that ID unchanged. Not available on all platforms.
2139
+ # *rid*, *eid*, and *sid* respectively. A value of <code>-1</code> for any value
2140
+ # means to leave that ID unchanged. Not available on all platforms.
2123
2141
  #
2124
2142
  def self.setresgid: (Integer rid, Integer eid, Integer sid) -> nil
2125
2143
 
@@ -2128,8 +2146,8 @@ module Process::Sys
2128
2146
  # - Process::Sys.setresuid(rid, eid, sid) -> nil
2129
2147
  # -->
2130
2148
  # Sets the (user) real, effective, and saved user IDs of the current process to
2131
- # *rid*, *eid*, and *sid* respectively. A value of `-1` for any value means to
2132
- # leave that ID unchanged. Not available on all platforms.
2149
+ # *rid*, *eid*, and *sid* respectively. A value of <code>-1</code> for any value
2150
+ # means to leave that ID unchanged. Not available on all platforms.
2133
2151
  #
2134
2152
  def self.setresuid: (Integer rid, Integer eid, Integer sid) -> nil
2135
2153
 
@@ -2138,8 +2156,8 @@ module Process::Sys
2138
2156
  # - Process::Sys.setreuid(rid, eid) -> nil
2139
2157
  # -->
2140
2158
  # Sets the (user) real and/or effective user IDs of the current process to *rid*
2141
- # and *eid*, respectively. A value of `-1` for either means to leave that ID
2142
- # unchanged. Not available on all platforms.
2159
+ # and *eid*, respectively. A value of <code>-1</code> for either means to leave
2160
+ # that ID unchanged. Not available on all platforms.
2143
2161
  #
2144
2162
  def self.setreuid: (Integer rid, Integer eid) -> nil
2145
2163