diff options
author | Josh Rahm <joshuarahm@gmail.com> | 2023-11-29 22:40:31 +0000 |
---|---|---|
committer | Josh Rahm <joshuarahm@gmail.com> | 2023-11-29 22:40:31 +0000 |
commit | 339e2d15cc26fe86988ea06468d912a46c8d6f29 (patch) | |
tree | a6167fc8fcfc6ae2dc102f57b2473858eac34063 /src/nvim/os/process.c | |
parent | 067dc73729267c0262438a6fdd66e586f8496946 (diff) | |
parent | 4a8bf24ac690004aedf5540fa440e788459e5e34 (diff) | |
download | rneovim-339e2d15cc26fe86988ea06468d912a46c8d6f29.tar.gz rneovim-339e2d15cc26fe86988ea06468d912a46c8d6f29.tar.bz2 rneovim-339e2d15cc26fe86988ea06468d912a46c8d6f29.zip |
Merge remote-tracking branch 'upstream/master' into fix_repeatcmdline
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; |