statBuf.st_uid -> username?

This is a discussion on statBuf.st_uid -> username? within the Linux Programming forums, part of the Platform Specific Boards category; How do I get the user's name from their user id number?...

  1. #1
    Budding Synth Programmer samGwilliam's Avatar
    Join Date
    Feb 2002
    Location
    Trefforest
    Posts
    368

    statBuf.st_uid -> username?

    How do I get the user's name from their user id number?

  2. #2
    Registered User rohit's Avatar
    Join Date
    Feb 2002
    Posts
    69
    #include <pwd.h>
    struct passwd * getpwuid(int uid)

    struct passwd is
    {char* pw_name;
    char * pw_passwd;
    .... bla bla
    };see man getpwuid

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. small -> big -> bigger -> bigger than bigger -> ?
    By happyclown in forum A Brief History of Cprogramming.com
    Replies: 9
    Last Post: 03-11-2009, 01:12 PM
  2. Dev-C++ -> Tools - > Editor -> Syntax
    By Yuri2 in forum C++ Programming
    Replies: 19
    Last Post: 07-03-2006, 08:48 AM
  3. > > > Urgent Help < < <
    By CodeCypher in forum C Programming
    Replies: 2
    Last Post: 01-31-2006, 02:06 PM
  4. username collection
    By algi in forum C++ Programming
    Replies: 3
    Last Post: 01-22-2005, 02:20 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21