[comp.lang.c] Real name of user

larss@nada.kth.se (Lars Schylberg) (10/06/89)

I'm looking for a c-routine under UNIX environment that
could give the real name of the user just in the same
manner as getenv("USER") gives the username.  I know
that the real name is available in the /etc/passwd file.
But I guess that there have to be a routine to extract it.

I would prefer email answers since I'm usually not on these groups.

Many thanks in advance.

Lars.

-- 
Lars Schylberg                        Email: larss@fmi.kth.se    (Internet)
Department of Photogrammetry                 larss@sekth.bitnet  (Bitnet)
Royal Institute of Technology         Tel.   +46 8 790 86 33     (office)
S-100 44  STOCKHOLM, SWEDEN           Fax.   +46 8 10 91 99 

bph@buengc.BU.EDU (Blair P. Houghton) (10/06/89)

In article <1876@draken.nada.kth.se> larss@nada.kth.se (Lars Schylberg) writes:
>I'm looking for a c-routine under UNIX environment that
>could give the real name of the user [...]

Try getpwent().  Available in a <pwd.h> near you.

				--Blair
				  "Ya wanna grab a six
				   of Diet Coke while
				   yer there?"