libmac/pwd.c
struct __darwin_passwd *__darwin_getpwuid(uid_t uid)
{
  static struct __darwin_passwd m_darwin_passwd;
  struct passwd *m_passwd = getpwuid(uid);
  assert(m_passwd != NULL);

  m_darwin_passwd.pw_name = m_passwd->pw_name;
  m_darwin_passwd.pw_passwd = m_passwd->pw_passwd;
  m_darwin_passwd.pw_uid = m_passwd->pw_uid;
  m_darwin_passwd.pw_gid = m_passwd->pw_gid;
  m_darwin_passwd.pw_change = 0;
  m_darwin_passwd.pw_class = NULL;
  m_darwin_passwd.pw_gecos = m_passwd->pw_gecos;
  m_darwin_passwd.pw_dir = m_passwd->pw_dir;
  m_darwin_passwd.pw_shell = m_passwd->pw_shell;
  m_darwin_passwd.pw_expire = 0;
  m_darwin_passwd.pw_fields = 0;

  return &m_darwin_passwd;
}
/*
 * Return a correctly formed passwd structure taking care to
 * make fields point to the correct place.
 * FIXME having a correct getpwuid_r() implementation
 *       would be really better.
 */
Return a correctly formed passwd structure taking care to
make fields point to the correct place.
FIXME having a correct getpwuid_r() implementation
would be really better.
Return a correctly formed passwd structure taking care to make fields point to the correct place . FIXME having a correct getpwuid_r () implementation would be really better .
struct __darwin_passwd *__darwin_getpwuid(uid_t uid)
{
  static struct __darwin_passwd m_darwin_passwd;
  struct passwd *m_passwd = getpwuid(uid);
  assert(m_passwd != NULL);
  m_darwin_passwd.pw_name = m_passwd->pw_name;
  m_darwin_passwd.pw_passwd = m_passwd->pw_passwd;
  m_darwin_passwd.pw_uid = m_passwd->pw_uid;
  m_darwin_passwd.pw_gid = m_passwd->pw_gid;
  m_darwin_passwd.pw_change = 0;
  m_darwin_passwd.pw_class = NULL;
  m_darwin_passwd.pw_gecos = m_passwd->pw_gecos;
  m_darwin_passwd.pw_dir = m_passwd->pw_dir;
  m_darwin_passwd.pw_shell = m_passwd->pw_shell;
  m_darwin_passwd.pw_expire = 0;
  m_darwin_passwd.pw_fields = 0;
  return &m_darwin_passwd;
}
struct __darwin_passwd * __darwin_getpwuid ( uid_t uid ) { static struct __darwin_passwd m_darwin_passwd ; struct passwd * m_passwd = getpwuid ( uid ) ; assert ( m_passwd != NULL ) ; m_darwin_passwd . pw_name = m_passwd -> pw_name ; m_darwin_passwd . pw_passwd = m_passwd -> pw_passwd ; m_darwin_passwd . pw_uid = m_passwd -> pw_uid ; m_darwin_passwd . pw_gid = m_passwd -> pw_gid ; m_darwin_passwd . pw_change = 0 ; m_darwin_passwd . pw_class = NULL ; m_darwin_passwd . pw_gecos = m_passwd -> pw_gecos ; m_darwin_passwd . pw_dir = m_passwd -> pw_dir ; m_darwin_passwd . pw_shell = m_passwd -> pw_shell ; m_darwin_passwd . pw_expire = 0 ; m_darwin_passwd . pw_fields = 0 ; return & m_darwin_passwd ; }
Return a correctly formed passwd structure taking care to
 make fields point to the correct place.
Return a correctly formed passwd structure taking care to make fields point to the correct place .