[ First ]  [ Previous ]  [ Next ]  [ Last ]  [ Manuals ]


cuserid

Retrieve the current user's ID.

Compatibility:

This function is compatible with the following targets:

ANSI

BeOS

EMB/RTOS

Mac OS

Palm OS

Win32


Prototype:
#include <unistd.h>
char *cuserid(char *string);
Parameters:

Parameters for this facility are:

string  
char *  
The user ID as a string  

Remarks:

The function cuserid() returns the user name associated with the current process. If the string argument is NULL, the file name is stored in an internal buffer. If it is not NULL, it must be at least FILENAME_MAX large. Example of usage is given in "Example of cuserid() usage."


NOTE

For the MacOS, the login name is returned.
:Return:

cuserid() returns a character pointer to the current user's ID.


NOTE

For the MacOS, the users name is set using the sharing control panel
Example of cuserid() usage.:
#include <stdio.h>
#include <unistd.h>

int main(void)
{ 
 char *c_id = NULL;
 printf("The current user ID is %s\n",cuserid(c_id));

	return 0;
}

Result
The current user ID is Metrowerks


[ First ]  [ Previous ]  [ Next ]  [ Last ]  [ Manuals ]

Visit the Metrowerks website at: http://www.metrowerks.com
For assistance contact Metrowerks Technical Support at: cw_support@metrowerks.com
Copyright © 2000, Metrowerks Corp. All rights reserved.

Last updated: August 16, 2000