@@ -32,12 +32,15 @@ /* currently allocation is handled on posix by naive use * of MAP_ANONYMOUS. munmap needs to be told the size of * the region to unmap (free), which kmheapa() stores at * (ptr - sizeof sz). see kmheap.c for details. */ + k_platform_syscall_arg args[] = { (sz)header, total }; + struct k_platform_syscall_answer r = k_platform_syscall + (k_platform_syscall_munmap, Kmsz(args), args); - if(kmem_platform_munmap(header, total) == -1) { - /* we don't need to bother recovering errno; - * there's only one possible munmap error */ + if(r.error==0) { + /* we don't need to bother recovering the error + * code, there's only one possible munmap error */ return kmcond_bad_address; } # else