The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #3 (permalink)  
Old 07-22-2008
marconi marconi is offline
Registered User
  
 

Join Date: Dec 2007
Posts: 41
Hi,

I am currently on OS :- Red Hat Linux Version 3.0. The script I am running is a HP Tru64 Unix compatible script
which I am trying to run on the Linux Version 3.0.

Instead of :- DISCARD strcpy(user , (char*) cuserid((char*)0));

I used each of the following as per your suggestion :-

DISCARD strcpy(user, (char*) getlogin((char*)0));

or

DISCARD strcpy(user , (char*) getpwuid(getuid((char*)0)));

but still its showing me the following errors :-

$ make gapw
cc -c -o gapw.o gapw.c
gapw.c: In function `main':
gapw.c:101: error: too many arguments to function `getlogin'
make: *** [gapw.o] Error 1

or

$ make gapw
cc -c -o gapw.o gapw.c
gapw.c: In function `main':
gapw.c:102: error: too many arguments to function `getuid'
gapw.c:102: warning: cast to pointer from integer of different size
make: *** [gapw.o] Error 1


Request you to pls give ur inputs.

Regards,
Marconi.

Last edited by marconi; 07-22-2008 at 04:06 PM..