rbs 2.0.0 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (179) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ruby.yml +5 -0
  3. data/CHANGELOG.md +23 -0
  4. data/README.md +6 -1
  5. data/core/array.rbs +2866 -1086
  6. data/core/basic_object.rbs +150 -30
  7. data/core/binding.rbs +33 -0
  8. data/core/builtin.rbs +4 -4
  9. data/core/class.rbs +43 -5
  10. data/core/comparable.rbs +57 -0
  11. data/core/complex.rbs +170 -4
  12. data/core/constants.rbs +51 -0
  13. data/core/deprecated.rbs +7 -0
  14. data/core/dir.rbs +305 -20
  15. data/core/encoding.rbs +472 -77
  16. data/core/enumerable.rbs +2173 -234
  17. data/core/enumerator.rbs +448 -182
  18. data/core/env.rbs +448 -1
  19. data/core/errno.rbs +1 -10
  20. data/core/errors.rbs +152 -2
  21. data/core/exception.rbs +201 -127
  22. data/core/false_class.rbs +27 -0
  23. data/core/fiber.rbs +118 -37
  24. data/core/fiber_error.rbs +8 -9
  25. data/core/file.rbs +1059 -139
  26. data/core/file_test.rbs +287 -32
  27. data/core/float.rbs +776 -300
  28. data/core/gc.rbs +185 -34
  29. data/core/global_variables.rbs +5 -1
  30. data/core/hash.rbs +1582 -649
  31. data/core/integer.rbs +974 -204
  32. data/core/io/buffer.rbs +710 -0
  33. data/core/io/wait.rbs +29 -8
  34. data/core/io.rbs +2438 -417
  35. data/core/kernel.rbs +2315 -316
  36. data/core/marshal.rbs +37 -2
  37. data/core/match_data.rbs +123 -6
  38. data/core/math.rbs +126 -6
  39. data/core/method.rbs +226 -102
  40. data/core/module.rbs +421 -45
  41. data/core/nil_class.rbs +64 -0
  42. data/core/numeric.rbs +620 -142
  43. data/core/object.rbs +453 -81
  44. data/core/object_space.rbs +92 -2
  45. data/core/proc.rbs +482 -285
  46. data/core/process.rbs +443 -34
  47. data/core/ractor.rbs +232 -9
  48. data/core/random.rbs +151 -52
  49. data/core/range.rbs +885 -160
  50. data/core/rational.rbs +122 -6
  51. data/core/rb_config.rbs +14 -4
  52. data/core/refinement.rbs +44 -0
  53. data/core/regexp.rbs +156 -14
  54. data/core/ruby_vm.rbs +42 -3
  55. data/core/signal.rbs +78 -39
  56. data/core/string.rbs +2123 -567
  57. data/core/string_io.rbs +204 -0
  58. data/core/struct.rbs +283 -28
  59. data/core/symbol.rbs +304 -30
  60. data/core/thread.rbs +1288 -688
  61. data/core/thread_group.rbs +66 -10
  62. data/core/time.rbs +643 -217
  63. data/core/trace_point.rbs +100 -12
  64. data/core/true_class.rbs +24 -0
  65. data/core/unbound_method.rbs +73 -7
  66. data/core/warning.rbs +37 -12
  67. data/docs/CONTRIBUTING.md +40 -34
  68. data/docs/stdlib.md +3 -102
  69. data/lib/rbs/annotate/annotations.rb +197 -0
  70. data/lib/rbs/annotate/formatter.rb +80 -0
  71. data/lib/rbs/annotate/rdoc_annotator.rb +398 -0
  72. data/lib/rbs/annotate/rdoc_source.rb +120 -0
  73. data/lib/rbs/annotate.rb +6 -0
  74. data/lib/rbs/cli.rb +45 -1
  75. data/lib/rbs/definition_builder.rb +5 -1
  76. data/lib/rbs/location_aux.rb +12 -0
  77. data/lib/rbs/prototype/rb.rb +12 -0
  78. data/lib/rbs/version.rb +1 -1
  79. data/sig/annotate/annotations.rbs +102 -0
  80. data/sig/annotate/formatter.rbs +24 -0
  81. data/sig/annotate/rdoc_annotater.rbs +82 -0
  82. data/sig/annotate/rdoc_source.rbs +30 -0
  83. data/sig/cli.rbs +2 -0
  84. data/sig/collection/{collections.rbs → sources.rbs} +0 -0
  85. data/sig/location.rbs +6 -0
  86. data/sig/method_types.rbs +5 -1
  87. data/sig/polyfill.rbs +78 -0
  88. data/stdlib/abbrev/0/abbrev.rbs +6 -0
  89. data/stdlib/abbrev/0/array.rbs +26 -0
  90. data/stdlib/base64/0/base64.rbs +31 -0
  91. data/stdlib/benchmark/0/benchmark.rbs +74 -3
  92. data/stdlib/bigdecimal/0/big_decimal.rbs +614 -165
  93. data/stdlib/bigdecimal-math/0/big_math.rbs +41 -64
  94. data/stdlib/cgi/0/core.rbs +59 -0
  95. data/stdlib/coverage/0/coverage.rbs +164 -2
  96. data/stdlib/csv/0/csv.rbs +2862 -398
  97. data/stdlib/date/0/date.rbs +483 -25
  98. data/stdlib/date/0/date_time.rbs +187 -12
  99. data/stdlib/dbm/0/dbm.rbs +152 -17
  100. data/stdlib/digest/0/digest.rbs +146 -0
  101. data/stdlib/erb/0/erb.rbs +65 -245
  102. data/stdlib/fiber/0/fiber.rbs +73 -91
  103. data/stdlib/fileutils/0/fileutils.rbs +301 -1
  104. data/stdlib/find/0/find.rbs +9 -0
  105. data/stdlib/forwardable/0/forwardable.rbs +65 -1
  106. data/stdlib/io-console/0/io-console.rbs +227 -15
  107. data/stdlib/ipaddr/0/ipaddr.rbs +161 -0
  108. data/stdlib/json/0/json.rbs +1146 -144
  109. data/stdlib/logger/0/formatter.rbs +24 -0
  110. data/stdlib/logger/0/log_device.rbs +64 -0
  111. data/stdlib/logger/0/logger.rbs +165 -13
  112. data/stdlib/logger/0/period.rbs +10 -0
  113. data/stdlib/logger/0/severity.rbs +26 -0
  114. data/stdlib/monitor/0/monitor.rbs +163 -0
  115. data/stdlib/mutex_m/0/mutex_m.rbs +35 -6
  116. data/stdlib/net-http/0/net-http.rbs +1492 -683
  117. data/stdlib/nkf/0/nkf.rbs +372 -0
  118. data/stdlib/objspace/0/objspace.rbs +149 -90
  119. data/stdlib/openssl/0/openssl.rbs +8108 -71
  120. data/stdlib/optparse/0/optparse.rbs +487 -19
  121. data/stdlib/pathname/0/pathname.rbs +425 -124
  122. data/stdlib/prettyprint/0/prettyprint.rbs +120 -99
  123. data/stdlib/prime/0/integer-extension.rbs +20 -2
  124. data/stdlib/prime/0/prime.rbs +88 -21
  125. data/stdlib/pstore/0/pstore.rbs +102 -0
  126. data/stdlib/pty/0/pty.rbs +64 -14
  127. data/stdlib/resolv/0/resolv.rbs +420 -31
  128. data/stdlib/rubygems/0/basic_specification.rbs +4 -1
  129. data/stdlib/rubygems/0/config_file.rbs +33 -1
  130. data/stdlib/rubygems/0/dependency_installer.rbs +4 -3
  131. data/stdlib/rubygems/0/installer.rbs +13 -1
  132. data/stdlib/rubygems/0/path_support.rbs +4 -1
  133. data/stdlib/rubygems/0/platform.rbs +5 -1
  134. data/stdlib/rubygems/0/request_set.rbs +44 -2
  135. data/stdlib/rubygems/0/requirement.rbs +65 -2
  136. data/stdlib/rubygems/0/rubygems.rbs +407 -0
  137. data/stdlib/rubygems/0/source_list.rbs +13 -0
  138. data/stdlib/rubygems/0/specification.rbs +21 -1
  139. data/stdlib/rubygems/0/stream_ui.rbs +3 -1
  140. data/stdlib/rubygems/0/uninstaller.rbs +8 -1
  141. data/stdlib/rubygems/0/version.rbs +60 -157
  142. data/stdlib/securerandom/0/securerandom.rbs +44 -0
  143. data/stdlib/set/0/set.rbs +420 -106
  144. data/stdlib/shellwords/0/shellwords.rbs +55 -77
  145. data/stdlib/singleton/0/singleton.rbs +20 -0
  146. data/stdlib/socket/0/addrinfo.rbs +210 -9
  147. data/stdlib/socket/0/basic_socket.rbs +103 -11
  148. data/stdlib/socket/0/ip_socket.rbs +31 -9
  149. data/stdlib/socket/0/socket.rbs +586 -38
  150. data/stdlib/socket/0/tcp_server.rbs +22 -2
  151. data/stdlib/socket/0/tcp_socket.rbs +12 -1
  152. data/stdlib/socket/0/udp_socket.rbs +25 -2
  153. data/stdlib/socket/0/unix_server.rbs +22 -2
  154. data/stdlib/socket/0/unix_socket.rbs +45 -5
  155. data/stdlib/strscan/0/string_scanner.rbs +210 -9
  156. data/stdlib/tempfile/0/tempfile.rbs +58 -10
  157. data/stdlib/time/0/time.rbs +208 -116
  158. data/stdlib/timeout/0/timeout.rbs +10 -0
  159. data/stdlib/tmpdir/0/tmpdir.rbs +13 -4
  160. data/stdlib/tsort/0/cyclic.rbs +1 -0
  161. data/stdlib/tsort/0/interfaces.rbs +1 -0
  162. data/stdlib/tsort/0/tsort.rbs +42 -0
  163. data/stdlib/uri/0/common.rbs +57 -8
  164. data/stdlib/uri/0/file.rbs +55 -109
  165. data/stdlib/uri/0/ftp.rbs +6 -3
  166. data/stdlib/uri/0/generic.rbs +556 -327
  167. data/stdlib/uri/0/http.rbs +26 -115
  168. data/stdlib/uri/0/https.rbs +8 -102
  169. data/stdlib/uri/0/ldap.rbs +143 -137
  170. data/stdlib/uri/0/ldaps.rbs +8 -102
  171. data/stdlib/uri/0/mailto.rbs +3 -0
  172. data/stdlib/uri/0/rfc2396_parser.rbs +66 -26
  173. data/stdlib/uri/0/ws.rbs +6 -3
  174. data/stdlib/uri/0/wss.rbs +5 -3
  175. data/stdlib/yaml/0/dbm.rbs +151 -87
  176. data/stdlib/yaml/0/store.rbs +6 -0
  177. data/stdlib/zlib/0/zlib.rbs +90 -31
  178. metadata +17 -5
  179. data/lib/rbs/location.rb +0 -221
