getpwuid method

passwd? getpwuid(
  1. int uid
)

Search the user database for a user ID. Note: This is a structural mock mapped to current process environment.

Implementation

passwd? getpwuid(int uid) {
  if (uid == 0) return getpwnam('root');
  if (uid == 1000) {
    return getpwnam(stdlibGetenv('USER') ?? stdlibGetenv('USERNAME') ?? 'user');
  }
  return null;
}