Thread: typedef question

  1. #1
    Registered User
    Join Date
    Nov 2015
    Posts
    1

    typedef question

    The man page for the get password entry refers to the 'passwd' struct. I observe that this struct has to typedefs uid_t and gid_t.

    How do i cross reference this typedef on my linux host? In other words , how would i find out whether uid_t may be signed int or a long?

    Code:
      struct passwd {
                   char   *pw_name;       /* username */
                   char   *pw_passwd;     /* user password */
                   uid_t   pw_uid;        /* user ID */
                   gid_t   pw_gid;        /* group ID */
                   char   *pw_gecos;      /* user information */
                   char   *pw_dir;        /* home directory */
                   char   *pw_shell;      /* shell program */
               };

  2. #2
    Programming Wraith GReaper's Avatar
    Join Date
    Apr 2009
    Location
    Greece
    Posts
    2,739
    Have a look at the file "/usr/include/bits/typesizes.h", if you have it. It should have the definitions. If not, you can always use the good ol' "sizeof()".
    Devoted my life to programming...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 1
    Last Post: 03-23-2011, 09:00 AM
  2. typedef question
    By -EquinoX- in forum C Programming
    Replies: 31
    Last Post: 05-03-2008, 09:15 AM
  3. Question regarding typedef
    By esmeco in forum C Programming
    Replies: 2
    Last Post: 04-24-2008, 11:58 AM
  4. typedef question
    By Chaplin27 in forum C++ Programming
    Replies: 4
    Last Post: 09-22-2006, 10:42 AM
  5. question about typedef
    By volk in forum C++ Programming
    Replies: 8
    Last Post: 05-30-2003, 10:53 PM