aboutsummaryrefslogtreecommitdiff
path: root/src/os
diff options
context:
space:
mode:
Diffstat (limited to 'src/os')
-rw-r--r--src/os/env.c10
-rw-r--r--src/os/os.h5
2 files changed, 15 insertions, 0 deletions
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);