data/core/process.rbs CHANGED
@@ -1,3 +1,4 @@
1
+ # <!-- rdoc-file=process.c -->
1
2
  # The module contains several groups of functionality for handling OS processes:
2
3
  #
3
4
  # * Low-level property introspection and management of the current process,
@@ -13,8 +14,24 @@
13
14
  # Process.clock_gettime, which could be important for proper benchmarking
14
15
  # and other elapsed time measurement tasks.
15
16
  #
16
- #
17
17
  module Process
18
+ # <!--
19
+ # rdoc-file=process.c
20
+ # - Process._fork -> integer
21
+ # -->
22
+ # An internal API for fork. Do not call this method directly. Currently, this is
23
+ # called via Kernel#fork, Process.fork, and IO.popen with `"-"`.
24
+ #
25
+ # This method is not for casual code but for application monitoring libraries.
26
+ # You can add custom code before and after fork events by overriding this
27
+ # method.
28
+ #
29
+ def self._fork: () -> Integer
30
+
31
+ # <!--
32
+ # rdoc-file=ruby.c
33
+ # - Process.argv0 -> frozen_string
34
+ # -->
18
35
  # Returns the name of the script being executed. The value is not affected by
19
36
  # assigning a new value to $0.
20
37
  #
@@ -23,27 +40,35 @@ module Process
23
40
  #
24
41
  def self.argv0: () -> String
25
42
 
26
- # Returns the time resolution returned by POSIX clock_getres() function.
43
+ # <!--
44
+ # rdoc-file=process.c
45
+ # - Process.clock_getres(clock_id [, unit]) -> number
46
+ # -->
47
+ # Returns an estimate of the resolution of a `clock_id` using the POSIX
48
+ # `clock_getres()` function.
27
49
  #
28
- # `clock_id` specifies a kind of clock. See the document of
29
- # `Process.clock_gettime` for details.
50
+ # Note the reported resolution is often inaccurate on most platforms due to
51
+ # underlying bugs for this function and therefore the reported resolution often
52
+ # differs from the actual resolution of the clock in practice. Inaccurate
53
+ # reported resolutions have been observed for various clocks including
54
+ # CLOCK_MONOTONIC and CLOCK_MONOTONIC_RAW when using Linux, macOS, BSD or AIX
55
+ # platforms, when using ARM processors, or when using virtualization.
30
56
  #
31
- # `clock_id` can be a symbol as `Process.clock_gettime`. However the result may
32
- # not be accurate. For example,
33
- # `Process.clock_getres(:GETTIMEOFDAY_BASED_CLOCK_REALTIME)` returns 1.0e-06
34
- # which means 1 microsecond, but actual resolution can be more coarse.
57
+ # `clock_id` specifies a kind of clock. See the document of
58
+ # `Process.clock_gettime` for details. `clock_id` can be a symbol as for
59
+ # `Process.clock_gettime`.
35
60
  #
36
61
  # If the given `clock_id` is not supported, Errno::EINVAL is raised.
37
62
  #
38
- # `unit` specifies a type of the return value. `Process.clock_getres` accepts
63
+ # `unit` specifies the type of the return value. `Process.clock_getres` accepts
39
64
  # `unit` as `Process.clock_gettime`. The default value, `:float_second`, is also
40
- # same as `Process.clock_gettime`.
65
+ # the same as `Process.clock_gettime`.
41
66
  #
42
- # `Process.clock_getres` also accepts `:hertz` as `unit`. `:hertz` means a the
67
+ # `Process.clock_getres` also accepts `:hertz` as `unit`. `:hertz` means the
43
68
  # reciprocal of `:float_second`.
44
69
  #
45
70
  # `:hertz` can be used to obtain the exact value of the clock ticks per second
46
- # for times() function and CLOCKS_PER_SEC for clock() function.
71
+ # for the times() function and CLOCKS_PER_SEC for the clock() function.
47
72
  #
48
73
  # `Process.clock_getres(:TIMES_BASED_CLOCK_PROCESS_CPUTIME_ID, :hertz)` returns
49
74
  # the clock ticks per second.
@@ -56,6 +81,10 @@ module Process
56
81
  #
57
82
  def self.clock_getres: (Symbol | Integer clock_id, ?Symbol unit) -> (Float | Integer)
58
83
 
84
+ # <!--
85
+ # rdoc-file=process.c
86
+ # - Process.clock_gettime(clock_id [, unit]) -> number
87
+ # -->
59
88
  # Returns a time returned by POSIX clock_gettime() function.
60
89
  #
61
90
  # p Process.clock_gettime(Process::CLOCK_MONOTONIC)
@@ -70,10 +99,10 @@ module Process
70
99
  #
