Jump to content

Fork: Difference between revisions

540 bytes added ,  2 years ago
Added XPL0 example.
m (→‎{{header|Phix}}: added syntax colouring, marked p2js incompatible)
(Added XPL0 example.)
Line 1,932:
syscall
</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}}==
296

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.