ps_status {ps}R Documentation

Current process status

Description

One of the following:

Usage

ps_status(p = ps_handle())

Arguments

p

Process handle.

Details

It might return NA_character_ on macOS.

Works for zombie processes.

Value

Character scalar.

Note on macOS

On macOS ps_status() often falls back to calling the external ps program, because macOS does not let R access the status of most other processes. Notably, it is usually able to access the status of other R processes.

The external ps program always runs as the root user, and it also has special entitlements, so it can typically access the status of most processes.

If this behavior is problematic for you, e.g. because calling an external program is too slow, set the ps.no_external_ps option to TRUE:

options(ps.no_external_ps = TRUE)

Note that setting this option to TRUE will cause ps_status() to return NA_character_ for most processes.

See Also

Other process handle functions: ps_children(), ps_cmdline(), ps_connections(), ps_cpu_times(), ps_create_time(), ps_cwd(), ps_descent(), ps_environ(), ps_exe(), ps_handle(), ps_interrupt(), ps_is_running(), ps_kill(), ps_memory_info(), ps_name(), ps_num_fds(), ps_num_threads(), ps_open_files(), ps_pid(), ps_ppid(), ps_resume(), ps_send_signal(), ps_shared_libs(), ps_suspend(), ps_terminal(), ps_terminate(), ps_uids(), ps_username()

Examples


p <- ps_handle()
p
ps_status(p)


[Package ps version 1.8.1 Index]