Exercises
ch08 - Users and Groups
- When we execute the following code, we find out that it displays the same number twice, event though the two users have different IDs in the password file. Why is this? Answer
printf("%ld %ld\n", (long) (getpwnam("avr")->pw_uid),
(long) (getpwnam("tsr")->pw_uid);
- Implement
getpwnam() using setpwent(), getpwent(), and endpwent(). Answer