vfork test on Solaris/Sparc

H.J. Lu hjl@lucon.org
Tue Jul 13 19:59:00 GMT 1999


Does anyone have problem with vfork check on Solaris/Sparc and Linux?
The code below is what used in gcc/configure. On Solaris/Sparc, I got

# gcc foo.c
# a.out
zsh: 13158 illegal hardware instruction  ./a.out

On Linux/i386, I got
# gcc foo.c
# a.out
zsh: 21576 segmentation fault  ./a.out

Shouldn't the -DGOOD version be used? I don't think it is safe to
call anything but "exec" after vfork. Is that a bug in vfork test
in autoconf?


-- 
H.J. Lu (hjl@gnu.org)
--foo.c--
int
main()
{
#ifdef GOOD
if (!vfork())
  _exit (0);
#else
  vfork ();
#endif

  return 0;
}


More information about the Gcc-bugs mailing list