#include <signal.h>
#include <sys/stat.h>
+#ifdef vfork /* Autoconf may define this to fork for us. */
+# define VFORK_STRING "fork"
+#else
+# define VFORK_STRING "vfork"
+#endif
+#ifdef HAVE_VFORK_H
+#include <vfork.h>
+#endif
+#ifdef VMS
+#define vfork() (decc$$alloc_vfork_blocks() >= 0 ? \
+ lib$get_current_invo_context(decc$$get_vfork_jmpbuf()) : -1)
+#endif /* VMS */
+
#define COLLECT
#include "demangle.h"
#define obstack_chunk_alloc xmalloc
#define obstack_chunk_free free
-#ifdef USG
-#define vfork fork
-#endif
-
#ifndef WIFSIGNALED
#define WIFSIGNALED(S) (((S) & 0xff) != 0 && ((S) & 0xff) != 0x7f)
#endif
#ifndef __CYGWIN32__
pid = vfork ();
if (pid == -1)
- {
-#ifdef vfork
- fatal_perror ("fork");
-#else
- fatal_perror ("vfork");
-#endif
- }
+ fatal_perror (VFORK_STRING);
if (pid == 0) /* child context */
{
/* Spawn child nm on pipe */
pid = vfork ();
if (pid == -1)
- {
-#ifdef vfork
- fatal_perror ("fork");
-#else
- fatal_perror ("vfork");
-#endif
- }
+ fatal_perror (VFORK_STRING);
if (pid == 0) /* child context */
{
/* Spawn child ldd on pipe */
pid = vfork ();
if (pid == -1)
- {
-#ifdef vfork
- fatal_perror ("fork");
-#else
- fatal_perror ("vfork");
-#endif
- }
+ fatal_perror (VFORK_STRING);
if (pid == 0) /* child context */
{