304件ヒット
[1-100件を表示]
(0.044秒)
種類
- インスタンスメソッド (187)
- モジュール関数 (55)
- 特異メソッド (40)
- クラス (11)
- 変数 (11)
クラス
-
Process
:: Status (165) - SystemExit (22)
- Thread (11)
検索結果
先頭5件
-
Process
:: Status (24032.0) -
プロセスの終了ステータスを表すクラスです。 メソッド Process.#wait2 などの返り値として使われます。
...い
p "child #{$?.pid} was stopped by signal #{$?.stopsig}"
when $?.exited?
p "child #{$?.pid} exited normally. status=#{$?.exitstatus}"
else
p "unknown status %#x" % $?.to_i
end
SIGCHLD を trap する例
trap(:SIGCHLD) {|sig|
puts "interrupted by signal #{sig} at #{calle......#{$?.pid} was stopped by signal #{$?.stopsig}"
when $?.exited?
puts " child #{$?.pid} exited normally. status=#{$?.exitstatus}"
else
p "unknown status %#x" % $?.to_i
end
end
}
p pid1 = fork { sleep 1; exit }
p pid2 = fork { loop { sleep } } # signal......12965
interrupted by signal 17 at -:27:in `sleep'
child 12965 was stopped by signal 19
interrupted by signal 17 at -:30:in `sleep'
child 12965 was killed by signal 15
interrupted by signal 17 at -:30:in `sleep'
child 12964 exited normally. status=0
done... -
Process
:: Status # exitstatus -> Integer | nil (18202.0) -
exited? が真の場合プロセスが返した終了ステータスの整数を、そ うでない場合は nil を返します。
exited? が真の場合プロセスが返した終了ステータスの整数を、そ
うでない場合は nil を返します。 -
Process
. last _ status -> Process :: Status | nil (12428.0) -
カレントスレッドで最後に終了した子プロセスのステータスを返します。
...。
Process.wait Process.spawn("ruby", "-e", "exit 13")
Process.last_status # => #<Process::Status: pid 4825 exit 13>
カレントスレッドで子プロセスを実行したことがない場合は nil を返します。
Process.last_status # => nil
@see Process::Status
@see $?... -
Thread
# status -> String | false | nil (12233.0) -
生きているスレッドの状態を文字列 "run"、"sleep", "aborting" のいず れかで返します。正常終了したスレッドに対して false、例外によ り終了したスレッドに対して nil を返します。
...hread.new { sleep }
d.kill #=> #<Thread:0x401b3678 aborting>
a.status #=> nil
b.status #=> "sleep"
c.status #=> false
d.status #=> "aborting"
Thread.current.status #=> "run"
@see Thread#alive?, Thread#stop?... -
SystemExit
# status -> Integer (12215.0) -
例外オブジェクトに保存された終了ステータスを返します。
...します。
終了ステータスは Kernel.#exit や SystemExit.new などで設定されます。
例:
begin
exit 1
rescue SystemExit => err
p err.status # => 1
end
begin
raise SystemExit.new(1, "dummy exit")
rescue SystemExit => err
p err.status # => 1
end... -
Process
:: Status # inspect -> String (6026.0) -
自身を人間が読みやすい形の文字列表現にして返します。
...トで返します。
: 正常終了のとき
#<Process::Status: pid=18262,exited(nnn)>
: シグナルによる停止のとき
#<Process::Status: pid=18262,stopped(SIGxxx=nnn)>
: シグナルによる終了のとき
#<Process::Status: pid=18262,signaled(SIGxxx=nnn)>
: コアダンプしたとき......(このステータスの表示はシステムに依存します)
#<Process::Status: pid=18262,coredumped>... -
Process
:: Status # &(other) -> Integer (6002.0) -
self.to_i & other と同じです。 このメソッドは後方互換性のためにあります。
self.to_i & other と同じです。
このメソッドは後方互換性のためにあります。
@param other 自身との & 演算をしたい整数を指定します。 -
Process
:: Status # ==(other) -> bool (6002.0) -
同じステータスの場合に真を返します。
同じステータスの場合に真を返します。
other が数値の場合、self.to_i との比較が行われます。こ
れは後方互換性のためです。
@param other 自身と比較したいオブジェクトを指定します。 -
Process
:: Status # >>(num) -> Integer (6002.0) -
self.to_i >> num と同じです。
self.to_i >> num と同じです。
@param num 整数を指定します。
fork { exit 99 } #=> 26563
Process.wait #=> 26563
$?.to_i #=> 25344
$? >> 8 #=> 99 -
Process
:: Status # coredump? -> bool (6002.0) -
終了時にコアダンプしていたら真を返します。
終了時にコアダンプしていたら真を返します。
このメソッドは signaled? が真のときにしか意味を持ちません。
このメソッドはシステムに依存します。サポートしないプラットフォー
ムでは常に false を返します。