mirror of
https://github.com/carp-lang/Carp.git
synced 2024-10-26 13:51:50 +03:00
77614b21d9
+ Error values included are those that can be set from calling `fopen` + Change order of imports so that the System module is available before the IO module
53 lines
1.9 KiB
Plaintext
53 lines
1.9 KiB
Plaintext
(system-include "carp_system.h")
|
|
(system-include "errno.h")
|
|
|
|
(defmodule System
|
|
(doc free "Frees an object. Should not be called except in direst circumstances.")
|
|
(register free (Fn [t] ()))
|
|
(doc time "Gets the current system time as an integer.")
|
|
(register time (Fn [] Int))
|
|
(doc nanotime "Gets the current system time in nanoseconds as a long.")
|
|
(register nanotime (Fn [] Long))
|
|
(doc sleep-seconds "Sleeps for a specified number of seconds.")
|
|
(register sleep-seconds (Fn [Int] ()))
|
|
(doc sleep-seconds "Sleeps for a specified number of microseconds.")
|
|
(register sleep-micros (Fn [Int] ()))
|
|
(doc system "Performs a system command.")
|
|
(register system (Fn [&String] ()))
|
|
(doc get-arg "Gets the command line argument at a specified index.")
|
|
(register get-arg (Fn [Int] (Ref String)))
|
|
(doc get-args-len "Gets the number of command line arguments.")
|
|
(register get-args-len (Fn [] Int))
|
|
(register fork (Fn [] Int) "fork")
|
|
(register wait (Fn [(Ptr Int)] Int) "wait")
|
|
(register get-exit-status (Fn [Int] Int) "WEXITSTATUS")
|
|
(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")
|
|
(register abort (Fn [] ()) "abort")
|
|
|
|
(register errno Int "errno")
|
|
(register EACCES Int "EACCES")
|
|
(register EEXIST Int "EEXIST")
|
|
(register EINVAL Int "EINVAL")
|
|
(register EIO Int "EIO")
|
|
(register EISDIR Int "EISDIR")
|
|
(register ELOOP Int "ELOOP")
|
|
(register EMFILE Int "EMFILE")
|
|
(register ENAMETOOLONG Int "ENAMETOOLONG")
|
|
(register ENOENT Int "ENOENT")
|
|
(register ENOMEM Int "EINVAL")
|
|
(register ENOSPC Int "ENOSPC")
|
|
(register ENOSR Int "ENOSR")
|
|
(register ENOTDIR Int "ENOTDIR")
|
|
(register ENXIO Int "ENXIO")
|
|
(register EOVERFLOW Int "EOVERFLOW")
|
|
(register EROFS Int "EROFS")
|
|
(register EINTR Int "EINTR")
|
|
|
|
)
|