Arc Forumnew | comments | leaders | submitlogin
2 points by elibarzilay 6096 days ago | link | parent

The underlying foreign implementation is looking for the library. The problem is that /usr/lib/libc.so is not the library and dlopen() does not know how to handle this.

A better alternative with mzscheme's foreign interface is to use `#f' for the library -- that treats the mzscheme binary as the library to open (which includes the usual libc stuff.)



1 point by sacado 6096 days ago | link

Interesting. Should be added to ffi.arc...

-----

2 points by eds 6096 days ago | link

Yeah, because currently if you attempt

  (w/ffi #f
    (cdef cfork "fork" cint ()))
arc will convert #f to nil, which mzcheme thinks is an unbound variable. There are work-arounds, like

  (w/ffi (read "#f")
    (cdef cfork "fork" cint ()))
but this is rather ugly.

-----