Sponsored Content
Full Discussion: Help with getuid
Top Forums Programming Help with getuid Post 302893893 by rm-r on Friday 21st of March 2014 01:33:08 PM
Old 03-21-2014
Thank you Cororona688. I tried compiling your code snipit but I get errors. My C compiler (ie: I'm running HP-UX) is probably incompatible.

How about this:
- I know the Unix command to obtain a user's internal userid on HP-UX is: id -u <userid> . This command returns an integer representing the internal userid.
- I know the C system() function allows running OS commands.
- I don't know how to run the system() function and save the output in a variable. I wish I could just do this: UserId = system("id -u jsmith");
- Can someone show me the correct C syntax for storing the output of this Unix command into a variable in my C program?
Thanks
 

We Also Found This Discussion For You

1. Programming

how to write a wrapper c code to return uid using getuid() function

And how to use setuid() ? thanks (4 Replies)
Discussion started by: pwd
4 Replies
help(1m)																  help(1m)

NAME
help - Displays a list of commands or the options of a specified command SYNOPSIS
rpccp help [rpccp-command] ARGUMENTS
Specifies one of the following control commands: DESCRIPTION
The help command displays information about the RPCCP command set or the options and argument associated with a specific command. NOTE
This command may be replaced in future releases by the dcecp command, and may no longer be supported at that time. EXAMPLES
The following command operates from the system prompt to display the internal commands of the control program: $ rpccp help The following commands start the control program and display the syntax of the remove entry command: $ rpccp rpccp> help remove entry RELATED INFORMATION
Commands: add element(1m), add entry(1m), add member(1m), export(1m), import(1m), remove element(1m), remove entry(1m), remove group(1m), remove mapping(1m), remove member(1m), remove profile(1m), rpccp(1m), show entry(1m), show group(1m), show mapping(1m), show profile(1m), show server(1m), unexport(1m) help(1m)
All times are GMT -4. The time now is 03:44 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy