access function

int access(
  1. String name,
  2. int type
)

Test for access to NAME using the real UID and real GID.

Implementation

int access(
  String name, // ffi.Pointer<Utf8> name,
  int type,
) {
  _access ??= Libc().dylib.lookupFunction<
      ffi.Int32 Function(ffi.Pointer<Utf8>, ffi.Int32), _dart_access>('access');

  final cName = name.toNativeUtf8();
  final result = _access!(
    cName,
    type,
  );

  malloc.free(cName);

  return result;
}