bug-inetutils
[Top][All Lists]
Advanced

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

[bug-inetutils] [PATCH 4/4] detect fork() support


From: Mike Frysinger
Subject: [bug-inetutils] [PATCH 4/4] detect fork() support
Date: Fri, 19 Nov 2010 02:04:56 -0500

Linux/nommu systems cannot support a fork(), so add a configure test for
it so apps can pick that or vfork().

Signed-off-by: Mike Frysinger <address@hidden>
---
 configure.ac                |    2 +-
 libinetutils/libinetutils.h |    9 +++++++++
 2 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/configure.ac b/configure.ac
index 25cc3db..98196f4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -580,7 +580,7 @@ AC_FUNC_MALLOC
 AC_FUNC_REALLOC
 
 AC_CHECK_FUNCS(cfsetspeed cgetent daemon dirfd fchdir flock \
-               fpathconf ftruncate \
+               fork fpathconf ftruncate \
               getcwd getmsg getspnam initgroups initsetproctitle killpg \
                mkstemp ptsname \
                setegid seteuid setpgid \
diff --git a/libinetutils/libinetutils.h b/libinetutils/libinetutils.h
index 19bbde5..86365b0 100644
--- a/libinetutils/libinetutils.h
+++ b/libinetutils/libinetutils.h
@@ -17,6 +17,8 @@
   You should have received a copy of the GNU General Public License
   along with this program.  If not, see `http://www.gnu.org/licenses/'. */
 
+#include <config.h>
+
 #include "argp-version-etc.h"
 
 void utmp_init (char *line, char *user, char *id);
@@ -32,3 +34,10 @@ extern const char *default_program_authors[];
 #define iu_argp_init(name, authors)                            \
   argp_program_bug_address = "<" PACKAGE_BUGREPORT ">";                \
   argp_version_setup (name, authors);
+
+#ifdef HAVE_FORK
+# define fork_exit(s) exit(s)
+#else
+# define fork() vfork()
+# define fork_exit(s) _exit(s)
+#endif
-- 
1.7.3.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]