On October 21, 2008 13:01, in comp.lang.c, monkeys paw (user@example.n et)
wrote:
What is the function to obtain the user id when
running a C program?
It depends on your OS and the add-on libraries available under it. The C
standard does not speak of "user id", let alone define a standard function
to access it.
Or does it go thru an environment module?
Not sure what you are asking here. If, by "environmen t module", you
mean "function defined in an add-on library available under my OS", then
yes, you obtain a user id through an environment module.
--
Lew Pitcher
Master Codewright & JOAT-in-training | Registered Linux User #112576 http://pitcher.digitalfreehold.ca/ | GPG public key available by request
---------- Slackware - Because I know what I'm doing. ------
if ((pwd) && (!strcmp(pwd->pw_name, "pamelah")) )
printf("It's Pam!\n");
}
Lew Pitcher wrote:
On October 21, 2008 13:01, in comp.lang.c, monkeys paw (user@example.n et)
wrote:
>
>What is the function to obtain the user id when
>running a C program?
>
It depends on your OS and the add-on libraries available under it. The C
standard does not speak of "user id", let alone define a standard function
to access it.
>
>Or does it go thru an environment module?
>
Not sure what you are asking here. If, by "environmen t module", you
mean "function defined in an add-on library available under my OS", then
yes, you obtain a user id through an environment module.
>
>
Comment