71
100
  # CLOCK_REALTIME
72
101
  # : SUSv2 to 4, Linux 2.5.63, FreeBSD 3.0, NetBSD 2.0, OpenBSD 2.1, macOS
73
- # 10.12
102
+ # 10.12, Windows-8/Server-2012
74
103
  # CLOCK_MONOTONIC
75
104
  # : SUSv3 to 4, Linux 2.5.63, FreeBSD 3.0, NetBSD 2.0, OpenBSD 3.4, macOS
76
- # 10.12
105
+ # 10.12, Windows-2000
77
106
  # CLOCK_PROCESS_CPUTIME_ID
78
107
  # : SUSv3 to 4, Linux 2.5.63, FreeBSD 9.3, OpenBSD 5.4, macOS 10.12
79
108
  # CLOCK_THREAD_CPUTIME_ID
@@ -211,8 +240,15 @@ module Process
211
240
  # can be interpreted differently across systems. Time.now is recommended over
212
241
  # CLOCK_REALTIME.
213
242
  #
214
- def self.clock_gettime: (Symbol | Integer clock_id, ?Symbol unit) -> (Float | Integer)
243
+ def self.clock_gettime: (Symbol | Integer clock_id) -> Float
244
+ | (Symbol | Integer clock_id, :float_second | :float_millisecond | :float_microsecond unit) -> Float
245
+ | (Symbol | Integer clock_id, :second | :millisecond | :microsecond | :nanosecond unit) -> Integer
215
246
 
247
+ # <!--
248
+ # rdoc-file=process.c
249
+ # - Process.daemon() -> 0
250
+ # - Process.daemon(nochdir=nil,noclose=nil) -> 0
251
+ # -->
216
252
  # Detach the process from controlling terminal and run in the background as
217
253
  # system daemon. Unless the argument nochdir is true (i.e. non false), it
218
254
  # changes the current working directory to the root ("/"). Unless the argument
@@ -221,6 +257,10 @@ module Process
221
257
  #
222
258
  def self.daemon: (?untyped nochdir, ?untyped noclose) -> Integer
223
259
 
260
+ # <!--
261
+ # rdoc-file=process.c
262
+ # - Process.detach(pid) -> thread
263
+ # -->
224
264
  # Some operating systems retain the status of terminated child processes until
225
265
  # the parent collects that status (normally using some variant of `wait()`). If
226
266
  # the parent never collects this status, the child stays around as a *zombie*
@@ -261,6 +301,12 @@ module Process
261
301
  #
262
302
  def self.detach: (Integer pid) -> Thread
263
303
 
304
+ # <!--
305
+ # rdoc-file=process.c
306
+ # - Process.egid -> integer
307
+ # - Process::GID.eid -> integer
308
+ # - Process::Sys.geteid -> integer
309
+ # -->
264
310
  # Returns the effective group ID for this process. Not available on all
265
311
  # platforms.
266
312
  #
@@ -268,20 +314,38 @@ module Process
268
314
  #
269
315
  def self.egid: () -> Integer
270
316
 
317
+ # <!--
318
+ # rdoc-file=process.c
319
+ # - Process.egid = integer -> integer
320
+ # -->
271
321
  # Sets the effective group ID for this process. Not available on all platforms.
272
322
  #
273
323
  def self.egid=: (Integer arg0) -> Integer
274
324
 
325
+ # <!--
326
+ # rdoc-file=process.c
327
+ # - Process.euid -> integer
328
+ # - Process::UID.eid -> integer
329
+ # - Process::Sys.geteuid -> integer
330
+ # -->
275
331
  # Returns the effective user ID for this process.
276
332
  #
277
333
  # Process.euid #=> 501
278
334
  #
279
335
  def self.euid: () -> Integer
280
336
 
337
+ # <!--
338
+ # rdoc-file=process.c
339
+ # - Process.euid= user
340
+ # -->
281
341
  # Sets the effective user ID for this process. Not available on all platforms.
282
342
  #
283
343
  def self.euid=: (Integer arg0) -> Integer
284
344
 
345
+ # <!--
346
+ # rdoc-file=process.c
347
+ # - Process.getpgid(pid) -> integer
348
+ # -->
285
349
  # Returns the process group ID for the given process id. Not available on all
286
350
  # platforms.
287
351
  #
@@ -289,6 +353,10 @@ module Process
289
353
  #
290
354
  def self.getpgid: (Integer pid) -> Integer
291
355
 
356
+ # <!--
357
+ # rdoc-file=process.c
358
+ # - Process.getpgrp -> integer
359
+ # -->
292
360
  # Returns the process group ID for this process. Not available on all platforms.
293
361
  #
294
362
  # Process.getpgid(0) #=> 25527
@@ -296,6 +364,10 @@ module Process
296
364
  #
297
365
  def self.getpgrp: () -> Integer
298
366
 
367
+ # <!--
368
+ # rdoc-file=process.c
369
+ # - Process.getpriority(kind, integer) -> integer
370
+ # -->
299
371
  # Gets the scheduling priority for specified process, process group, or user.
300
372
  # *kind* indicates the kind of entity to find: one of Process::PRIO_PGRP,
301
373
  # Process::PRIO_USER, or Process::PRIO_PROCESS. *integer* is an id indicating
@@ -308,6 +380,10 @@ module Process
308
380
  #
309
381
  def self.getpriority: (Integer kind, Integer arg0) -> Integer
310
382
 
383
+ # <!--
384
+ # rdoc-file=process.c
385
+ # - Process.getrlimit(resource) -> [cur_limit, max_limit]
386
+ # -->
311
387
  # Gets the resource limit of the process. *cur_limit* means current (soft) limit
312
388
  # and *max_limit* means maximum (hard) limit.
313
389
  #
@@ -321,6 +397,11 @@ module Process
321
397
  #
322
398
  def self.getrlimit: (Symbol | String | Integer resource) -> [ Integer, Integer ]
323
399
 
400
+ # <!--
401
+ # rdoc-file=process.c
402
+ # - Process.getsid() -> integer
403
+ # - Process.getsid(pid) -> integer
404
+ # -->
324
405
  # Returns the session ID for the given process id. If not given, return current
325
406
  # process sid. Not available on all platforms.
326
407
  #
@@ -330,16 +411,30 @@ module Process
330
411
  #
331
412
  def self.getsid: (?Integer pid) -> Integer
332
413
 
414
+ # <!--
415
+ # rdoc-file=process.c
416
+ # - Process.gid -> integer
417
+ # - Process::GID.rid -> integer
418
+ # - Process::Sys.getgid -> integer
419
+ # -->
333
420
  # Returns the (real) group ID for this process.
334
421
  #
335
422
  # Process.gid #=> 500
336
423
  #
337
424
  def self.gid: () -> Integer
338
425
 
426
+ # <!--
427
+ # rdoc-file=process.c
428
+ # - Process.gid= integer -> integer
429
+ # -->
339
430
  # Sets the group ID for this process.
340
431
  #
341
432
  def self.gid=: (Integer arg0) -> Integer
342
433
 
434
+ # <!--
435
+ # rdoc-file=process.c
436
+ # - Process.groups -> array
437
+ # -->
343
438
  # Get an Array of the group IDs in the supplemental group access list for this
344
439
  # process.
345
440
  #
@@ -360,6 +455,10 @@ module Process
360
455
  #
361
456
  def self.groups: () -> ::Array[Integer]
362
457
 
458
+ # <!--
459
+ # rdoc-file=process.c
460
+ # - Process.groups= array -> array
461
+ # -->
363
462
  # Set the supplemental group access list to the given Array of group IDs.
364
463
  #
365
464
  # Process.groups #=> [0, 1, 2, 3, 4, 6, 10, 11, 20, 26, 27]
@@ -368,6 +467,10 @@ module Process
368
467
  #
369
468
  def self.groups=: (::Array[Integer] arg0) -> ::Array[Integer]
