2018-01-24 18:08:18 +03:00
|
|
|
(system-include "carp_system.h")
|
2018-01-24 17:53:18 +03:00
|
|
|
|
2017-06-26 12:15:03 +03:00
|
|
|
(defmodule System
|
2018-05-12 16:58:49 +03:00
|
|
|
(doc free "Frees an object. Should not be called except in direst circumstances.")
|
2017-06-26 12:15:03 +03:00
|
|
|
(register free (Fn [t] ()))
|
2018-05-12 16:58:49 +03:00
|
|
|
(doc time "Gets the current system time as an integer.")
|
2017-06-26 12:15:03 +03:00
|
|
|
(register time (Fn [] Int))
|
2018-10-19 11:31:00 +03:00
|
|
|
(doc nanotime "Gets the current system time in nanoseconds as a long.")
|
|
|
|
(register nanotime (Fn [] Long))
|
2018-05-12 16:58:49 +03:00
|
|
|
(doc sleep-seconds "Sleeps for a specified number of seconds.")
|
2017-12-25 18:51:23 +03:00
|
|
|
(register sleep-seconds (Fn [Int] ()))
|
2018-05-12 16:58:49 +03:00
|
|
|
(doc sleep-seconds "Sleeps for a specified number of microseconds.")
|
2018-02-27 16:49:06 +03:00
|
|
|
(register sleep-micros (Fn [Int] ()))
|
2018-05-12 16:58:49 +03:00
|
|
|
(doc system "Performs a system command.")
|
2018-03-11 16:53:50 +03:00
|
|
|
(register system (Fn [&String] ()))
|
2018-05-12 16:58:49 +03:00
|
|
|
(doc get-arg "Gets the command line argument at a specified index.")
|
2018-04-04 10:00:20 +03:00
|
|
|
(register get-arg (Fn [Int] (Ref String)))
|
2019-04-17 00:49:31 +03:00
|
|
|
(doc get-args-len "Gets the number of command line arguments.")
|
2018-04-04 10:00:20 +03:00
|
|
|
(register get-args-len (Fn [] Int))
|
2018-05-23 14:57:55 +03:00
|
|
|
(register fork (Fn [] Int) "fork")
|
|
|
|
(register wait (Fn [(Ptr Int)] Int) "wait")
|
|
|
|
(register get-exit-status (Fn [Int] Int) "WEXITSTATUS")
|
2018-05-23 16:13:13 +03:00
|
|
|
(register signal (Fn [Int (Fn [Int] ())] ()) "signal")
|
|
|
|
(register signal-abort Int "SIGABRT")
|
|
|
|
(register signal-fpe Int "SIGFPE")
|
|
|
|
(register signal-ill Int "SIGILL")
|
|
|
|
(register signal-int Int "SIGINT")
|
|
|
|
(register signal-segv Int "SIGSEGV")
|
|
|
|
(register signal-term Int "SIGTERM")
|
2018-02-27 16:49:06 +03:00
|
|
|
)
|
|
|
|
|