macos libproc fix 1

pull/2356/head
Alexander Medvednikov 2019-10-26 02:16:37 +03:00
parent 7de95a642e
commit 203f967677
2 changed files with 4 additions and 1 deletions

View File

@ -19,7 +19,7 @@ fn backtrace(a voidptr, b int) int
fn backtrace_symbols_fd(voidptr, int, int)
// <libproc.h>
fn proc_pidpath(int, voidptr, int) int
//fn proc_pidpath(int, voidptr, int) int

View File

@ -698,6 +698,8 @@ pub fn executable() string {
return string_from_wide2(result, len)
}
$if mac {
return os.args[0]
/*
mut result := malloc(MAX_PATH)
pid := C.getpid()
ret := proc_pidpath (pid, result, MAX_PATH)
@ -706,6 +708,7 @@ pub fn executable() string {
return '.'
}
return string(result)
*/
}
$if freebsd {
mut result := malloc(MAX_PATH)