/*------------------------------------------------------------------------------
 src/lib/dj/user.cxx
 
 Copyright (c) 2004-2006 Darby Johnston.
 All rights reserved.
 Use is subject to license terms.
------------------------------------------------------------------------------*/

#include "djUser.h"
#include <pwd.h>
#include <unistd.h>

namespace dj {

uid_t userCurrent() { return getuid(); }

const Str userToStr(uid_t in)
{
  struct passwd * buf = getpwuid(in);
  return Str(buf ? buf->pw_name : "");
}

}
