From c3b8e5e181f013f795e8a057945bdaf23cf50c15 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Mon, 22 Nov 2021 09:32:13 +0000 Subject: [PATCH] ci: fix compilation on FreeBSD --- vlib/os/os.c.v | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vlib/os/os.c.v b/vlib/os/os.c.v index 41d737e2f7..97f8ab1bde 100644 --- a/vlib/os/os.c.v +++ b/vlib/os/os.c.v @@ -673,8 +673,9 @@ pub fn executable() string { return res } $if freebsd { + bufsize := usize(size) mib := [1 /* CTL_KERN */, 14 /* KERN_PROC */, 12 /* KERN_PROC_PATHNAME */, -1] - unsafe { C.sysctl(mib.data, 4, result, &size, 0, 0) } + unsafe { C.sysctl(mib.data, mib.len, result, &bufsize, 0, 0) } res := unsafe { tos_clone(result) } return res }