Fork: Difference between revisions
Content added Content deleted
MaiconSoft (talk | contribs) (Added Delphi example) |
(Updated to make the program able to compile and execute. Added output.) |
||
Line 1,020: | Line 1,020: | ||
=={{header|Nim}}== |
=={{header|Nim}}== |
||
<lang nim>import posix |
<lang nim>import posix |
||
var pid = fork() |
var pid = fork() |
||
if pid < 0: |
if pid < 0: |
||
echo "Error forking a child" |
|||
elif pid > 0: |
elif pid > 0: |
||
echo "This is the parent process and its child has id ", pid, '.' |
|||
# Further parent stuff. |
|||
else: |
else: |
||
echo "This is the child process." |
|||
⚫ | |||
quit() |
|||
⚫ | |||
{{out}} |
|||
<pre>This is the parent process and its child has id 8506. |
|||
This is the child process.</pre> |
|||
=={{header|OCaml}}== |
=={{header|OCaml}}== |