kernel_process_list

プロセス情報を連想配列リストで返します

説明
定義
kernel_process_list();
戻り値
プロセス情報を連想配列リストで取得します。
失敗は例外で通知されます。
この関数は同期処理されます。

実際の例
[{"pid":1,"parentpid":0,"processname":/sbin/init,"args": ,"extraname":},{"pid":91,"parentpid":1,"processname":/lib/systemd/systemd-udevd,"args": ,"extraname":},{"pid":92,"parentpid":1,"processname":/lib/systemd/systemd-journald,"args": ,"extraname":},{"pid":267,"parentpid":1,"processname":/usr/sbin/crond,"args":-n  ,"extraname":},{"pid":270,"parentpid":1,"processname":/bin/sh,"args":/home/rti/naichichi2/naichichi2/config/linuxboot/naichichi2_zaoriku_client.sh  ,"extraname":},{"pid":272,"parentpid":1,"processname":/lib/systemd/systemd-logind,"args": ,"extraname":},{"pid":273,"parentpid":1,"processname":/usr/bin/dbus-daemon,"args":--system --address=systemd: --nofork --nopidfile --systemd-activation  ,"extraname":},{"pid":275,"parentpid":1,"processname":avahi-daemon: running [fhc.local],"args":,"extraname":},{"pid":277,"parentpid":1,"processname":/sbin/agetty,"args":-s ttyO0 115200  ,"extraname":},{"pid":279,"parentpid":1,"processname":/sbin/agetty,"args":--noclear tty1 38400 linux  ,"extraname":},{"pid":291,"parentpid":275,"processname":avahi-daemon: chroot helper,"args":,"extraname":},{"pid":366,"parentpid":21,"processname":/lib/systemd/systemd-cgroups-agent,"args":/system/getty@.service/ttyGS0  ,"extraname":},{"pid":369,"parentpid":1,"processname":/usr/sbin/dropbear,"args":-r /etc/dropbear/dropbear_rsa_host_key -p 22 -w  ,"extraname":},{"pid":1138,"parentpid":270,"processname":./naichichi2_client,"args":--nostdout  ,"extraname":}]
				
解説
pid
プロセスIDが数字で入ります。 kernel_kill APIなどの引数に利用します。
parentpid
プロセスの親のプロセスのプロセスIDです。
processname
実行しているプロセス名です。
args
実行しているプロセスの引数です。
extraname
Linuxでは常に空になります。windowsだとウィンドウ名が入ります。
//プロセス一覧を取得します。
var list = kernel_process_list();

//プロセス一覧が返されます。
//[{"pid":1,"parentpid":0,"processname":/sbin/init,"args": ,"extraname":},{"pid":91,"parentpid":1,"processname":/lib/systemd/systemd-udevd,"args": ,"extraname":},{"pid":92,"parentpid":1,"processname":/lib/systemd/systemd-journald,"args": ,"extraname":},{"pid":267,"parentpid":1,"processname":/usr/sbin/crond,"args":-n  ,"extraname":},{"pid":270,"parentpid":1,"processname":/bin/sh,"args":/home/rti/naichichi2/naichichi2/config/linuxboot/naichichi2_zaoriku_client.sh  ,"extraname":},{"pid":272,"parentpid":1,"processname":/lib/systemd/systemd-logind,"args": ,"extraname":},{"pid":273,"parentpid":1,"processname":/usr/bin/dbus-daemon,"args":--system --address=systemd: --nofork --nopidfile --systemd-activation  ,"extraname":},{"pid":275,"parentpid":1,"processname":avahi-daemon: running [fhc.local],"args":,"extraname":},{"pid":277,"parentpid":1,"processname":/sbin/agetty,"args":-s ttyO0 115200  ,"extraname":},{"pid":279,"parentpid":1,"processname":/sbin/agetty,"args":--noclear tty1 38400 linux  ,"extraname":},{"pid":291,"parentpid":275,"processname":avahi-daemon: chroot helper,"args":,"extraname":},{"pid":366,"parentpid":21,"processname":/lib/systemd/systemd-cgroups-agent,"args":/system/getty@.service/ttyGS0  ,"extraname":},{"pid":369,"parentpid":1,"processname":/usr/sbin/dropbear,"args":-r /etc/dropbear/dropbear_rsa_host_key -p 22 -w  ,"extraname":},{"pid":1138,"parentpid":270,"processname":./naichichi2_client,"args":--nostdout  ,"extraname":}]
alert(list);