Fork: Difference between revisions

Content added Content deleted
m (→‎{{header|Phix}}: added syntax colouring, marked p2js incompatible)
(Added XPL0 example.)
Line 1,932: Line 1,932:
syscall
syscall
</lang>
</lang>

=={{header|XPL0}}==
Works on Raspberry Pi.
<lang XPL0>int Key, Process;
[Key:= SharedMem(4); \allocate 4 bytes of memory common to both processes
Process:= Fork(1); \start one child process
case Process of
0: [Lock(Key); Text(0, "Rosetta"); CrLf(0); Unlock(Key)]; \parent process
1: [Lock(Key); Text(0, "Code"); CrLf(0); Unlock(Key)] \child process
other [Lock(Key); Text(0, "Error"); CrLf(0); Unlock(Key)];
Join(Process); \wait for child process to finish
]</lang>

{{out}}
<pre>
Rosetta
Code
</pre>


=={{header|zkl}}==
=={{header|zkl}}==