From a8013f2bb1b7e62c273f7a7da58653aa82e9c5ca Mon Sep 17 00:00:00 2001 From: Stefan Hoffmann Date: Fri, 4 Apr 2014 19:53:43 +0200 Subject: Moved mch_get_pid and renamed it to os_get_pid --- src/os/env.c | 10 ++++++++++ src/os/os.h | 5 +++++ 2 files changed, 15 insertions(+) (limited to 'src/os') diff --git a/src/os/env.c b/src/os/env.c index 9415b19573..034a4ff3a0 100644 --- a/src/os/env.c +++ b/src/os/env.c @@ -50,3 +50,13 @@ char *os_getenvname_at_index(size_t index) # endif } + +long os_get_pid() +{ +#ifdef _WIN32 + return (long)GetCurrentProcessId(); +#else + return (long)getpid(); +#endif +} + diff --git a/src/os/os.h b/src/os/os.h index bc3da1c8ff..1e874c29a5 100644 --- a/src/os/os.h +++ b/src/os/os.h @@ -82,6 +82,11 @@ long_u os_total_mem(int special); const char *os_getenv(const char *name); int os_setenv(const char *name, const char *value, int overwrite); char *os_getenvname_at_index(size_t index); + +/// Get the process ID of the Neovim process. +/// +/// @return the process ID. +long os_get_pid(void); int os_get_usernames(garray_T *usernames); int os_get_user_name(char *s, size_t len); int os_get_uname(uid_t uid, char *s, size_t len); -- cgit