System Calls
- Alarm(s): RngIntElt
A procedure which when used on UNIX systems, sends the signal SIGALRM to the Magma process after \(s\) seconds. This allows the user to specify that a Magma-process should self-destruct after a certain period.
- ChangeDirectory(s): MonStgElt
Change to the directory specified by the string \(s\). Tilde expansion is allowed.
- Fork() -> RngIntElt
ExitSummary: BoolElt Default: false
Execute the Unix/Linux system call
fork()and return the process ID of the child (if now the parent), or return 0 (if now the child). If the parameterExitSummaryis set totrue, then the child process prints the usual exit summary ("Total time: ...") when it exits; otherwise this is suppressed (the default).
- System(C): MonStgElt -> RngIntElt
Execute the system command specified by the string \(C\). This is done by calling the C function
system(). This also returns the system command’s return value as an integer. On most Unix systems, the lower 8 bits of this value give the process status while the next 8 bits give the value given by the command to the C functionexit()(see the Unix manual entries forsystem(3)orwait(2), for example). Thus one should normally divide the result by 256 to get the exit value of the program on success. See also thePipeintrinsic function.