setlogin function

void setlogin(
  1. String name
)

Set the login name returned by `getlogin'. Throws PosixException if the call fails.

Implementation

void setlogin(
  String name, // ffi.Pointer<Utf8> name,
) {
  final cName = name.toNativeUtf8();
  _setlogin ??= Libc()
      .dylib
      .lookupFunction<ffi.Int32 Function(ffi.Pointer<Utf8>), _dart_setlogin>(
          'setlogin');

  final result = _setlogin!(
    cName,
  );

  _throwIfErrno('setlogin', result, cName);

  malloc.free(cName);
}