Re: getpwuid returning null

2008-02-21 Thread Mark Pearson
#include unistd.h #include sys/types.h #include stdio.h Isn't #include pwd.h missing here? Also check errno like Martin suggests. For this you need #include errno.h and make sure you set errno=0 before you call getpwuid. Cheers, Mark. -- To unsubscribe from this list: send an email with

Re: getpwuid returning null

2008-02-21 Thread tomy
hi, While printing the error it displaying No such file or directory. What is the default file for getpwuid?... Martin Mancuska wrote: Did you try to print errno value ? martin 2008/2/21, tomy [EMAIL PROTECTED]: In my application #include unistd.h #include sys/types.h #include

Re: getpwuid returning null

2008-02-21 Thread Manish Katiyar
On Thu, Feb 21, 2008 at 7:53 PM, tomy [EMAIL PROTECTED] wrote: hi, While printing the error it displaying No such file or directory. What is the default file for getpwuid?... The man page says this : NOTE The user password database mostly refers to /etc/passwd. However, with

Re: getpwuid returning null

2008-02-21 Thread tomy
Hi, Thanks foe the information. I have created the file /etc/nsswitch.conf and tried to run the same application, then perror is printing success, but the password structure address remains 0. My program and output is given below #include unistd.h #include sys/types.h #include stdio.h