[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: segmentation violation with fork



> When I try to fork a process on a SUN-4 compiling in akcl something like:
> 
> (Clines
> %  int frk()
> %  {
> %     int pid;
> %    
> %     pid = fork();
> %     return pid;
> %  }
> )
> 
> (defentry frk () (int frk))
> 
> I get a stack segmentation violation, and a core dump.

The code looks ok to me.  Make sure you're loading it with
SYS:FASLINK and not LOAD.  If you load it with LOAD, you will
get problems, because the fork routine has to be linked in
before you load.  So do something like this:

  (sys:faslink "my-fork-program.o" "-lc")

Jeff Dalton,                      JANET: J.Dalton@uk.ac.ed             
AI Applications Institute,        ARPA:  J.Dalton%uk.ac.ed@nsfnet-relay.ac.uk
Edinburgh University.             UUCP:  ...!ukc!ed.ac.uk!J.Dalton