mirror of
https://github.com/FAUSheppy/colorredstderr-mirror
synced 2025-12-09 16:38:32 +01:00
Only hook vfork() if it's available.
This commit is contained in:
@@ -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])
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user