370
469
 
470
+ # <!--
471
+ # rdoc-file=process.c
472
+ # - Process.initgroups(username, gid) -> array
473
+ # -->
371
474
  # Initializes the supplemental group access list by reading the system group
372
475
  # database and using all groups of which the given user is a member. The group
373
476
  # with the specified *gid* is also added to the list. Returns the resulting
@@ -380,6 +483,10 @@ module Process
380
483
  #
381
484
  def self.initgroups: (String username, Integer gid) -> ::Array[Integer]
382
485
 
486
+ # <!--
487
+ # rdoc-file=process.c
488
+ # - Process.kill(signal, pid, ...) -> integer
489
+ # -->
383
490
  # Sends the given signal to the specified process id(s) if *pid* is positive. If
384
491
  # *pid* is zero, *signal* is sent to all processes whose group ID is equal to
385
492
  # the group ID of the process. If *pid* is negative, results are dependent on
@@ -411,6 +518,10 @@ module Process
411
518
  #
412
519
  def self.kill: (Integer | Symbol | String signal, *Integer pids) -> Integer
413
520
 
521
+ # <!--
522
+ # rdoc-file=process.c
523
+ # - Process.maxgroups -> integer
524
+ # -->
414
525
  # Returns the maximum number of gids allowed in the supplemental group access
415
526
  # list.
416
527
  #
@@ -418,16 +529,28 @@ module Process
418
529
  #
419
530
  def self.maxgroups: () -> Integer
420
531
 
532
+ # <!--
533
+ # rdoc-file=process.c
534
+ # - Process.maxgroups= integer -> integer
535
+ # -->
421
536
  # Sets the maximum number of gids allowed in the supplemental group access list.
422
537
  #
423
538
  def self.maxgroups=: (Integer arg0) -> Integer
424
539
 
540
+ # <!--
541
+ # rdoc-file=process.c
542
+ # - Process.pid -> integer
543
+ # -->
425
544
  # Returns the process id of this process. Not available on all platforms.
426
545
  #
427
546
  # Process.pid #=> 27415
428
547
  #
429
548
  def self.pid: () -> Integer
430
549
 
550
+ # <!--
551
+ # rdoc-file=process.c
552
+ # - Process.ppid -> integer
553
+ # -->
431
554
  # Returns the process id of the parent of this process. Returns untrustworthy
432
555
  # value on Win32/64. Not available on all platforms.
433
556
  #
@@ -441,11 +564,19 @@ module Process
441
564
  #
442
565
  def self.ppid: () -> Integer
443
566
 
567
+ # <!--
568
+ # rdoc-file=process.c
569
+ # - Process.setpgid(pid, integer) -> 0
570
+ # -->
444
571
  # Sets the process group ID of *pid* (0 indicates this process) to *integer*.
445
572
  # Not available on all platforms.
446
573
  #
447
574
  def self.setpgid: (Integer pid, Integer arg0) -> Integer
448
575
 
576
+ # <!--
577
+ # rdoc-file=process.c
578
+ # - Process.setpriority(kind, integer, priority) -> 0
579
+ # -->
449
580
  # See Process.getpriority.
450
581
  #
451
582
  # Process.setpriority(Process::PRIO_USER, 0, 19) #=> 0
@@ -455,6 +586,10 @@ module Process
455
586
  #
456
587
  def self.setpriority: (Integer kind, Integer arg0, Integer priority) -> Integer
457
588
 
589
+ # <!--
590
+ # rdoc-file=ruby.c
591
+ # - Process.setproctitle(string) -> string
592
+ # -->
458
593
  # Sets the process title that appears on the ps(1) command. Not necessarily
459
594
  # effective on all platforms. No exception will be raised regardless of the
460
595
  # result, nor will NotImplementedError be raised even if the platform does not
@@ -469,6 +604,11 @@ module Process
469
604
  #
470
605
  def self.setproctitle: (String arg0) -> String
471
606
 
607
+ # <!--
608
+ # rdoc-file=process.c
609
+ # - Process.setrlimit(resource, cur_limit, max_limit) -> nil
610
+ # - Process.setrlimit(resource, cur_limit) -> nil
611
+ # -->
472
612
  # Sets the resource limit of the process. *cur_limit* means current (soft) limit
473
613
  # and *max_limit* means maximum (hard) limit.
474
614
  #
@@ -526,6 +666,10 @@ module Process
526
666
  #
527
667
  def self.setrlimit: (Symbol | String | Integer resource, Integer cur_limit, ?Integer max_limit) -> nil
528
668
 
669
+ # <!--
670
+ # rdoc-file=process.c
671
+ # - Process.setsid -> integer
672
+ # -->
529
673
  # Establishes this process as a new session and process group leader, with no
530
674
  # controlling tty. Returns the session id. Not available on all platforms.
531
675
  #
@@ -533,6 +677,10 @@ module Process
533
677
  #
534
678
  def self.setsid: () -> Integer
535
679
 
680
+ # <!--
681
+ # rdoc-file=process.c
682
+ # - Process.times -> aProcessTms
683
+ # -->
536
684
  # Returns a `Tms` structure (see Process::Tms) that contains user and system CPU
537
685
  # times for this process, and also for children processes.
538
686
  #
@@ -541,16 +689,32 @@ module Process
541
689
  #
542
690
  def self.times: () -> Process::Tms
543
691
 
692
+ # <!--
693
+ # rdoc-file=process.c
694
+ # - Process.uid -> integer
695
+ # - Process::UID.rid -> integer
696
+ # - Process::Sys.getuid -> integer
697
+ # -->
544
698
  # Returns the (real) user ID of this process.
545
699
  #
546
700
  # Process.uid #=> 501
547
701
  #
548
702
  def self.uid: () -> Integer
549
703
 
704
+ # <!--
705
+ # rdoc-file=process.c
706
+ # - Process.uid= user -> numeric
707
+ # -->
550
708
  # Sets the (user) user ID for this process. Not available on all platforms.
551
709
  #
552
710
  def self.uid=: (Integer user) -> Integer
553
711
 
712
+ # <!--
713
+ # rdoc-file=process.c
714
+ # - Process.wait() -> integer
715
+ # - Process.wait(pid=-1, flags=0) -> integer
716
+ # - Process.waitpid(pid=-1, flags=0) -> integer
717
+ # -->
554
718
  # Waits for a child process to exit, returns its process id, and sets `$?` to a
555
719
  # Process::Status object containing information on that process. Which child it
556
720
  # waits on depends on the value of *pid*:
@@ -592,6 +756,11 @@ module Process
592
756
  #
593
757
  def self.wait: (?Integer pid, ?Integer flags) -> Integer
594
758
 
759
+ # <!--
760
+ # rdoc-file=process.c
761
+ # - Process.wait2(pid=-1, flags=0) -> [pid, status]
762
+ # - Process.waitpid2(pid=-1, flags=0) -> [pid, status]
763
+ # -->
595
764
  # Waits for a child process to exit (see Process::waitpid for exact semantics)
596
765
  # and returns an array containing the process id and the exit status (a
597
766
  # Process::Status object) of that child. Raises a SystemCallError if there are
@@ -604,6 +773,10 @@ module Process
604
773
  #
605
774
  def self.wait2: (?Integer pid, ?Integer flags) -> [ Integer, Process::Status ]
606
775
 
776
+ # <!--
777
+ # rdoc-file=process.c
778
+ # - Process.waitall -> [ [pid1,status1], ...]
779
+ # -->
607
780
  # Waits for all children, returning an array of *pid*/*status* pairs (where
608
781
  # *status* is a Process::Status object).
609
782
  #
@@ -620,6 +793,12 @@ module Process
620
793
  #
621
794
  def self.waitall: () -> ::Array[[ Integer, Process::Status ]]
622
795
 
