diff options
author | ghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4> | 1998-11-02 07:20:48 +0000 |
---|---|---|
committer | ghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4> | 1998-11-02 07:20:48 +0000 |
commit | 020ecb1b4f516fc98b51ed2b6fc43d16b660fb07 (patch) | |
tree | 0a6465ac8b45632cb3fe469d00fe1ffb939cbad7 /gcc/collect2.c | |
parent | f8b7dbdb1e8fb247d747b488031595f52bb29f4a (diff) | |
download | gcc-020ecb1b4f516fc98b51ed2b6fc43d16b660fb07.tar.gz |
* configure.in: Call AC_FUNC_VFORK.
* collect2.c: Define VFORK_STRING as a printable string for
error messages (either "vfork" or "fork".) If HAVE_VFORK_H is
defined, include vfork.h. If VMS is defined, define vfork()
appropriately. Remove vfork check on USG, we're using autoconf.
(collect_execute): Pass VFORK_STRING to fatal_perror instead of
checking locally what string to pass.
(scan_prog_file): Likewise.
(scan_libraries): Likewise.
* gcc.c: Remove vfork check on USG, we're using autoconf.
Besides, no calls to vfork/fork occur in this file.
* protoize.c: Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@23498 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/collect2.c')
-rw-r--r-- | gcc/collect2.c | 41 |
1 files changed, 16 insertions, 25 deletions
diff --git a/gcc/collect2.c b/gcc/collect2.c index 166cbe1c483..5fdd08bedf5 100644 --- a/gcc/collect2.c +++ b/gcc/collect2.c @@ -30,6 +30,19 @@ Boston, MA 02111-1307, USA. */ #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" @@ -43,10 +56,6 @@ Boston, MA 02111-1307, USA. */ #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 @@ -1716,13 +1725,7 @@ collect_execute (prog, argv, redir) #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 */ { @@ -2243,13 +2246,7 @@ scan_prog_file (prog_name, which_pass) /* 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 */ { @@ -2685,13 +2682,7 @@ scan_libraries (prog_name) /* 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 */ { |