first cut of ffi interface, unix only