796
+ # <!--
797
+ # rdoc-file=process.c
798
+ # - Process.wait() -> integer
799
+ # - Process.wait(pid=-1, flags=0) -> integer
800
+ # - Process.waitpid(pid=-1, flags=0) -> integer
801
+ # -->
623
802
  # Waits for a child process to exit, returns its process id, and sets `$?` to a
624
803
  # Process::Status object containing information on that process. Which child it
625
804
  # waits on depends on the value of *pid*:
@@ -661,6 +840,11 @@ module Process
661
840
  #
662
841
  def self.waitpid: (?Integer pid, ?Integer flags) -> Integer
663
842
 
843
+ # <!--
844
+ # rdoc-file=process.c
845
+ # - Process.wait2(pid=-1, flags=0) -> [pid, status]
846
+ # - Process.waitpid2(pid=-1, flags=0) -> [pid, status]
847
+ # -->
664
848
  # Waits for a child process to exit (see Process::waitpid for exact semantics)
665
849
  # and returns an array containing the process id and the exit status (a
666
850
  # Process::Status object) of that child. Raises a SystemCallError if there are
@@ -674,107 +858,114 @@ module Process
674
858
  def self.waitpid2: (?Integer pid, ?Integer flags) -> [ Integer, Process::Status ]
675
859
  end
676
860
 
861
+ # <!-- rdoc-file=process.c -->
677
862
  # see Process.clock_gettime
678
863
  #
679
- #
680
864
  Process::CLOCK_BOOTTIME: Integer
681
865
 
866
+ # <!-- rdoc-file=process.c -->
682
867
  # see Process.clock_gettime
683
868
  #
684
- #
685
869
  Process::CLOCK_BOOTTIME_ALARM: Integer
686
870
 
871
+ # <!-- rdoc-file=process.c -->
687
872
  # see Process.clock_gettime
688
873
  #
689
- #
690
874
  Process::CLOCK_MONOTONIC: Integer
691
875
 
876
+ # <!-- rdoc-file=process.c -->
692
877
  # see Process.clock_gettime
693
878
  #
694
- #
695
879
  Process::CLOCK_MONOTONIC_COARSE: Integer
696
880
 
881
+ # <!-- rdoc-file=process.c -->
697
882
  # see Process.clock_gettime
698
883
  #
699
- #
700
884
  Process::CLOCK_MONOTONIC_RAW: Integer
701
885
 
886
+ # <!-- rdoc-file=process.c -->
702
887
  # see Process.clock_gettime
703
888
  #
704
- #
705
889
  Process::CLOCK_PROCESS_CPUTIME_ID: Integer
706
890
 
891
+ # <!-- rdoc-file=process.c -->
707
892
  # see Process.clock_gettime
708
893
  #
709
- #
710
894
  Process::CLOCK_REALTIME: Integer
711
895
 
896
+ # <!-- rdoc-file=process.c -->
712
897
  # see Process.clock_gettime
713
898
  #
714
- #
715
899
  Process::CLOCK_REALTIME_ALARM: Integer
716
900
 
901
+ # <!-- rdoc-file=process.c -->
717
902
  # see Process.clock_gettime
718
903
  #
719
- #
720
904
  Process::CLOCK_REALTIME_COARSE: Integer
721
905
 
906
+ # <!-- rdoc-file=process.c -->
722
907
  # see Process.clock_gettime
723
908
  #
724
- #
725
909
  Process::CLOCK_THREAD_CPUTIME_ID: Integer
726
910
 
911
+ # <!-- rdoc-file=process.c -->
727
912
  # see Process.setpriority
728
913
  #
729
- #
730
914
  Process::PRIO_PGRP: Integer
731
915
 
916
+ # <!-- rdoc-file=process.c -->
732
917
  # see Process.setpriority
733
918
  #
734
- #
735
919
  Process::PRIO_PROCESS: Integer
736
920
 
921
+ # <!-- rdoc-file=process.c -->
737
922
  # see Process.setpriority
738
923
  #
739
- #
740
924
  Process::PRIO_USER: Integer
741
925
 
926
+ # <!-- rdoc-file=process.c -->
742
927
  # Maximum size of the process's virtual memory (address space) in bytes.
743
928
  #
744
929
  # see the system getrlimit(2) manual for details.
745
930
  #
746
931
  Process::RLIMIT_AS: Integer
747
932
 
933
+ # <!-- rdoc-file=process.c -->
748
934
  # Maximum size of the core file.
749
935
  #
750
936
  # see the system getrlimit(2) manual for details.
751
937
  #
752
938
  Process::RLIMIT_CORE: Integer
753
939
 
940
+ # <!-- rdoc-file=process.c -->
754
941
  # CPU time limit in seconds.
755
942
  #
756
943
  # see the system getrlimit(2) manual for details.
757
944
  #
758
945
  Process::RLIMIT_CPU: Integer
759
946
 
947
+ # <!-- rdoc-file=process.c -->
760
948
  # Maximum size of the process's data segment.
761
949
  #
762
950
  # see the system getrlimit(2) manual for details.
763
951
  #
764
952
  Process::RLIMIT_DATA: Integer
765
953
 
954
+ # <!-- rdoc-file=process.c -->
766
955
  # Maximum size of files that the process may create.
767
956
  #
768
957
  # see the system getrlimit(2) manual for details.
769
958
  #
770
959
  Process::RLIMIT_FSIZE: Integer
771
960
 
961
+ # <!-- rdoc-file=process.c -->
772
962
  # Maximum number of bytes of memory that may be locked into RAM.
773
963
  #
774
964
  # see the system getrlimit(2) manual for details.
775
965
  #
776
966
  Process::RLIMIT_MEMLOCK: Integer
777
967
 
968
+ # <!-- rdoc-file=process.c -->
778
969
  # Specifies the limit on the number of bytes that can be allocated for POSIX
779
970
  # message queues for the real user ID of the calling process.
780
971
  #
@@ -782,12 +973,14 @@ Process::RLIMIT_MEMLOCK: Integer
782
973
  #
783
974
  Process::RLIMIT_MSGQUEUE: Integer
784
975
 
976
+ # <!-- rdoc-file=process.c -->
785
977
  # Specifies a ceiling to which the process's nice value can be raised.
786
978
  #
787
979
  # see the system getrlimit(2) manual for details.
788
980
  #
789
981
  Process::RLIMIT_NICE: Integer
790
982
 
983
+ # <!-- rdoc-file=process.c -->
791
984
  # Specifies a value one greater than the maximum file descriptor number that can
792
985
  # be opened by this process.
793
986
  #
@@ -795,6 +988,7 @@ Process::RLIMIT_NICE: Integer
795
988
  #
796
989
  Process::RLIMIT_NOFILE: Integer
797
990
 
991
+ # <!-- rdoc-file=process.c -->
798
992
  # The maximum number of processes that can be created for the real user ID of
799
993
  # the calling process.
800
994
  #
@@ -802,12 +996,14 @@ Process::RLIMIT_NOFILE: Integer
802
996
  #
803
997
  Process::RLIMIT_NPROC: Integer
804
998
 
999
+ # <!-- rdoc-file=process.c -->
805
1000
  # Specifies the limit (in pages) of the process's resident set.
806
1001
  #
807
1002
  # see the system getrlimit(2) manual for details.
808
1003
  #
809
1004
  Process::RLIMIT_RSS: Integer
810
1005
 
1006
+ # <!-- rdoc-file=process.c -->
811
1007
  # Specifies a ceiling on the real-time priority that may be set for this
812
1008
  # process.
813
1009
  #
@@ -815,6 +1011,7 @@ Process::RLIMIT_RSS: Integer
815
1011
  #
816
1012
  Process::RLIMIT_RTPRIO: Integer
817
1013
 
1014
+ # <!-- rdoc-file=process.c -->
818
1015
  # Specifies limit on CPU time this process scheduled under a real-time
819
1016
  # scheduling policy can consume.
