A few sims use this to emulate process syscalls.
Gdb builds seem to still be fine.
$(top_srcdir)/import/m4/sys_time_h.m4 \
$(top_srcdir)/import/m4/sys_types_h.m4 \
$(top_srcdir)/import/m4/sys_uio_h.m4 \
+ $(top_srcdir)/import/m4/sys_wait_h.m4 \
$(top_srcdir)/import/m4/tempname.m4 \
$(top_srcdir)/import/m4/threadlib.m4 \
$(top_srcdir)/import/m4/time_h.m4 \
GNULIB_VSCANF = @GNULIB_VSCANF@
GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@
GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@
+GNULIB_WAITPID = @GNULIB_WAITPID@
GNULIB_WCPCPY = @GNULIB_WCPCPY@
GNULIB_WCPNCPY = @GNULIB_WCPNCPY@
GNULIB_WCRTOMB = @GNULIB_WCRTOMB@
NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H@
NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H@
NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_H@
NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@
NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@
NEXT_AS_FIRST_DIRECTIVE_WCHAR_H = @NEXT_AS_FIRST_DIRECTIVE_WCHAR_H@
NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@
NEXT_SYS_TYPES_H = @NEXT_SYS_TYPES_H@
NEXT_SYS_UIO_H = @NEXT_SYS_UIO_H@
+NEXT_SYS_WAIT_H = @NEXT_SYS_WAIT_H@
NEXT_TIME_H = @NEXT_TIME_H@
NEXT_UNISTD_H = @NEXT_UNISTD_H@
NEXT_WCHAR_H = @NEXT_WCHAR_H@
m4_include([import/m4/sys_time_h.m4])
m4_include([import/m4/sys_types_h.m4])
m4_include([import/m4/sys_uio_h.m4])
+m4_include([import/m4/sys_wait_h.m4])
m4_include([import/m4/tempname.m4])
m4_include([import/m4/threadlib.m4])
m4_include([import/m4/time_h.m4])
/* Define to 1 if you have the <sys/uio.h> header file. */
#undef HAVE_SYS_UIO_H
+/* Define to 1 if you have the <sys/wait.h> header file. */
+#undef HAVE_SYS_WAIT_H
+
/* Define to 1 if you have the `thrd_create' function. */
#undef HAVE_THRD_CREATE
GNULIB_LOCALTIME
GNULIB_MKTIME
GNULIB_CTIME
+NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_H
+NEXT_SYS_WAIT_H
+GNULIB_WAITPID
HAVE_SYS_UIO_H
NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H
NEXT_SYS_UIO_H
as_fn_append ac_header_list " strings.h"
as_fn_append ac_header_list " sys/random.h"
as_fn_append ac_header_list " sys/uio.h"
+as_fn_append ac_header_list " sys/wait.h"
as_fn_append ac_func_list " localtime_r"
as_fn_append ac_header_list " crtdefs.h"
as_fn_append ac_func_list " iswcntrl"
# Code from module sys_time:
# Code from module sys_types:
# Code from module sys_uio:
+ # Code from module sys_wait:
# Code from module tempname:
# Code from module threadlib:
+ GNULIB_WAITPID=0;
+
+
+
+
GNULIB_CTIME=0;
GNULIB_MKTIME=0;
GNULIB_LOCALTIME=0;
+
+
+
+
+
+
+
+
+
+
+ if test $gl_cv_have_include_next = yes; then
+ gl_cv_next_sys_wait_h='<'sys/wait.h'>'
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/wait.h>" >&5
+$as_echo_n "checking absolute name of <sys/wait.h>... " >&6; }
+if ${gl_cv_next_sys_wait_h+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ if test $ac_cv_header_sys_wait_h = yes; then
+
+
+
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/wait.h>
+_ACEOF
+ case "$host_os" in
+ aix*) gl_absname_cpp="$ac_cpp -C" ;;
+ *) gl_absname_cpp="$ac_cpp" ;;
+ esac
+
+ case "$host_os" in
+ mingw*)
+ gl_dirsep_regex='[/\\]'
+ ;;
+ *)
+ gl_dirsep_regex='\/'
+ ;;
+ esac
+ gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+ gl_header_literal_regex=`echo 'sys/wait.h' \
+ | sed -e "$gl_make_literal_regex_sed"`
+ gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
+ s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
+ s|^/[^/]|//&|
+ p
+ q
+ }'
+
+ gl_cv_absolute_sys_wait_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+ sed -n "$gl_absolute_header_sed"`
+
+ gl_header=$gl_cv_absolute_sys_wait_h
+ gl_cv_next_sys_wait_h='"'$gl_header'"'
+ else
+ gl_cv_next_sys_wait_h='<'sys/wait.h'>'
+ fi
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_wait_h" >&5
+$as_echo "$gl_cv_next_sys_wait_h" >&6; }
+ fi
+ NEXT_SYS_WAIT_H=$gl_cv_next_sys_wait_h
+
+ if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
+ gl_next_as_first_directive='<'sys/wait.h'>'
+ else
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+ gl_next_as_first_directive=$gl_cv_next_sys_wait_h
+ fi
+ NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_H=$gl_next_as_first_directive
+
+
+
+
+
+
+
+
+
+
+
+
+
+
:
# strstr \
# strtok_r \
# sys_stat \
+# sys_wait \
# time_r \
# unistd \
# unsetenv \
## end gnulib module sys_uio
+## begin gnulib module sys_wait
+
+BUILT_SOURCES += sys/wait.h
+
+# We need the following in order to create <sys/wait.h> when the system
+# has one that is incomplete.
+sys/wait.h: sys_wait.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H)
+ $(AM_V_at)$(MKDIR_P) sys
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+ sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_SYS_WAIT_H''@|$(NEXT_SYS_WAIT_H)|g' \
+ -e 's/@''GNULIB_WAITPID''@/$(GNULIB_WAITPID)/g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ < $(srcdir)/sys_wait.in.h; \
+ } > $@-t && \
+ mv $@-t $@
+MOSTLYCLEANFILES += sys/wait.h sys/wait.h-t
+MOSTLYCLEANDIRS += sys
+
+EXTRA_DIST += sys_wait.in.h
+
+## end gnulib module sys_wait
+
## begin gnulib module tempname
libgnu_a_SOURCES += tempname.c
# strstr \
# strtok_r \
# sys_stat \
+# sys_wait \
# time_r \
# unistd \
# unsetenv \
$(top_srcdir)/import/m4/sys_time_h.m4 \
$(top_srcdir)/import/m4/sys_types_h.m4 \
$(top_srcdir)/import/m4/sys_uio_h.m4 \
+ $(top_srcdir)/import/m4/sys_wait_h.m4 \
$(top_srcdir)/import/m4/tempname.m4 \
$(top_srcdir)/import/m4/threadlib.m4 \
$(top_srcdir)/import/m4/time_h.m4 \
GNULIB_VSCANF = @GNULIB_VSCANF@
GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@
GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@
+GNULIB_WAITPID = @GNULIB_WAITPID@
GNULIB_WCPCPY = @GNULIB_WCPCPY@
GNULIB_WCPNCPY = @GNULIB_WCPNCPY@
GNULIB_WCRTOMB = @GNULIB_WCRTOMB@
NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H@
NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H@
NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_H@
NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@
NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@
NEXT_AS_FIRST_DIRECTIVE_WCHAR_H = @NEXT_AS_FIRST_DIRECTIVE_WCHAR_H@
NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@
NEXT_SYS_TYPES_H = @NEXT_SYS_TYPES_H@
NEXT_SYS_UIO_H = @NEXT_SYS_UIO_H@
+NEXT_SYS_WAIT_H = @NEXT_SYS_WAIT_H@
NEXT_TIME_H = @NEXT_TIME_H@
NEXT_UNISTD_H = @NEXT_UNISTD_H@
NEXT_WCHAR_H = @NEXT_WCHAR_H@
string.in.h strings.in.h strnlen.c strstr.c str-two-way.h \
strstr.c strtok_r.c sys_random.in.h sys_select.in.h \
sys_socket.in.h sys_stat.in.h sys_time.in.h sys_types.in.h \
- sys_uio.in.h tempname.h time.in.h time_r.c unistd.in.h \
- unistd--.h unistd-safer.h unsetenv.c \
+ sys_uio.in.h sys_wait.in.h tempname.h time.in.h time_r.c \
+ unistd.in.h unistd--.h unistd-safer.h unsetenv.c \
$(top_srcdir)/import/extra/update-copyright verify.h \
wchar.in.h wctype.in.h windows-initguard.h windows-mutex.c \
windows-mutex.h windows-once.c windows-once.h \
$(STDALIGN_H) $(STDBOOL_H) $(STDDEF_H) $(STDINT_H) stdio.h \
stdlib.h string.h strings.h sys/random.h sys/select.h \
sys/socket.h sys/stat.h sys/time.h sys/types.h sys/uio.h \
- time.h unistd.h wchar.h wctype.h
+ sys/wait.h time.h unistd.h wchar.h wctype.h
SUFFIXES =
MOSTLYCLEANFILES = core *.stackdump alloca.h alloca.h-t arpa/inet.h \
arpa/inet.h-t ctype.h ctype.h-t dirent.h dirent.h-t errno.h \
sys/random.h sys/random.h-t sys/select.h sys/select.h-t \
sys/socket.h sys/socket.h-t sys/stat.h sys/stat.h-t sys/time.h \
sys/time.h-t sys/types.h sys/types.h-t sys/uio.h sys/uio.h-t \
- time.h time.h-t unistd.h unistd.h-t wchar.h wchar.h-t wctype.h \
- wctype.h-t
-MOSTLYCLEANDIRS = arpa netinet sys sys sys sys sys
+ sys/wait.h sys/wait.h-t time.h time.h-t unistd.h unistd.h-t \
+ wchar.h wchar.h-t wctype.h wctype.h-t
+MOSTLYCLEANDIRS = arpa netinet sys sys sys sys sys sys
CLEANFILES =
DISTCLEANFILES =
MAINTAINERCLEANFILES =
} > $@-t && \
mv -f $@-t $@
+# We need the following in order to create <sys/wait.h> when the system
+# has one that is incomplete.
+sys/wait.h: sys_wait.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H)
+ $(AM_V_at)$(MKDIR_P) sys
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+ sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_SYS_WAIT_H''@|$(NEXT_SYS_WAIT_H)|g' \
+ -e 's/@''GNULIB_WAITPID''@/$(GNULIB_WAITPID)/g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ < $(srcdir)/sys_wait.in.h; \
+ } > $@-t && \
+ mv $@-t $@
+
# We need the following in order to create <time.h> when the system
# doesn't have one that works with the given compiler.
time.h: time.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
# strstr \
# strtok_r \
# sys_stat \
+# sys_wait \
# time_r \
# unistd \
# unsetenv \
strstr
strtok_r
sys_stat
+ sys_wait
time_r
unistd
unsetenv
# Code from module sys_time:
# Code from module sys_types:
# Code from module sys_uio:
+ # Code from module sys_wait:
# Code from module tempname:
# Code from module threadlib:
gl_THREADLIB_EARLY
AC_PROG_MKDIR_P
gl_HEADER_SYS_UIO
AC_PROG_MKDIR_P
+ gl_SYS_WAIT_H
+ AC_PROG_MKDIR_P
gl_FUNC_GEN_TEMPNAME
gl_MODULE_INDICATOR([tempname])
AC_REQUIRE([gl_THREADLIB])
lib/sys_time.in.h
lib/sys_types.in.h
lib/sys_uio.in.h
+ lib/sys_wait.in.h
lib/tempname.c
lib/tempname.h
lib/time.in.h
m4/sys_time_h.m4
m4/sys_types_h.m4
m4/sys_uio_h.m4
+ m4/sys_wait_h.m4
m4/tempname.m4
m4/threadlib.m4
m4/time_h.m4
--- /dev/null
+# sys_wait_h.m4 serial 6
+dnl Copyright (C) 2008-2021 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_SYS_WAIT_H],
+[
+ AC_REQUIRE([gl_SYS_WAIT_H_DEFAULTS])
+
+ dnl <sys/wait.h> is always overridden, because of GNULIB_POSIXCHECK.
+ gl_CHECK_NEXT_HEADERS([sys/wait.h])
+
+ dnl Ensure the type pid_t gets defined.
+ AC_REQUIRE([AC_TYPE_PID_T])
+
+ dnl Check for declarations of anything we want to poison if the
+ dnl corresponding gnulib module is not in use.
+ gl_WARN_ON_USE_PREPARE([[#include <sys/wait.h>]],
+ [waitpid])
+])
+
+AC_DEFUN([gl_SYS_WAIT_MODULE_INDICATOR],
+[
+ dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
+ AC_REQUIRE([gl_SYS_WAIT_H_DEFAULTS])
+ gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+ dnl Define it also as a C macro, for the benefit of the unit tests.
+ gl_MODULE_INDICATOR_FOR_TESTS([$1])
+])
+
+AC_DEFUN([gl_SYS_WAIT_H_DEFAULTS],
+[
+ GNULIB_WAITPID=0; AC_SUBST([GNULIB_WAITPID])
+ dnl Assume proper GNU behavior unless another module says otherwise.
+])
--- /dev/null
+/* A POSIX-like <sys/wait.h>.
+ Copyright (C) 2001-2003, 2005-2021 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, see <https://www.gnu.org/licenses/>. */
+
+
+#ifndef _@GUARD_PREFIX@_SYS_WAIT_H
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+/* The include_next requires a split double-inclusion guard. */
+#if !(defined _WIN32 && ! defined __CYGWIN__)
+# @INCLUDE_NEXT@ @NEXT_SYS_WAIT_H@
+#endif
+
+#ifndef _@GUARD_PREFIX@_SYS_WAIT_H
+#define _@GUARD_PREFIX@_SYS_WAIT_H
+
+/* Get pid_t. */
+#include <sys/types.h>
+
+
+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
+
+/* The definition of _GL_WARN_ON_USE is copied here. */
+
+
+#if !(defined _WIN32 && ! defined __CYGWIN__)
+/* Unix API. */
+
+/* The following macros apply to an argument x, that is a status of a process,
+ as returned by waitpid().
+ On nearly all systems, including Linux/x86, WEXITSTATUS are bits 15..8 and
+ WTERMSIG are bits 7..0, while BeOS uses the opposite. Therefore programs
+ have to use the abstract macros. */
+
+/* For valid x, exactly one of WIFSIGNALED(x), WIFEXITED(x), WIFSTOPPED(x)
+ is true. */
+# ifndef WIFSIGNALED
+# define WIFSIGNALED(x) (WTERMSIG (x) != 0 && WTERMSIG(x) != 0x7f)
+# endif
+# ifndef WIFEXITED
+# define WIFEXITED(x) (WTERMSIG (x) == 0)
+# endif
+# ifndef WIFSTOPPED
+# define WIFSTOPPED(x) (WTERMSIG (x) == 0x7f)
+# endif
+
+/* The termination signal. Only to be accessed if WIFSIGNALED(x) is true. */
+# ifndef WTERMSIG
+# define WTERMSIG(x) ((x) & 0x7f)
+# endif
+
+/* The exit status. Only to be accessed if WIFEXITED(x) is true. */
+# ifndef WEXITSTATUS
+# define WEXITSTATUS(x) (((x) >> 8) & 0xff)
+# endif
+
+/* The stopping signal. Only to be accessed if WIFSTOPPED(x) is true. */
+# ifndef WSTOPSIG
+# define WSTOPSIG(x) (((x) >> 8) & 0x7f)
+# endif
+
+/* True if the process dumped core. Not standardized by POSIX. */
+# ifndef WCOREDUMP
+# define WCOREDUMP(x) ((x) & 0x80)
+# endif
+
+#else
+/* Native Windows API. */
+
+# include <signal.h> /* for SIGTERM */
+
+/* The following macros apply to an argument x, that is a status of a process,
+ as returned by waitpid() or, equivalently, _cwait() or GetExitCodeProcess().
+ This value is simply an 'int', not composed of bit fields. */
+
+/* When an unhandled fatal signal terminates a process, the exit code is 3. */
+# define WIFSIGNALED(x) ((x) == 3)
+# define WIFEXITED(x) ((x) != 3)
+# define WIFSTOPPED(x) 0
+
+/* The signal that terminated a process is not known posthum. */
+# define WTERMSIG(x) SIGTERM
+
+# define WEXITSTATUS(x) (x)
+
+/* There are no stopping signals. */
+# define WSTOPSIG(x) 0
+
+/* There are no core dumps. */
+# define WCOREDUMP(x) 0
+
+#endif
+
+
+/* Declarations of functions. */
+
+#if @GNULIB_WAITPID@
+# if defined _WIN32 && ! defined __CYGWIN__
+_GL_FUNCDECL_SYS (waitpid, pid_t, (pid_t pid, int *statusp, int options));
+# endif
+/* Need to cast, because on Cygwin, the second parameter is
+ __wait_status_ptr_t statusp. */
+_GL_CXXALIAS_SYS_CAST (waitpid, pid_t, (pid_t pid, int *statusp, int options));
+_GL_CXXALIASWARN (waitpid);
+#elif defined GNULIB_POSIXCHECK
+# undef waitpid
+# if HAVE_RAW_DECL_WAITPID
+_GL_WARN_ON_USE (waitpid, "waitpid is unportable - "
+ "use gnulib module sys_wait for portability");
+# endif
+#endif
+
+
+#endif /* _@GUARD_PREFIX@_SYS_WAIT_H */
+#endif /* _@GUARD_PREFIX@_SYS_WAIT_H */
strstr \
strtok_r \
sys_stat \
+ sys_wait \
time_r \
unistd \
unsetenv \