use getpwuid_r(3) instead of getlogin(3)