820
1017
  #
@@ -822,6 +1019,7 @@ Process::RLIMIT_RTPRIO: Integer
822
1019
  #
823
1020
  Process::RLIMIT_RTTIME: Integer
824
1021
 
1022
+ # <!-- rdoc-file=process.c -->
825
1023
  # Specifies a limit on the number of signals that may be queued for the real
826
1024
  # user ID of the calling process.
827
1025
  #
@@ -829,42 +1027,48 @@ Process::RLIMIT_RTTIME: Integer
829
1027
  #
830
1028
  Process::RLIMIT_SIGPENDING: Integer
831
1029
 
1030
+ # <!-- rdoc-file=process.c -->
832
1031
  # Maximum size of the stack, in bytes.
833
1032
  #
834
1033
  # see the system getrlimit(2) manual for details.
835
1034
  #
836
1035
  Process::RLIMIT_STACK: Integer
837
1036
 
1037
+ # <!-- rdoc-file=process.c -->
838
1038
  # see Process.setrlimit
839
1039
  #
840
- #
841
1040
  Process::RLIM_INFINITY: Integer
842
1041
 
1042
+ # <!-- rdoc-file=process.c -->
843
1043
  # see Process.setrlimit
844
1044
  #
845
- #
846
1045
  Process::RLIM_SAVED_CUR: Integer
847
1046
 
1047
+ # <!-- rdoc-file=process.c -->
848
1048
  # see Process.setrlimit
849
1049
  #
850
- #
851
1050
  Process::RLIM_SAVED_MAX: Integer
852
1051
 
1052
+ # <!-- rdoc-file=process.c -->
853
1053
  # see Process.wait
854
1054
  #
855
- #
856
1055
  Process::WNOHANG: Integer
857
1056
 
1057
+ # <!-- rdoc-file=process.c -->
858
1058
  # see Process.wait
859
1059
  #
860
- #
861
1060
  Process::WUNTRACED: Integer
862
1061
 
1062
+ # <!-- rdoc-file=process.c -->
863
1063
  # The Process::GID module contains a collection of module functions which can be
864
1064
  # used to portably get, set, and switch the current process's real, effective,
865
1065
  # and saved group IDs.
866
1066
  #
867
1067
  module Process::GID
1068
+ # <!--
1069
+ # rdoc-file=process.c
1070
+ # - Process::GID.change_privilege(group) -> integer
1071
+ # -->
868
1072
  # Change the current process's real and effective group ID to that specified by
869
1073
  # *group*. Returns the new group ID. Not available on all platforms.
870
1074
  #
@@ -874,6 +1078,12 @@ module Process::GID
874
1078
  #
875
1079
  def self.change_privilege: (Integer group) -> Integer
876
1080
 
1081
+ # <!--
1082
+ # rdoc-file=process.c
1083
+ # - Process.egid -> integer
1084
+ # - Process::GID.eid -> integer
1085
+ # - Process::Sys.geteid -> integer
1086
+ # -->
877
1087
  # Returns the effective group ID for this process. Not available on all
878
1088
  # platforms.
879
1089
  #
@@ -881,6 +1091,10 @@ module Process::GID
881
1091
  #
882
1092
  def self.eid: () -> Integer
883
1093
 
1094
+ # <!--
1095
+ # rdoc-file=process.c
1096
+ # - Process::GID.from_name(name) -> gid
1097
+ # -->
884
1098
  # Get the group ID by the *name*. If the group is not found, `ArgumentError`
885
1099
  # will be raised.
886
1100
  #
@@ -889,6 +1103,11 @@ module Process::GID
889
1103
  #
890
1104
  def self.from_name: (String name) -> Integer
891
1105
 
1106
+ # <!--
1107
+ # rdoc-file=process.c
1108
+ # - Process::GID.grant_privilege(group) -> integer
1109
+ # - Process::GID.eid = group -> integer
1110
+ # -->
892
1111
  # Set the effective group ID, and if possible, the saved group ID of the process
893
1112
  # to the given *group*. Returns the new effective group ID. Not available on all
894
1113
  # platforms.
@@ -899,6 +1118,10 @@ module Process::GID
899
1118
  #
900
1119
  def self.grant_privilege: (Integer group) -> Integer
901
1120
 
1121
+ # <!--
1122
+ # rdoc-file=process.c
1123
+ # - Process::GID.re_exchange -> integer
1124
+ # -->
902
1125
  # Exchange real and effective group IDs and return the new effective group ID.
903
1126
  # Not available on all platforms.
904
1127
  #
@@ -908,21 +1131,40 @@ module Process::GID
908
1131
  #
909
1132
  def self.re_exchange: () -> Integer
910
1133
 
1134
+ # <!--
1135
+ # rdoc-file=process.c
1136
+ # - Process::GID.re_exchangeable? -> true or false
1137
+ # -->
911
1138
  # Returns `true` if the real and effective group IDs of a process may be
912
1139
  # exchanged on the current platform.
913
1140
  #
914
1141
  def self.re_exchangeable?: () -> bool
915
1142
 
1143
+ # <!--
1144
+ # rdoc-file=process.c
1145
+ # - Process.gid -> integer
1146
+ # - Process::GID.rid -> integer
1147
+ # - Process::Sys.getgid -> integer
1148
+ # -->
916
1149
  # Returns the (real) group ID for this process.
917
1150
  #
918
1151
  # Process.gid #=> 500
919
1152
  #
920
1153
  def self.rid: () -> Integer
921
1154
 
1155
+ # <!--
1156
+ # rdoc-file=process.c
1157
+ # - Process::GID.sid_available? -> true or false
1158
+ # -->
922
1159
  # Returns `true` if the current platform has saved group ID functionality.
923
1160
  #
924
1161
  def self.sid_available?: () -> bool
925
1162
 
1163
+ # <!--
1164
+ # rdoc-file=process.c
1165
+ # - Process::GID.switch -> integer
1166
+ # - Process::GID.switch {|| block} -> object
1167
+ # -->
926
1168
  # Switch the effective and real group IDs of the current process. If a *block*
927
1169
  # is given, the group IDs will be switched back after the block is executed.
928
1170
  # Returns the new effective group ID if called without a block, and the return
@@ -934,6 +1176,7 @@ module Process::GID
934
1176
  def self.eid=: (Integer group) -> Integer
935
1177
  end
936
1178
 
1179
+ # <!-- rdoc-file=process.c -->
937
1180
  # Process::Status encapsulates the information on the status of a running or
938
1181
  # terminated system process. The built-in variable `$?` is either `nil` or a
939
1182
  # Process::Status object.
@@ -957,6 +1200,10 @@ end
957
1200
  # the integer value of *stat*, we're referring to this 16 bit value.
958
1201
  #
959
1202
  class Process::Status < Object
1203
+ # <!--
1204
+ # rdoc-file=process.c
1205
+ # - stat & num -> integer
1206
+ # -->
960
1207
  # Logical AND of the bits in *stat* with *num*.
961
1208
  #
962
1209
  # fork { exit 0x37 }
@@ -966,10 +1213,18 @@ class Process::Status < Object
966
1213
  #
967
1214
  def &: (Integer num) -> Integer
968
1215
 
1216
+ # <!--
1217
+ # rdoc-file=process.c
1218
+ # - stat == other -> true or false
1219
+ # -->
969
1220
  # Returns `true` if the integer value of *stat* equals *other*.
970
1221
  #
971
1222
  def ==: (untyped other) -> bool
972
1223
 
1224
+ # <!--
1225
+ # rdoc-file=process.c
1226
+ # - stat >> num -> integer
1227
+ # -->
973
1228
  # Shift the bits in *stat* right *num* places.
974
1229
  #
975
1230
  # fork { exit 99 } #=> 26563
@@ -979,16 +1234,28 @@ class Process::Status < Object
979
1234
  #
980
1235
  def >>: (Integer num) -> Integer
