native_execv function

int native_execv(
  1. String path,
  2. Pointer<Pointer<Utf8>> __argv
)

Execute PATH with arguments ARGV and environment from `environ'.

Implementation

int native_execv(
  String path, // ffi.Pointer<Utf8> __path,
  ffi.Pointer<ffi.Pointer<Utf8>> __argv,
) {
  final cPath = path.toNativeUtf8();

  _execv ??= Libc().dylib.lookupFunction<
      ffi.Int32 Function(ffi.Pointer<Utf8>, ffi.Pointer<ffi.Pointer<Utf8>>),
      _dart_execv>('execv');
  final result = _execv!(
    cPath,
    __argv,
  );

  malloc.free(cPath);

  return result;
}