You are here : safarionline.ir / books / lpi / exercises

Exercises

ch08 - Users and Groups

  1. 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);
  1. Implement getpwnam() using setpwent(), getpwent(), and endpwent(). Answer
کلیه‌ی حقوق برای safarionline.ir محفوظ است.