981
1236
 
1237
+ # <!--
1238
+ # rdoc-file=process.c
1239
+ # - stat.coredump? -> true or false
1240
+ # -->
982
1241
  # Returns `true` if *stat* generated a coredump when it terminated. Not
983
1242
  # available on all platforms.
984
1243
  #
985
1244
  def coredump?: () -> bool
986
1245
 
1246
+ # <!--
1247
+ # rdoc-file=process.c
1248
+ # - stat.exited? -> true or false
1249
+ # -->
987
1250
  # Returns `true` if *stat* exited normally (for example using an `exit()` call
988
1251
  # or finishing the program).
989
1252
  #
990
1253
  def exited?: () -> bool
991
1254
 
1255
+ # <!--
1256
+ # rdoc-file=process.c
1257
+ # - stat.exitstatus -> integer or nil
1258
+ # -->
992
1259
  # Returns the least significant eight bits of the return code of *stat*. Only
993
1260
  # available if #exited? is `true`.
994
1261
  #
@@ -1004,6 +1271,10 @@ class Process::Status < Object
1004
1271
  #
1005
1272
  def exitstatus: () -> Integer?
1006
1273
 
1274
+ # <!--
1275
+ # rdoc-file=process.c
1276
+ # - stat.inspect -> string
1277
+ # -->
1007
1278
  # Override the inspection method.
1008
1279
  #
1009
1280
  # system("false")
@@ -1011,6 +1282,10 @@ class Process::Status < Object
1011
1282
  #
1012
1283
  def inspect: () -> String
1013
1284
 
1285
+ # <!--
1286
+ # rdoc-file=process.c
1287
+ # - stat.pid -> integer
1288
+ # -->
1014
1289
  # Returns the process ID that this status object represents.
1015
1290
  #
1016
1291
  # fork { exit } #=> 26569
@@ -1019,31 +1294,55 @@ class Process::Status < Object
1019
1294
  #
1020
1295
  def pid: () -> Integer
1021
1296
 
1297
+ # <!--
1298
+ # rdoc-file=process.c
1299
+ # - stat.signaled? -> true or false
1300
+ # -->
1022
1301
  # Returns `true` if *stat* terminated because of an uncaught signal.
1023
1302
  #
1024
1303
  def signaled?: () -> bool
1025
1304
 
1305
+ # <!--
1306
+ # rdoc-file=process.c
1307
+ # - stat.stopped? -> true or false
1308
+ # -->
1026
1309
  # Returns `true` if this process is stopped. This is only returned if the
1027
1310
  # corresponding #wait call had the Process::WUNTRACED flag set.
1028
1311
  #
1029
1312
  def stopped?: () -> bool
1030
1313
 
1314
+ # <!--
1315
+ # rdoc-file=process.c
1316
+ # - stat.stopsig -> integer or nil
1317
+ # -->
1031
1318
  # Returns the number of the signal that caused *stat* to stop (or `nil` if self
1032
1319
  # is not stopped).
1033
1320
  #
1034
1321
  def stopsig: () -> Integer?
1035
1322
 
1323
+ # <!--
1324
+ # rdoc-file=process.c
1325
+ # - stat.success? -> true, false or nil
1326
+ # -->
1036
1327
  # Returns `true` if *stat* is successful, `false` if not. Returns `nil` if
1037
1328
  # #exited? is not `true`.
1038
1329
  #
1039
1330
  def success?: () -> bool
1040
1331
 
1332
+ # <!--
1333
+ # rdoc-file=process.c
1334
+ # - stat.termsig -> integer or nil
1335
+ # -->
1041
1336
  # Returns the number of the signal that caused *stat* to terminate (or `nil` if
1042
1337
  # self was not terminated by an uncaught signal).
1043
1338
  #
1044
1339
  def termsig: () -> Integer?
1045
1340
 
1046
- # Returns the bits in *stat* as a Integer. Poking around in these bits is
1341
+ # <!--
1342
+ # rdoc-file=process.c
1343
+ # - stat.to_i -> integer
1344
+ # -->
1345
+ # Returns the bits in *stat* as an Integer. Poking around in these bits is
1047
1346
  # platform dependent.
1048
1347
  #
1049
1348
  # fork { exit 0xab } #=> 26566
@@ -1052,6 +1351,10 @@ class Process::Status < Object
1052
1351
  #
1053
1352
  def to_i: () -> Integer
1054
1353
 
1354
+ # <!--
1355
+ # rdoc-file=process.c
1356
+ # - stat.to_s -> string
1357
+ # -->
1055
1358
  # Show pid and exit status as a string.
1056
1359
  #
1057
1360
  # system("false")
@@ -1060,30 +1363,53 @@ class Process::Status < Object
1060
1363
  def to_s: () -> String
1061
1364
  end
1062
1365
 
1366
+ # <!-- rdoc-file=process.c -->
1063
1367
  # The Process::Sys module contains UID and GID functions which provide direct
1064
1368
  # bindings to the system calls of the same names instead of the more-portable
1065
1369
  # versions of the same functionality found in the Process, Process::UID, and
1066
1370
  # Process::GID modules.
1067
1371
  #
1068
1372
  module Process::Sys
1373
+ # <!--
1374
+ # rdoc-file=process.c
1375
+ # - Process.euid -> integer
1376
+ # - Process::UID.eid -> integer
1377
+ # - Process::Sys.geteuid -> integer
1378
+ # -->
1069
1379
  # Returns the effective user ID for this process.
1070
1380
  #
1071
1381
  # Process.euid #=> 501
1072
1382
  #
1073
1383
  def self.geteuid: () -> Integer
1074
1384
 
1385
+ # <!--
1386
+ # rdoc-file=process.c
1387
+ # - Process.gid -> integer
1388
+ # - Process::GID.rid -> integer
1389
+ # - Process::Sys.getgid -> integer
1390
+ # -->
1075
1391
  # Returns the (real) group ID for this process.
1076
1392
  #
1077
1393
  # Process.gid #=> 500
1078
1394
  #
1079
1395
  def self.getgid: () -> Integer
1080
1396
 
1397
+ # <!--
1398
+ # rdoc-file=process.c
1399
+ # - Process.uid -> integer
1400
+ # - Process::UID.rid -> integer
1401
+ # - Process::Sys.getuid -> integer
1402
+ # -->
1081
1403
  # Returns the (real) user ID of this process.
1082
1404
  #
1083
1405
  # Process.uid #=> 501
1084
1406
  #
1085
1407
  def self.getuid: () -> Integer
1086
1408
 
1409
+ # <!--
1410
+ # rdoc-file=process.c
1411
+ # - Process::Sys.issetugid -> true or false
1412
+ # -->
1087
1413
  # Returns `true` if the process was created as a result of an execve(2) system
1088
1414
  # call which had either of the setuid or setgid bits set (and extra privileges
1089
1415
  # were given as a result) or if it has changed any of its real, effective or
@@ -1091,66 +1417,111 @@ module Process::Sys
1091
1417
  #
1092
1418
  def self.issetugid: () -> bool
1093
1419
 
1420
+ # <!--
1421
+ # rdoc-file=process.c
1422
+ # - Process::Sys.setegid(group) -> nil
1423
+ # -->
1094
1424
  # Set the effective group ID of the calling process to *group*. Not available
1095
1425
  # on all platforms.
1096
1426
  #
1097
1427
  def self.setegid: (Integer group) -> nil
1098
1428
 
1429
+ # <!--
1430
+ # rdoc-file=process.c
1431
+ # - Process::Sys.seteuid(user) -> nil
1432
+ # -->
1099
1433
  # Set the effective user ID of the calling process to *user*. Not available on
1100
1434
  # all platforms.
1101
1435
  #
1102
1436
  def self.seteuid: (Integer user) -> nil
1103
1437
 
