17 library(unix): Unix specific operations
AllApplicationManualNameSummaryHelp

  • Documentation
    • Reference manual
    • Packages
      • SWI-Prolog C-library
        • library(unix): Unix specific operations
          • fork/1
          • fork_exec/1
          • exec/1
          • wait/2
          • kill/2
          • pipe/2
          • dup/2
          • detach_IO/1
          • detach_IO/0
          • prctl/1
          • sysconf/1
Availability::- use_module(library(unix)).(can be autoloaded)
Source[det]fork_exec(+Command)
Fork (as fork/1) and exec (using exec/1) the child immediately. This behaves as the code below, but bypasses the check for the existence of other threads because this is a safe scenario.
fork_exec(Command) :-
      (   fork(child)
      ->  exec(Command)
      ;   true
      ).