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]wait(?Pid, -Status)
Wait for a child to change status. Then report the child that changed status as well as the reason. If Pid is bound on entry then the status of the specified child is reported. If not, then the status of any child is reported. Status is unified with exited(ExitCode) if the child with pid Pid was terminated by calling exit() (Prolog halt/1). ExitCode is the return status. Status is unified with signaled(Signal) if the child died due to a software interrupt (see kill/2). Signal contains the signal number. Finally, if the process suspended execution due to a signal, Status is unified with stopped(Signal).