Nicolas Martin <nicolas.martin at freesurf.fr> wrote: Hi,
> struct passwd *uid; > uid = getpwuid(geteuid()); > printf("user=%s\n", uid->pw_name); > Prints my username correctly. Also prints root if runned with sudo ;-) Yep, use getuid() instead of geteuid() if you want to avoid that. Also, you want some error checking in there... :) JB. -- Julien BLACHE <http://www.jblache.org> <jb at jblache.org> GPG KeyID 0xF5D65169