Function: system-users

system-users is a function defined in dired.c.

Signature

(system-users)

Documentation

Return a list of user names currently registered in the system.

If we don't know how to determine that on this platform, just return a list with one element, taken from user-real-login-name(var)/user-real-login-name(fun).

View in manual

Probably introduced at or before Emacs version 24.3.

Source Code

// Defined in /usr/src/emacs/src/dired.c
{
  Lisp_Object users = Qnil;
#if defined HAVE_GETPWENT && defined HAVE_ENDPWENT
  struct passwd *pw;

  while ((pw = getpwent ()))
    users = Fcons (DECODE_SYSTEM (build_string (pw->pw_name)), users);

  endpwent ();
#endif
  if (NILP (users))
    /* At least current user is always known. */
    users = list1 (Vuser_real_login_name);
  return users;
}