aboutsummaryrefslogtreecommitdiffstats
path: root/lua/nvim-lsp-installer/platform.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua/nvim-lsp-installer/platform.lua')
-rw-r--r--lua/nvim-lsp-installer/platform.lua10
1 files changed, 10 insertions, 0 deletions
diff --git a/lua/nvim-lsp-installer/platform.lua b/lua/nvim-lsp-installer/platform.lua
index 9ab54c6a..62c74046 100644
--- a/lua/nvim-lsp-installer/platform.lua
+++ b/lua/nvim-lsp-installer/platform.lua
@@ -25,6 +25,16 @@ M.is_unix = vim.fn.has "unix" == 1
M.is_mac = vim.fn.has "mac" == 1
M.is_linux = not M.is_mac and M.is_unix
+-- @return string @The libc found on the system, musl or glibc (glibc if ldd is not found)
+function M.get_libc()
+ local _, _, libc_exit_code = os.execute "ldd --version 2>&1 | grep -q musl"
+ if libc_exit_code == 0 then
+ return "musl"
+ else
+ return "glibc"
+ end
+end
+
-- PATH separator
M.path_sep = M.is_win and ";" or ":"