diff options
author | Josh Rahm <joshuarahm@gmail.com> | 2023-11-30 20:35:25 +0000 |
---|---|---|
committer | Josh Rahm <joshuarahm@gmail.com> | 2023-11-30 20:35:25 +0000 |
commit | 1b7b916b7631ddf73c38e3a0070d64e4636cb2f3 (patch) | |
tree | cd08258054db80bb9a11b1061bb091c70b76926a /src/nvim/os/process.c | |
parent | eaa89c11d0f8aefbb512de769c6c82f61a8baca3 (diff) | |
parent | 4a8bf24ac690004aedf5540fa440e788459e5e34 (diff) | |
download | rneovim-aucmd_textputpost.tar.gz rneovim-aucmd_textputpost.tar.bz2 rneovim-aucmd_textputpost.zip |
Merge remote-tracking branch 'upstream/master' into aucmd_textputpostaucmd_textputpost
Diffstat (limited to 'src/nvim/os/process.c')
-rw-r--r-- | src/nvim/os/process.c | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/src/nvim/os/process.c b/src/nvim/os/process.c index f4d95e141b..d9ec3a7a8a 100644 --- a/src/nvim/os/process.c +++ b/src/nvim/os/process.c @@ -1,29 +1,21 @@ -// This is an open source non-commercial project. Dear PVS-Studio, please check -// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com - /// OS process functions /// /// psutil is a good reference for cross-platform syscall voodoo: /// https://github.com/giampaolo/psutil/tree/master/psutil/arch +// IWYU pragma: no_include <sys/param.h> + #include <assert.h> #include <signal.h> #include <stdbool.h> #include <stddef.h> -#include <stdio.h> #include <uv.h> -#include "nvim/log.h" -#include "nvim/memory.h" -#include "nvim/os/process.h" - #ifdef MSWIN # include <tlhelp32.h> - -# include "nvim/api/private/helpers.h" #endif -#if defined(__FreeBSD__) // XXX: OpenBSD ? +#if defined(__FreeBSD__) # include <string.h> # include <sys/types.h> # include <sys/user.h> @@ -34,8 +26,21 @@ #endif #if defined(__APPLE__) || defined(BSD) -# include <pwd.h> # include <sys/sysctl.h> + +# include "nvim/macros_defs.h" +#endif + +#if defined(__linux__) +# include <stdio.h> +#endif + +#include "nvim/log.h" +#include "nvim/memory.h" +#include "nvim/os/process.h" + +#ifdef MSWIN +# include "nvim/api/private/helpers.h" #endif #ifdef INCLUDE_GENERATED_DECLARATIONS @@ -72,7 +77,7 @@ static bool os_proc_tree_kill_rec(HANDLE process, int sig) } theend: - return (bool)TerminateProcess(process, (unsigned int)sig); + return (bool)TerminateProcess(process, (unsigned)sig); } /// Kills process `pid` and its descendants recursively. bool os_proc_tree_kill(int pid, int sig) @@ -254,7 +259,7 @@ Dictionary os_proc_info(int pid) if (pe.th32ProcessID == (DWORD)pid) { PUT(pinfo, "pid", INTEGER_OBJ(pid)); PUT(pinfo, "ppid", INTEGER_OBJ((int)pe.th32ParentProcessID)); - PUT(pinfo, "name", STRING_OBJ(cstr_to_string(pe.szExeFile))); + PUT(pinfo, "name", CSTR_TO_OBJ(pe.szExeFile)); } return pinfo; |