My C skills are rusty, but I think the two errors are

1) a misplaced curly brace - it's " procedure (args) { body } " so move the 
first curly brace between the arguments and the variable declarations.

2) C doesn't have "endif" - get rid of it.

(Oh - and good programming practice - always put your if and else blocks inside 
curly brackets, even if they're not needed ...)

Cheers,
Wol

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Doug Chanco
Sent: 27 December 2007 13:43
To: [email protected]
Subject: RE: [U2] anyone seen this error before?

# cat uvcron.c

/* This c routine can be used to start universe processes
   in cron or at.  Normally only one process can run at a
   time because they use the same printer memory segment.
   simply replace the 'uv' command with 'uvcron' for example:
   uvcron 'BATCH-REPORT1' > dave.mail */

#define UCB 0

/* set to 0 for System V or 1 for Berkeley */

main (argc, argv, envp)

  int argc;
  char *argv[], *envp[];

  {
    if UCB
        setpgrp(0,getpid());
    else
        setpgrp();
    endif

   /* CHANGE PATH TO MATCH YOUR INSTALLATION */

   (void)execve("/usr/ibm/uv/bin/uv",argv,envp);

   /* We should never come back here */

   printf("exec failed \n");

   exit(-1);

  }

When I try to compile the above code I am getting the following errors:
(using both cc and gcc) on aix 5.2

# gcc uvcron.c
uvcron.c: In function `main':
uvcron.c:17: error: parse error before numeric constant
uvcron.c:25: error: parse error before "void"
#

My 'c' programming skills are pitiful, can anyone shed any light on the
errors and a fix?

Thanks,
Dougc
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to