1438
+ # <!--
1439
+ # rdoc-file=process.c
1440
+ # - Process::Sys.setgid(group) -> nil
1441
+ # -->
1104
1442
  # Set the group ID of the current process to *group*. Not available on all
1105
1443
  # platforms.
1106
1444
  #
1107
1445
  def self.setgid: (Integer group) -> nil
1108
1446
 
1447
+ # <!--
1448
+ # rdoc-file=process.c
1449
+ # - Process::Sys.setregid(rid, eid) -> nil
1450
+ # -->
1109
1451
  # Sets the (group) real and/or effective group IDs of the current process to
1110
1452
  # *rid* and *eid*, respectively. A value of `-1` for either means to leave that
1111
1453
  # ID unchanged. Not available on all platforms.
1112
1454
  #
1113
1455
  def self.setregid: (Integer rid, Integer eid) -> nil
1114
1456
 
1457
+ # <!--
1458
+ # rdoc-file=process.c
1459
+ # - Process::Sys.setresgid(rid, eid, sid) -> nil
1460
+ # -->
1115
1461
  # Sets the (group) real, effective, and saved user IDs of the current process to
1116
1462
  # *rid*, *eid*, and *sid* respectively. A value of `-1` for any value means to
1117
1463
  # leave that ID unchanged. Not available on all platforms.
1118
1464
  #
1119
1465
  def self.setresgid: (Integer rid, Integer eid, Integer sid) -> nil
1120
1466
 
1467
+ # <!--
1468
+ # rdoc-file=process.c
1469
+ # - Process::Sys.setresuid(rid, eid, sid) -> nil
1470
+ # -->
1121
1471
  # Sets the (user) real, effective, and saved user IDs of the current process to
1122
1472
  # *rid*, *eid*, and *sid* respectively. A value of `-1` for any value means to
1123
1473
  # leave that ID unchanged. Not available on all platforms.
1124
1474
  #
1125
1475
  def self.setresuid: (Integer rid, Integer eid, Integer sid) -> nil
1126
1476
 
1477
+ # <!--
1478
+ # rdoc-file=process.c
1479
+ # - Process::Sys.setreuid(rid, eid) -> nil
1480
+ # -->
1127
1481
  # Sets the (user) real and/or effective user IDs of the current process to *rid*
1128
1482
  # and *eid*, respectively. A value of `-1` for either means to leave that ID
1129
1483
  # unchanged. Not available on all platforms.
1130
1484
  #
1131
1485
  def self.setreuid: (Integer rid, Integer eid) -> nil
1132
1486
 
1487
+ # <!--
1488
+ # rdoc-file=process.c
1489
+ # - Process::Sys.setrgid(group) -> nil
1490
+ # -->
1133
1491
  # Set the real group ID of the calling process to *group*. Not available on all
1134
1492
  # platforms.
1135
1493
  #
1136
1494
  def self.setrgid: (Integer group) -> nil
1137
1495
 
1496
+ # <!--
1497
+ # rdoc-file=process.c
1498
+ # - Process::Sys.setruid(user) -> nil
1499
+ # -->
1138
1500
  # Set the real user ID of the calling process to *user*. Not available on all
1139
1501
  # platforms.
1140
1502
  #
1141
1503
  def self.setruid: (Integer user) -> nil
1142
1504
 
1505
+ # <!--
1506
+ # rdoc-file=process.c
1507
+ # - Process::Sys.setuid(user) -> nil
1508
+ # -->
1143
1509
  # Set the user ID of the current process to *user*. Not available on all
1144
1510
  # platforms.
1145
1511
  #
1146
1512
  def self.setuid: (Integer user) -> nil
1147
1513
  end
1148
1514
 
1515
+ # <!-- rdoc-file=process.c -->
1149
1516
  # The Process::UID module contains a collection of module functions which can be
1150
1517
  # used to portably get, set, and switch the current process's real, effective,
1151
1518
  # and saved user IDs.
1152
1519
  #
1153
1520
  module Process::UID
1521
+ # <!--
1522
+ # rdoc-file=process.c
1523
+ # - Process::UID.change_privilege(user) -> integer
1524
+ # -->
1154
1525
  # Change the current process's real and effective user ID to that specified by
1155
1526
  # *user*. Returns the new user ID. Not available on all platforms.
1156
1527
  #
@@ -1160,12 +1531,22 @@ module Process::UID
1160
1531
  #
1161
1532
  def self.change_privilege: (Integer user) -> Integer
1162
1533
 
1534
+ # <!--
1535
+ # rdoc-file=process.c
1536
+ # - Process.euid -> integer
1537
+ # - Process::UID.eid -> integer
1538
+ # - Process::Sys.geteuid -> integer
1539
+ # -->
1163
1540
  # Returns the effective user ID for this process.
1164
1541
  #
1165
1542
  # Process.euid #=> 501
1166
1543
  #
1167
1544
  def self.eid: () -> Integer
1168
1545
 
1546
+ # <!--
1547
+ # rdoc-file=process.c
1548
+ # - Process::UID.from_name(name) -> uid
1549
+ # -->
1169
1550
  # Get the user ID by the *name*. If the user is not found, `ArgumentError` will
1170
1551
  # be raised.
1171
1552
  #
@@ -1174,6 +1555,11 @@ module Process::UID
1174
1555
  #
1175
1556
  def self.from_name: (String name) -> Integer
1176
1557
 
1558
+ # <!--
1559
+ # rdoc-file=process.c
1560
+ # - Process::UID.grant_privilege(user) -> integer
1561
+ # - Process::UID.eid= user -> integer
1562
+ # -->
1177
1563
  # Set the effective user ID, and if possible, the saved user ID of the process
1178
1564
  # to the given *user*. Returns the new effective user ID. Not available on all
1179
1565
  # platforms.
@@ -1184,6 +1570,10 @@ module Process::UID
1184
1570
  #
1185
1571
  def self.grant_privilege: (Integer user) -> Integer
1186
1572
 
1573
+ # <!--
1574
+ # rdoc-file=process.c
1575
+ # - Process::UID.re_exchange -> integer
1576
+ # -->
1187
1577
  # Exchange real and effective user IDs and return the new effective user ID. Not
1188
1578
  # available on all platforms.
1189
1579
  #
@@ -1193,21 +1583,40 @@ module Process::UID
1193
1583
  #
1194
1584
  def self.re_exchange: () -> Integer
1195
1585
 
1586
+ # <!--
1587
+ # rdoc-file=process.c
1588
+ # - Process::UID.re_exchangeable? -> true or false
1589
+ # -->
1196
1590
  # Returns `true` if the real and effective user IDs of a process may be
1197
1591
  # exchanged on the current platform.
1198
1592
  #
1199
1593
  def self.re_exchangeable?: () -> bool
1200
1594
 
1595
+ # <!--
1596
+ # rdoc-file=process.c
1597
+ # - Process.uid -> integer
1598
+ # - Process::UID.rid -> integer
1599
+ # - Process::Sys.getuid -> integer
1600
+ # -->
1201
1601
  # Returns the (real) user ID of this process.
1202
1602
  #
1203
1603
  # Process.uid #=> 501
1204
1604
  #
1205
1605
  def self.rid: () -> Integer
1206
1606
 
1607
+ # <!--
1608
+ # rdoc-file=process.c
1609
+ # - Process::UID.sid_available? -> true or false
1610
+ # -->
1207
1611
  # Returns `true` if the current platform has saved user ID functionality.
1208
1612
  #
1209
1613
  def self.sid_available?: () -> bool
1210
1614
 
1615
+ # <!--
1616
+ # rdoc-file=process.c
1617
+ # - Process::UID.switch -> integer
1618
+ # - Process::UID.switch {|| block} -> object
1619
+ # -->
1211
1620
  # Switch the effective and real user IDs of the current process. If a *block* is
1212
1621
  # given, the user IDs will be switched back after the block is executed. Returns
1213
1622
  # the new effective user ID if called without a block, and the return value of