Skip to content

Commit

Permalink
Merge pull request #279 from bgamari/wip/T261
Browse files Browse the repository at this point in the history
Drop vfork support
  • Loading branch information
snoyberg authored Mar 14, 2023
2 parents 383181f + 203aa08 commit 484286a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 14 deletions.
14 changes: 2 additions & 12 deletions cbits/posix/fork_exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,9 @@
#include <signal.h>
#endif

#if defined(HAVE_VFORK_H)
#include <vfork.h>
#endif

#include <Rts.h>

#if defined(HAVE_WORKING_VFORK)
#define myfork vfork
#elif defined(HAVE_WORKING_FORK)
#if defined(HAVE_WORKING_FORK)
#define myfork fork
// We don't need a fork command on Windows
#else
Expand Down Expand Up @@ -152,7 +146,7 @@ do_spawn_fork (char *const args[],
}
#endif

int pid = myfork();
int pid = fork();
switch(pid)
{
case -1:
Expand All @@ -164,10 +158,6 @@ do_spawn_fork (char *const args[],
return -1;

case 0:
// WARNING! We may now be in the child of vfork(), and any
// memory we modify below may also be seen in the parent
// process.

close(forkCommunicationFds[0]);
fcntl(forkCommunicationFds[1], F_SETFD, FD_CLOEXEC);

Expand Down
3 changes: 2 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
## unreleased

* Fix deadlock when waiting for process completion and process jobs [#273](https://github.com/haskell/process/issues/273)
* Support delegate_ctlc on Windows. [#278](https://github.com/haskell/process/pull/278)
* Support `delegate_ctlc` on Windows. [#278](https://github.com/haskell/process/pull/278)
* Drop support for `vfork` [#261](https://github.com/haskell/process/pull/261)

## 1.6.17.0 *February 2023*

Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ AC_CONFIG_HEADERS([include/HsProcessConfig.h])

AC_PROG_CC

dnl ** Working vfork?
dnl ** Working fork?
AC_FUNC_FORK

# check for specific header (.h) files that we are interested in
Expand Down

0 comments on commit 484286a

Please sign in to comment.