On Fri, Apr 26, 2019 at 12:13:36PM +0200, Fekete Zoltán wrote:
> The process breaks with an error:
> 
> deps/libuv/src/unix/netbsd.c: In function 'uv_exepath':
> deps/libuv/src/unix/netbsd.c:81:12: error: 'KERN_PROC_PATHNAME' undeclared
> (first use in this function)
>    mib[3] = KERN_PROC_PATHNAME;

sysctl kern.proc.pathname (with KERN_PROC_PATHNAME = 5) is a method to
query the path name of the current binary. It works in NetBSD 8 and
newer (and is the prefered method to get this information).

It was not available in older NetBSD, you need to use some other method
in that library, like

        readlink("/proc/curproc/exe", path, sizeof path);

and hope that /proc is mounted and the result is valid.

Martin

Reply via email to