getgrnam function

Group getgrnam(
  1. String group
)

Search for an entry with a matching group name.

This function is a possible cancellation point and therefore not marked with __THROW.

Implementation

Group getgrnam(
  String group,
) {
  clearErrno();

  final cName = group.toNativeUtf8();

  _getgrnam ??=
      Libc().dylib.lookupFunction<_c_getgrnam, _dart_getgrnam>('getgrnam');

  final _group = _buildGroup(
      _getgrnam!(
        cName,
      ),
      'Error occured attempting to get the next group entry for group: $group');

  malloc.free(cName);

  return _group;
}