<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--Rendered using the Haskell Html Library v0.2--> <HTML ><HEAD ><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" ><TITLE >System.Posix.Process</TITLE ><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" ><SCRIPT SRC="haddock-util.js" TYPE="text/javascript" ></SCRIPT ><SCRIPT TYPE="text/javascript" >window.onload = function () {setSynopsis("mini_System-Posix-Process.html")};</SCRIPT ></HEAD ><BODY ><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" ><TR ><TD CLASS="topbar" ><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" ><TR ><TD ><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " ></TD ><TD CLASS="title" >unix-2.3.2.0: POSIX functionality</TD ><TD CLASS="topbut" ><A HREF="index.html" >Contents</A ></TD ><TD CLASS="topbut" ><A HREF="doc-index.html" >Index</A ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="modulebar" ><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" ><TR ><TD ><FONT SIZE="6" >System.Posix.Process</FONT ></TD ><TD ALIGN="right" ><TABLE CLASS="narrow" CELLSPACING="0" CELLPADDING="0" ><TR ><TD CLASS="infohead" >Portability</TD ><TD CLASS="infoval" >non-portable (requires POSIX)</TD ></TR ><TR ><TD CLASS="infohead" >Stability</TD ><TD CLASS="infoval" >provisional</TD ></TR ><TR ><TD CLASS="infohead" >Maintainer</TD ><TD CLASS="infoval" >libraries@haskell.org</TD ></TR ></TABLE ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD ><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" ><TR ><TD CLASS="section4" ><B >Contents</B ></TD ></TR ><TR ><TD ><DL ><DT ><A HREF="#1" >Processes </A ></DT ><DD ><DL ><DT ><A HREF="#2" >Forking and executing </A ></DT ><DT ><A HREF="#3" >Exiting </A ></DT ><DT ><A HREF="#4" >Process environment </A ></DT ><DT ><A HREF="#5" >Process groups </A ></DT ><DT ><A HREF="#6" >Sessions </A ></DT ><DT ><A HREF="#7" >Process times </A ></DT ><DT ><A HREF="#8" >Scheduling priority </A ></DT ><DT ><A HREF="#9" >Process status </A ></DT ></DL ></DD ></DL ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="section1" >Description</TD ></TR ><TR ><TD CLASS="doc" >POSIX process support. See also the System.Cmd and System.Process modules in the process package. </TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="section1" >Synopsis</TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="body" ><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" ><TR ><TD CLASS="decl" ><A HREF="#v%3AforkProcess" >forkProcess</A > :: <A HREF="../base/System-IO.html#t%3AIO" >IO</A > <A HREF="../ghc-prim/GHC-Unit.html#t%3A%28%29" >()</A > -> <A HREF="../base/System-IO.html#t%3AIO" >IO</A > <A HREF="../base/System-Posix-Types.html#t%3AProcessID" >ProcessID</A ></TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AexecuteFile" >executeFile</A > :: <A HREF="../base/System-IO.html#t%3AFilePath" >FilePath</A > -> <A HREF="../ghc-prim/GHC-Bool.html#t%3ABool" >Bool</A > -> [<A HREF="../base/Data-Char.html#t%3AString" >String</A >] -> <A HREF="../base/Data-Maybe.html#t%3AMaybe" >Maybe</A > [(<A HREF="../base/Data-Char.html#t%3AString" >String</A >, <A HREF="../base/Data-Char.html#t%3AString" >String</A >)] -> <A HREF="../base/System-IO.html#t%3AIO" >IO</A > <A HREF="../ghc-prim/GHC-Unit.html#t%3A%28%29" >()</A ></TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AexitImmediately" >exitImmediately</A > :: <A HREF="../base/System-Exit.html#t%3AExitCode" >ExitCode</A > -> <A HREF="../base/System-IO.html#t%3AIO" >IO</A > <A HREF="../ghc-prim/GHC-Unit.html#t%3A%28%29" >()</A ></TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AgetProcessID" >getProcessID</A > :: <A HREF="../base/System-IO.html#t%3AIO" >IO</A > <A HREF="../base/System-Posix-Types.html#t%3AProcessID" >ProcessID</A ></TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AgetParentProcessID" >getParentProcessID</A > :: <A HREF="../base/System-IO.html#t%3AIO" >IO</A > <A HREF="../base/System-Posix-Types.html#t%3AProcessID" >ProcessID</A ></TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AgetProcessGroupID" >getProcessGroupID</A > :: <A HREF="../base/System-IO.html#t%3AIO" >IO</A > <A HREF="../base/System-Posix-Types.html#t%3AProcessGroupID" >ProcessGroupID</A ></TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AcreateProcessGroup" >createProcessGroup</A > :: <A HREF="../base/System-Posix-Types.html#t%3AProcessID" >ProcessID</A > -> <A HREF="../base/System-IO.html#t%3AIO" >IO</A > <A HREF="../base/System-Posix-Types.html#t%3AProcessGroupID" >ProcessGroupID</A ></TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AjoinProcessGroup" >joinProcessGroup</A > :: <A HREF="../base/System-Posix-Types.html#t%3AProcessGroupID" >ProcessGroupID</A > -> <A HREF="../base/System-IO.html#t%3AIO" >IO</A > <A HREF="../ghc-prim/GHC-Unit.html#t%3A%28%29" >()</A ></TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AsetProcessGroupID" >setProcessGroupID</A > :: <A HREF="../base/System-Posix-Types.html#t%3AProcessID" >ProcessID</A > -> <A HREF="../base/System-Posix-Types.html#t%3AProcessGroupID" >ProcessGroupID</A > -> <A HREF="../base/System-IO.html#t%3AIO" >IO</A > <A HREF="../ghc-prim/GHC-Unit.html#t%3A%28%29" >()</A ></TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AcreateSession" >createSession</A > :: <A HREF="../base/System-IO.html#t%3AIO" >IO</A > <A HREF="../base/System-Posix-Types.html#t%3AProcessGroupID" >ProcessGroupID</A ></TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><SPAN CLASS="keyword" >data</SPAN > <A HREF="#t%3AProcessTimes" >ProcessTimes</A > = <A HREF="#v%3AProcessTimes" >ProcessTimes</A > {<TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" ><TR ><TD CLASS="recfield" ><A HREF="#v%3AelapsedTime" >elapsedTime</A > :: <A HREF="../base/System-Posix-Types.html#t%3AClockTick" >ClockTick</A ></TD ></TR ><TR ><TD CLASS="recfield" ><A HREF="#v%3AuserTime" >userTime</A > :: <A HREF="../base/System-Posix-Types.html#t%3AClockTick" >ClockTick</A ></TD ></TR ><TR ><TD CLASS="recfield" ><A HREF="#v%3AsystemTime" >systemTime</A > :: <A HREF="../base/System-Posix-Types.html#t%3AClockTick" >ClockTick</A ></TD ></TR ><TR ><TD CLASS="recfield" ><A HREF="#v%3AchildUserTime" >childUserTime</A > :: <A HREF="../base/System-Posix-Types.html#t%3AClockTick" >ClockTick</A ></TD ></TR ><TR ><TD CLASS="recfield" ><A HREF="#v%3AchildSystemTime" >childSystemTime</A > :: <A HREF="../base/System-Posix-Types.html#t%3AClockTick" >ClockTick</A ></TD ></TR ></TABLE >}</TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AgetProcessTimes" >getProcessTimes</A > :: <A HREF="../base/System-IO.html#t%3AIO" >IO</A > <A HREF="System-Posix-Process.html#t%3AProcessTimes" >ProcessTimes</A ></TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3Anice" >nice</A > :: <A HREF="../ghc-prim/GHC-Types.html#t%3AInt" >Int</A > -> <A HREF="../base/System-IO.html#t%3AIO" >IO</A > <A HREF="../ghc-prim/GHC-Unit.html#t%3A%28%29" >()</A ></TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AgetProcessPriority" >getProcessPriority</A > :: <A HREF="../base/System-Posix-Types.html#t%3AProcessID" >ProcessID</A > -> <A HREF="../base/System-IO.html#t%3AIO" >IO</A > <A HREF="../ghc-prim/GHC-Types.html#t%3AInt" >Int</A ></TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AgetProcessGroupPriority" >getProcessGroupPriority</A > :: <A HREF="../base/System-Posix-Types.html#t%3AProcessGroupID" >ProcessGroupID</A > -> <A HREF="../base/System-IO.html#t%3AIO" >IO</A > <A HREF="../ghc-prim/GHC-Types.html#t%3AInt" >Int</A ></TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AgetUserPriority" >getUserPriority</A > :: <A HREF="../base/System-Posix-Types.html#t%3AUserID" >UserID</A > -> <A HREF="../base/System-IO.html#t%3AIO" >IO</A > <A HREF="../ghc-prim/GHC-Types.html#t%3AInt" >Int</A ></TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AsetProcessPriority" >setProcessPriority</A > :: <A HREF="../base/System-Posix-Types.html#t%3AProcessID" >ProcessID</A > -> <A HREF="../ghc-prim/GHC-Types.html#t%3AInt" >Int</A > -> <A HREF="../base/System-IO.html#t%3AIO" >IO</A > <A HREF="../ghc-prim/GHC-Unit.html#t%3A%28%29" >()</A ></TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AsetProcessGroupPriority" >setProcessGroupPriority</A > :: <A HREF="../base/System-Posix-Types.html#t%3AProcessGroupID" >ProcessGroupID</A > -> <A HREF="../ghc-prim/GHC-Types.html#t%3AInt" >Int</A > -> <A HREF="../base/System-IO.html#t%3AIO" >IO</A > <A HREF="../ghc-prim/GHC-Unit.html#t%3A%28%29" >()</A ></TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AsetUserPriority" >setUserPriority</A > :: <A HREF="../base/System-Posix-Types.html#t%3AUserID" >UserID</A > -> <A HREF="../ghc-prim/GHC-Types.html#t%3AInt" >Int</A > -> <A HREF="../base/System-IO.html#t%3AIO" >IO</A > <A HREF="../ghc-prim/GHC-Unit.html#t%3A%28%29" >()</A ></TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" ><TR ><TD CLASS="decl" ><SPAN CLASS="keyword" >data</SPAN > <A HREF="#t%3AProcessStatus" >ProcessStatus</A > </TD ></TR ><TR ><TD CLASS="body" ><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" ><TR ><TD CLASS="decl" >= <A HREF="#v%3AExited" >Exited</A > <A HREF="../base/System-Exit.html#t%3AExitCode" >ExitCode</A ></TD ></TR ><TR ><TD CLASS="decl" >| <A HREF="#v%3ATerminated" >Terminated</A > <A HREF="../base/GHC-Conc.html#t%3ASignal" >Signal</A ></TD ></TR ><TR ><TD CLASS="decl" >| <A HREF="#v%3AStopped" >Stopped</A > <A HREF="../base/GHC-Conc.html#t%3ASignal" >Signal</A ></TD ></TR ></TABLE ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AgetProcessStatus" >getProcessStatus</A > :: <A HREF="../ghc-prim/GHC-Bool.html#t%3ABool" >Bool</A > -> <A HREF="../ghc-prim/GHC-Bool.html#t%3ABool" >Bool</A > -> <A HREF="../base/System-Posix-Types.html#t%3AProcessID" >ProcessID</A > -> <A HREF="../base/System-IO.html#t%3AIO" >IO</A > (<A HREF="../base/Data-Maybe.html#t%3AMaybe" >Maybe</A > <A HREF="System-Posix-Process.html#t%3AProcessStatus" >ProcessStatus</A >)</TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AgetAnyProcessStatus" >getAnyProcessStatus</A > :: <A HREF="../ghc-prim/GHC-Bool.html#t%3ABool" >Bool</A > -> <A HREF="../ghc-prim/GHC-Bool.html#t%3ABool" >Bool</A > -> <A HREF="../base/System-IO.html#t%3AIO" >IO</A > (<A HREF="../base/Data-Maybe.html#t%3AMaybe" >Maybe</A > (<A HREF="../base/System-Posix-Types.html#t%3AProcessID" >ProcessID</A >, <A HREF="System-Posix-Process.html#t%3AProcessStatus" >ProcessStatus</A >))</TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AgetGroupProcessStatus" >getGroupProcessStatus</A > :: <A HREF="../ghc-prim/GHC-Bool.html#t%3ABool" >Bool</A > -> <A HREF="../ghc-prim/GHC-Bool.html#t%3ABool" >Bool</A > -> <A HREF="../base/System-Posix-Types.html#t%3AProcessGroupID" >ProcessGroupID</A > -> <A HREF="../base/System-IO.html#t%3AIO" >IO</A > (<A HREF="../base/Data-Maybe.html#t%3AMaybe" >Maybe</A > (<A HREF="../base/System-Posix-Types.html#t%3AProcessID" >ProcessID</A >, <A HREF="System-Posix-Process.html#t%3AProcessStatus" >ProcessStatus</A >))</TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="section1" ><A NAME="1" ><A NAME="1" >Processes </A ></A ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="section2" ><A NAME="2" ><A NAME="2" >Forking and executing </A ></A ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:forkProcess" ><A NAME="v%3AforkProcess" ></A ></A ><B >forkProcess</B > :: <A HREF="../base/System-IO.html#t%3AIO" >IO</A > <A HREF="../ghc-prim/GHC-Unit.html#t%3A%28%29" >()</A > -> <A HREF="../base/System-IO.html#t%3AIO" >IO</A > <A HREF="../base/System-Posix-Types.html#t%3AProcessID" >ProcessID</A ></TD ></TR ><TR ><TD CLASS="doc" ><P ><TT ><A HREF="System-Posix-Process.html#v%3AforkProcess" >forkProcess</A ></TT > corresponds to the POSIX <TT >fork</TT > system call. The <TT ><A HREF="../base/System-IO.html#t%3AIO" >IO</A ></TT > action passed as an argument is executed in the child process; no other threads will be copied to the child process. On success, <TT ><A HREF="System-Posix-Process.html#v%3AforkProcess" >forkProcess</A ></TT > returns the child's <TT ><A HREF="../base/System-Posix-Types.html#t%3AProcessID" >ProcessID</A ></TT > to the parent process; in case of an error, an exception is thrown. </P ><P ><TT ><A HREF="System-Posix-Process.html#v%3AforkProcess" >forkProcess</A ></TT > comes with a giant warning: since any other running threads are not copied into the child process, it's easy to go wrong: e.g. by accessing some shared resource that was held by another thread in the parent. Another example is the I/O manager thread: since the I/O manager isn't running in the child, attempting to do any Handle-based I/O will deadlock. </P ><P >Using <TT ><A HREF="System-Posix-Process.html#v%3AforkProcess" >forkProcess</A ></TT > in order to do <TT ><A HREF="System-Posix-Process.html#v%3AexecuteFile" >executeFile</A ></TT > is likely to work. Anything else: you're on your own. </P ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:executeFile" ><A NAME="v%3AexecuteFile" ></A ></A ><B >executeFile</B ></TD ></TR ><TR ><TD CLASS="body" ><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" ><TR ><TD CLASS="arg" >:: <A HREF="../base/System-IO.html#t%3AFilePath" >FilePath</A ></TD ><TD CLASS="rdoc" >Command </TD ></TR ><TR ><TD CLASS="arg" >-> <A HREF="../ghc-prim/GHC-Bool.html#t%3ABool" >Bool</A ></TD ><TD CLASS="rdoc" >Search PATH? </TD ></TR ><TR ><TD CLASS="arg" >-> [<A HREF="../base/Data-Char.html#t%3AString" >String</A >]</TD ><TD CLASS="rdoc" >Arguments </TD ></TR ><TR ><TD CLASS="arg" >-> <A HREF="../base/Data-Maybe.html#t%3AMaybe" >Maybe</A > [(<A HREF="../base/Data-Char.html#t%3AString" >String</A >, <A HREF="../base/Data-Char.html#t%3AString" >String</A >)]</TD ><TD CLASS="rdoc" >Environment </TD ></TR ><TR ><TD CLASS="arg" >-> <A HREF="../base/System-IO.html#t%3AIO" >IO</A > <A HREF="../ghc-prim/GHC-Unit.html#t%3A%28%29" >()</A ></TD ><TD CLASS="rdoc" ></TD ></TR ><TR ><TD CLASS="ndoc" COLSPAN="2" ><TT ><TT ><A HREF="System-Posix-Process.html#v%3AexecuteFile" >executeFile</A ></TT > cmd args env</TT > calls one of the <TT >execv*</TT > family, depending on whether or not the current PATH is to be searched for the command, and whether or not an environment is provided to supersede the process's current environment. The basename (leading directory names suppressed) of the command is passed to <TT >execv*</TT > as <TT >arg[0]</TT >; the argument list passed to <TT ><A HREF="System-Posix-Process.html#v%3AexecuteFile" >executeFile</A ></TT > therefore begins with <TT >arg[1]</TT >. </TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="section2" ><A NAME="3" ><A NAME="3" >Exiting </A ></A ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:exitImmediately" ><A NAME="v%3AexitImmediately" ></A ></A ><B >exitImmediately</B > :: <A HREF="../base/System-Exit.html#t%3AExitCode" >ExitCode</A > -> <A HREF="../base/System-IO.html#t%3AIO" >IO</A > <A HREF="../ghc-prim/GHC-Unit.html#t%3A%28%29" >()</A ></TD ></TR ><TR ><TD CLASS="doc" ><TT ><TT ><A HREF="System-Posix-Process.html#v%3AexitImmediately" >exitImmediately</A ></TT > status</TT > calls <TT >_exit</TT > to terminate the process with the indicated exit <TT >status</TT >. The operation never returns. </TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="section2" ><A NAME="4" ><A NAME="4" >Process environment </A ></A ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:getProcessID" ><A NAME="v%3AgetProcessID" ></A ></A ><B >getProcessID</B > :: <A HREF="../base/System-IO.html#t%3AIO" >IO</A > <A HREF="../base/System-Posix-Types.html#t%3AProcessID" >ProcessID</A ></TD ></TR ><TR ><TD CLASS="doc" ><TT ><A HREF="System-Posix-Process.html#v%3AgetProcessID" >getProcessID</A ></TT > calls <TT >getpid</TT > to obtain the <TT ><A HREF="../base/System-Posix-Types.html#t%3AProcessID" >ProcessID</A ></TT > for the current process. </TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:getParentProcessID" ><A NAME="v%3AgetParentProcessID" ></A ></A ><B >getParentProcessID</B > :: <A HREF="../base/System-IO.html#t%3AIO" >IO</A > <A HREF="../base/System-Posix-Types.html#t%3AProcessID" >ProcessID</A ></TD ></TR ><TR ><TD CLASS="doc" ><TT ><A HREF="System-Posix-Process.html#v%3AgetProcessID" >getProcessID</A ></TT > calls <TT >getppid</TT > to obtain the <TT ><A HREF="../base/System-Posix-Types.html#t%3AProcessID" >ProcessID</A ></TT > for the parent of the current process. </TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:getProcessGroupID" ><A NAME="v%3AgetProcessGroupID" ></A ></A ><B >getProcessGroupID</B > :: <A HREF="../base/System-IO.html#t%3AIO" >IO</A > <A HREF="../base/System-Posix-Types.html#t%3AProcessGroupID" >ProcessGroupID</A ></TD ></TR ><TR ><TD CLASS="doc" ><TT ><A HREF="System-Posix-Process.html#v%3AgetProcessGroupID" >getProcessGroupID</A ></TT > calls <TT >getpgrp</TT > to obtain the <TT ><A HREF="../base/System-Posix-Types.html#t%3AProcessGroupID" >ProcessGroupID</A ></TT > for the current process. </TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="section2" ><A NAME="5" ><A NAME="5" >Process groups </A ></A ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:createProcessGroup" ><A NAME="v%3AcreateProcessGroup" ></A ></A ><B >createProcessGroup</B > :: <A HREF="../base/System-Posix-Types.html#t%3AProcessID" >ProcessID</A > -> <A HREF="../base/System-IO.html#t%3AIO" >IO</A > <A HREF="../base/System-Posix-Types.html#t%3AProcessGroupID" >ProcessGroupID</A ></TD ></TR ><TR ><TD CLASS="doc" ><TT ><TT ><A HREF="System-Posix-Process.html#v%3AcreateProcessGroup" >createProcessGroup</A ></TT > pid</TT > calls <TT >setpgid</TT > to make process <TT >pid</TT > a new process group leader. </TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:joinProcessGroup" ><A NAME="v%3AjoinProcessGroup" ></A ></A ><B >joinProcessGroup</B > :: <A HREF="../base/System-Posix-Types.html#t%3AProcessGroupID" >ProcessGroupID</A > -> <A HREF="../base/System-IO.html#t%3AIO" >IO</A > <A HREF="../ghc-prim/GHC-Unit.html#t%3A%28%29" >()</A ></TD ></TR ><TR ><TD CLASS="doc" ><TT ><TT ><A HREF="System-Posix-Process.html#v%3AjoinProcessGroup" >joinProcessGroup</A ></TT > pgid</TT > calls <TT >setpgid</TT > to set the <TT ><A HREF="../base/System-Posix-Types.html#t%3AProcessGroupID" >ProcessGroupID</A ></TT > of the current process to <TT >pgid</TT >. </TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:setProcessGroupID" ><A NAME="v%3AsetProcessGroupID" ></A ></A ><B >setProcessGroupID</B > :: <A HREF="../base/System-Posix-Types.html#t%3AProcessID" >ProcessID</A > -> <A HREF="../base/System-Posix-Types.html#t%3AProcessGroupID" >ProcessGroupID</A > -> <A HREF="../base/System-IO.html#t%3AIO" >IO</A > <A HREF="../ghc-prim/GHC-Unit.html#t%3A%28%29" >()</A ></TD ></TR ><TR ><TD CLASS="doc" ><TT ><TT ><A HREF="System-Posix-Process.html#v%3AsetProcessGroupID" >setProcessGroupID</A ></TT > pid pgid</TT > calls <TT >setpgid</TT > to set the <TT ><A HREF="../base/System-Posix-Types.html#t%3AProcessGroupID" >ProcessGroupID</A ></TT > for process <TT >pid</TT > to <TT >pgid</TT >. </TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="section2" ><A NAME="6" ><A NAME="6" >Sessions </A ></A ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:createSession" ><A NAME="v%3AcreateSession" ></A ></A ><B >createSession</B > :: <A HREF="../base/System-IO.html#t%3AIO" >IO</A > <A HREF="../base/System-Posix-Types.html#t%3AProcessGroupID" >ProcessGroupID</A ></TD ></TR ><TR ><TD CLASS="doc" ><TT ><A HREF="System-Posix-Process.html#v%3AcreateSession" >createSession</A ></TT > calls <TT >setsid</TT > to create a new session with the current process as session leader. </TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="section2" ><A NAME="7" ><A NAME="7" >Process times </A ></A ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><SPAN CLASS="keyword" >data</SPAN > <A NAME="t:ProcessTimes" ><A NAME="t%3AProcessTimes" ></A ></A ><B >ProcessTimes</B > </TD ></TR ><TR ><TD CLASS="body" ><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" ><TR ><TD CLASS="section4" >Constructors</TD ></TR ><TR ><TD CLASS="body" ><TABLE CLASS="vanilla" CELLSPACING="5" CELLPADDING="0" ><TR ><TD CLASS="arg" ><A NAME="v:ProcessTimes" ><A NAME="v%3AProcessTimes" ></A ></A ><B >ProcessTimes</B ></TD ><TD CLASS="rdoc" ></TD ></TR ><TR ><TD CLASS="body" COLSPAN="2" ><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" ><TR ><TD CLASS="arg" ><A NAME="v:elapsedTime" ><A NAME="v%3AelapsedTime" ></A ></A ><B >elapsedTime</B > :: <A HREF="../base/System-Posix-Types.html#t%3AClockTick" >ClockTick</A ></TD ><TD CLASS="rdoc" ></TD ></TR ><TR ><TD CLASS="arg" ><A NAME="v:userTime" ><A NAME="v%3AuserTime" ></A ></A ><B >userTime</B > :: <A HREF="../base/System-Posix-Types.html#t%3AClockTick" >ClockTick</A ></TD ><TD CLASS="rdoc" ></TD ></TR ><TR ><TD CLASS="arg" ><A NAME="v:systemTime" ><A NAME="v%3AsystemTime" ></A ></A ><B >systemTime</B > :: <A HREF="../base/System-Posix-Types.html#t%3AClockTick" >ClockTick</A ></TD ><TD CLASS="rdoc" ></TD ></TR ><TR ><TD CLASS="arg" ><A NAME="v:childUserTime" ><A NAME="v%3AchildUserTime" ></A ></A ><B >childUserTime</B > :: <A HREF="../base/System-Posix-Types.html#t%3AClockTick" >ClockTick</A ></TD ><TD CLASS="rdoc" ></TD ></TR ><TR ><TD CLASS="arg" ><A NAME="v:childSystemTime" ><A NAME="v%3AchildSystemTime" ></A ></A ><B >childSystemTime</B > :: <A HREF="../base/System-Posix-Types.html#t%3AClockTick" >ClockTick</A ></TD ><TD CLASS="rdoc" ></TD ></TR ></TABLE ></TD ></TR ></TABLE ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:getProcessTimes" ><A NAME="v%3AgetProcessTimes" ></A ></A ><B >getProcessTimes</B > :: <A HREF="../base/System-IO.html#t%3AIO" >IO</A > <A HREF="System-Posix-Process.html#t%3AProcessTimes" >ProcessTimes</A ></TD ></TR ><TR ><TD CLASS="doc" ><TT ><A HREF="System-Posix-Process.html#v%3AgetProcessTimes" >getProcessTimes</A ></TT > calls <TT >times</TT > to obtain time-accounting information for the current process and its children. </TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="section2" ><A NAME="8" ><A NAME="8" >Scheduling priority </A ></A ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:nice" ><A NAME="v%3Anice" ></A ></A ><B >nice</B > :: <A HREF="../ghc-prim/GHC-Types.html#t%3AInt" >Int</A > -> <A HREF="../base/System-IO.html#t%3AIO" >IO</A > <A HREF="../ghc-prim/GHC-Unit.html#t%3A%28%29" >()</A ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:getProcessPriority" ><A NAME="v%3AgetProcessPriority" ></A ></A ><B >getProcessPriority</B > :: <A HREF="../base/System-Posix-Types.html#t%3AProcessID" >ProcessID</A > -> <A HREF="../base/System-IO.html#t%3AIO" >IO</A > <A HREF="../ghc-prim/GHC-Types.html#t%3AInt" >Int</A ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:getProcessGroupPriority" ><A NAME="v%3AgetProcessGroupPriority" ></A ></A ><B >getProcessGroupPriority</B > :: <A HREF="../base/System-Posix-Types.html#t%3AProcessGroupID" >ProcessGroupID</A > -> <A HREF="../base/System-IO.html#t%3AIO" >IO</A > <A HREF="../ghc-prim/GHC-Types.html#t%3AInt" >Int</A ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:getUserPriority" ><A NAME="v%3AgetUserPriority" ></A ></A ><B >getUserPriority</B > :: <A HREF="../base/System-Posix-Types.html#t%3AUserID" >UserID</A > -> <A HREF="../base/System-IO.html#t%3AIO" >IO</A > <A HREF="../ghc-prim/GHC-Types.html#t%3AInt" >Int</A ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:setProcessPriority" ><A NAME="v%3AsetProcessPriority" ></A ></A ><B >setProcessPriority</B > :: <A HREF="../base/System-Posix-Types.html#t%3AProcessID" >ProcessID</A > -> <A HREF="../ghc-prim/GHC-Types.html#t%3AInt" >Int</A > -> <A HREF="../base/System-IO.html#t%3AIO" >IO</A > <A HREF="../ghc-prim/GHC-Unit.html#t%3A%28%29" >()</A ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:setProcessGroupPriority" ><A NAME="v%3AsetProcessGroupPriority" ></A ></A ><B >setProcessGroupPriority</B > :: <A HREF="../base/System-Posix-Types.html#t%3AProcessGroupID" >ProcessGroupID</A > -> <A HREF="../ghc-prim/GHC-Types.html#t%3AInt" >Int</A > -> <A HREF="../base/System-IO.html#t%3AIO" >IO</A > <A HREF="../ghc-prim/GHC-Unit.html#t%3A%28%29" >()</A ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:setUserPriority" ><A NAME="v%3AsetUserPriority" ></A ></A ><B >setUserPriority</B > :: <A HREF="../base/System-Posix-Types.html#t%3AUserID" >UserID</A > -> <A HREF="../ghc-prim/GHC-Types.html#t%3AInt" >Int</A > -> <A HREF="../base/System-IO.html#t%3AIO" >IO</A > <A HREF="../ghc-prim/GHC-Unit.html#t%3A%28%29" >()</A ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="section2" ><A NAME="9" ><A NAME="9" >Process status </A ></A ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><SPAN CLASS="keyword" >data</SPAN > <A NAME="t:ProcessStatus" ><A NAME="t%3AProcessStatus" ></A ></A ><B >ProcessStatus</B > </TD ></TR ><TR ><TD CLASS="body" ><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" ><TR ><TD CLASS="section4" >Constructors</TD ></TR ><TR ><TD CLASS="body" ><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" ><TR ><TD CLASS="arg" ><A NAME="v:Exited" ><A NAME="v%3AExited" ></A ></A ><B >Exited</B > <A HREF="../base/System-Exit.html#t%3AExitCode" >ExitCode</A ></TD ><TD CLASS="rdoc" ></TD ></TR ><TR ><TD CLASS="arg" ><A NAME="v:Terminated" ><A NAME="v%3ATerminated" ></A ></A ><B >Terminated</B > <A HREF="../base/GHC-Conc.html#t%3ASignal" >Signal</A ></TD ><TD CLASS="rdoc" ></TD ></TR ><TR ><TD CLASS="arg" ><A NAME="v:Stopped" ><A NAME="v%3AStopped" ></A ></A ><B >Stopped</B > <A HREF="../base/GHC-Conc.html#t%3ASignal" >Signal</A ></TD ><TD CLASS="rdoc" ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="section4" ><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'i:ProcessStatus')" ALT="show/hide" > Instances</TD ></TR ><TR ><TD CLASS="body" ><DIV ID="i:ProcessStatus" STYLE="display:block;" ><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" ><TR ><TD CLASS="decl" ><A HREF="../base/Data-Eq.html#t%3AEq" >Eq</A > <A HREF="System-Posix-Process.html#t%3AProcessStatus" >ProcessStatus</A ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="../base/Data-Ord.html#t%3AOrd" >Ord</A > <A HREF="System-Posix-Process.html#t%3AProcessStatus" >ProcessStatus</A ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="../base/Text-Show.html#t%3AShow" >Show</A > <A HREF="System-Posix-Process.html#t%3AProcessStatus" >ProcessStatus</A ></TD ></TR ></TABLE ></DIV ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:getProcessStatus" ><A NAME="v%3AgetProcessStatus" ></A ></A ><B >getProcessStatus</B > :: <A HREF="../ghc-prim/GHC-Bool.html#t%3ABool" >Bool</A > -> <A HREF="../ghc-prim/GHC-Bool.html#t%3ABool" >Bool</A > -> <A HREF="../base/System-Posix-Types.html#t%3AProcessID" >ProcessID</A > -> <A HREF="../base/System-IO.html#t%3AIO" >IO</A > (<A HREF="../base/Data-Maybe.html#t%3AMaybe" >Maybe</A > <A HREF="System-Posix-Process.html#t%3AProcessStatus" >ProcessStatus</A >)</TD ></TR ><TR ><TD CLASS="doc" ><TT ><TT ><A HREF="System-Posix-Process.html#v%3AgetProcessStatus" >getProcessStatus</A ></TT > blk stopped pid</TT > calls <TT >waitpid</TT >, returning <TT ><TT ><A HREF="../base/Data-Maybe.html#v%3AJust" >Just</A ></TT > tc</TT >, the <TT ><A HREF="System-Posix-Process.html#t%3AProcessStatus" >ProcessStatus</A ></TT > for process <TT >pid</TT > if it is available, <TT ><A HREF="../base/Data-Maybe.html#v%3ANothing" >Nothing</A ></TT > otherwise. If <TT >blk</TT > is <TT ><A HREF="../ghc-prim/GHC-Bool.html#v%3AFalse" >False</A ></TT >, then <TT >WNOHANG</TT > is set in the options for <TT >waitpid</TT >, otherwise not. If <TT >stopped</TT > is <TT ><A HREF="../ghc-prim/GHC-Bool.html#v%3ATrue" >True</A ></TT >, then <TT >WUNTRACED</TT > is set in the options for <TT >waitpid</TT >, otherwise not. </TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:getAnyProcessStatus" ><A NAME="v%3AgetAnyProcessStatus" ></A ></A ><B >getAnyProcessStatus</B > :: <A HREF="../ghc-prim/GHC-Bool.html#t%3ABool" >Bool</A > -> <A HREF="../ghc-prim/GHC-Bool.html#t%3ABool" >Bool</A > -> <A HREF="../base/System-IO.html#t%3AIO" >IO</A > (<A HREF="../base/Data-Maybe.html#t%3AMaybe" >Maybe</A > (<A HREF="../base/System-Posix-Types.html#t%3AProcessID" >ProcessID</A >, <A HREF="System-Posix-Process.html#t%3AProcessStatus" >ProcessStatus</A >))</TD ></TR ><TR ><TD CLASS="doc" ><TT ><TT ><A HREF="System-Posix-Process.html#v%3AgetAnyProcessStatus" >getAnyProcessStatus</A ></TT > blk stopped</TT > calls <TT >waitpid</TT >, returning <TT ><TT ><A HREF="../base/Data-Maybe.html#v%3AJust" >Just</A ></TT > (pid, tc)</TT >, the <TT ><A HREF="../base/System-Posix-Types.html#t%3AProcessID" >ProcessID</A ></TT > and <TT ><A HREF="System-Posix-Process.html#t%3AProcessStatus" >ProcessStatus</A ></TT > for any child process if one is available, <TT ><A HREF="../base/Data-Maybe.html#v%3ANothing" >Nothing</A ></TT > otherwise. If <TT >blk</TT > is <TT ><A HREF="../ghc-prim/GHC-Bool.html#v%3AFalse" >False</A ></TT >, then <TT >WNOHANG</TT > is set in the options for <TT >waitpid</TT >, otherwise not. If <TT >stopped</TT > is <TT ><A HREF="../ghc-prim/GHC-Bool.html#v%3ATrue" >True</A ></TT >, then <TT >WUNTRACED</TT > is set in the options for <TT >waitpid</TT >, otherwise not. </TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:getGroupProcessStatus" ><A NAME="v%3AgetGroupProcessStatus" ></A ></A ><B >getGroupProcessStatus</B > :: <A HREF="../ghc-prim/GHC-Bool.html#t%3ABool" >Bool</A > -> <A HREF="../ghc-prim/GHC-Bool.html#t%3ABool" >Bool</A > -> <A HREF="../base/System-Posix-Types.html#t%3AProcessGroupID" >ProcessGroupID</A > -> <A HREF="../base/System-IO.html#t%3AIO" >IO</A > (<A HREF="../base/Data-Maybe.html#t%3AMaybe" >Maybe</A > (<A HREF="../base/System-Posix-Types.html#t%3AProcessID" >ProcessID</A >, <A HREF="System-Posix-Process.html#t%3AProcessStatus" >ProcessStatus</A >))</TD ></TR ><TR ><TD CLASS="doc" ><TT ><TT ><A HREF="System-Posix-Process.html#v%3AgetGroupProcessStatus" >getGroupProcessStatus</A ></TT > blk stopped pgid</TT > calls <TT >waitpid</TT >, returning <TT ><TT ><A HREF="../base/Data-Maybe.html#v%3AJust" >Just</A ></TT > (pid, tc)</TT >, the <TT ><A HREF="../base/System-Posix-Types.html#t%3AProcessID" >ProcessID</A ></TT > and <TT ><A HREF="System-Posix-Process.html#t%3AProcessStatus" >ProcessStatus</A ></TT > for any process in group <TT >pgid</TT > if one is available, <TT ><A HREF="../base/Data-Maybe.html#v%3ANothing" >Nothing</A ></TT > otherwise. If <TT >blk</TT > is <TT ><A HREF="../ghc-prim/GHC-Bool.html#v%3AFalse" >False</A ></TT >, then <TT >WNOHANG</TT > is set in the options for <TT >waitpid</TT >, otherwise not. If <TT >stopped</TT > is <TT ><A HREF="../ghc-prim/GHC-Bool.html#v%3ATrue" >True</A ></TT >, then <TT >WUNTRACED</TT > is set in the options for <TT >waitpid</TT >, otherwise not. </TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="botbar" >Produced by <A HREF="http://www.haskell.org/haddock/" >Haddock</A > version 2.4.2</TD ></TR ></TABLE ></BODY ></HTML >