aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/os/process.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/os/process.c')
-rw-r--r--src/nvim/os/process.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/nvim/os/process.c b/src/nvim/os/process.c
index d9ec3a7a8a..e8d38d5b8a 100644
--- a/src/nvim/os/process.c
+++ b/src/nvim/os/process.c
@@ -44,7 +44,7 @@
#endif
#ifdef INCLUDE_GENERATED_DECLARATIONS
-# include "os/process.c.generated.h" // IWYU pragma: export
+# include "os/process.c.generated.h"
#endif
#ifdef MSWIN
@@ -114,6 +114,7 @@ bool os_proc_tree_kill(int pid, int sig)
/// @param[out] proc_count Number of child processes.
/// @return 0 on success, 1 if process not found, 2 on other error.
int os_proc_children(int ppid, int **proc_list, size_t *proc_count)
+ FUNC_ATTR_NONNULL_ALL
{
if (ppid < 0) {
return 2;
@@ -229,7 +230,7 @@ int os_proc_children(int ppid, int **proc_list, size_t *proc_count)
///
/// @param pid Process to inspect.
/// @return Map of process properties, empty on error.
-Dictionary os_proc_info(int pid)
+Dictionary os_proc_info(int pid, Arena *arena)
{
Dictionary pinfo = ARRAY_DICT_INIT;
PROCESSENTRY32 pe;
@@ -257,9 +258,10 @@ Dictionary os_proc_info(int pid)
CloseHandle(h);
if (pe.th32ProcessID == (DWORD)pid) {
- PUT(pinfo, "pid", INTEGER_OBJ(pid));
- PUT(pinfo, "ppid", INTEGER_OBJ((int)pe.th32ParentProcessID));
- PUT(pinfo, "name", CSTR_TO_OBJ(pe.szExeFile));
+ pinfo = arena_dict(arena, 3);
+ PUT_C(pinfo, "pid", INTEGER_OBJ(pid));
+ PUT_C(pinfo, "ppid", INTEGER_OBJ((int)pe.th32ParentProcessID));
+ PUT_C(pinfo, "name", CSTR_TO_ARENA_OBJ(arena, pe.szExeFile));
}
return pinfo;