Help with execl

Dave Hammond daveh at marob.masa.com
Fri Sep 15 09:18:40 AEST 1989


In article <1049 at polari.UUCP> corwin at polari.UUCP (Don Glover) writes:
>
>I have a program that I have just compiled, in it does
>execl(emprog[1],"Empire",cnumbuf,"","1","\0377",0); 
>when run it returns a -1 and errno is set to 14.  this error is defined
>as EFAULT Bad Address, for the life of me I can not figure out why I am
>getting this.   I have printf'd all the arguements and they look fine.
>
>Any suggestions will be appreciated.  I am doing this on 286 xenix 2.2.3
>with the 2.2.1 development system.

The 286 will segment fault every time if null is not cast properly.
Try casting the terminating null arg to (char *):

execl(emprog[1],"Empire",cnumbuf,"","1","\0377",(char *)0); 

BTW, I'm curious about the "\0377" arg.  Does empire have a command line
option which takes a 1 char string with -1 as its contents ?

--
Dave Hammond
daveh at marob.masa.com



More information about the Comp.unix.xenix mailing list