FFI interface to stat function