native_getwd function

Pointer<Int8> native_getwd(
  1. Pointer<Int8> buf
)

Put the absolute pathname of the current working directory in BUF. If successful, return BUF. If not, put an error message in BUF and return NULL. BUF should be at least PATH_MAX bytes long.

Implementation

ffi.Pointer<ffi.Int8> native_getwd(ffi.Pointer<ffi.Int8> buf) {
  _getwd ??= Libc().dylib.lookupFunction<
      ffi.Pointer<ffi.Int8> Function(ffi.Pointer<ffi.Int8>),
      _dart_getwd>('getwd');
  return _getwd!(
    buf,
  );
}