Only hook vfork() if it's available.

This commit is contained in:
Simon Ruderich
2013-06-03 21:59:57 +02:00
parent 66fb589680
commit 7c5d6fce3a
2 changed files with 4 additions and 0 deletions

View File

@@ -37,9 +37,11 @@ AC_C_INLINE
AC_CHECK_HEADERS([fcntl.h])
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
AC_FUNC_FORK
AC_FUNC_MALLOC
AC_FUNC_REALLOC
AC_CHECK_FUNCS([dup2 memmove setenv strdup])

View File

@@ -330,6 +330,7 @@ int fclose(FILE *fp) {
/* Hook functions which are necessary for correct tracking. */
#if defined(HAVE_VFORK) && defined(HAVE_FORK)
pid_t vfork(void) {
/* vfork() is similar to fork() but the address space is shared between
* father and child. It's designed for fork()/exec() usage because it's
@@ -344,3 +345,4 @@ pid_t vfork(void) {
* most systems use copy-on-write anyway not a performance issue. */
return fork();
}
#endif