System

is a module for wrapping system calls and other OS utilities.

EACCES

external

Int

EEXIST

external

Int

EINTR

external

Int

EINVAL

external

Int

EIO

external

Int

EISDIR

external

Int

ELOOP

external

Int

EMFILE

external

Int

ENAMETOOLONG

external

Int

ENOENT

external

Int

ENOMEM

external

Int

ENOSPC

external

Int

ENOSR

external

Int

ENOTDIR

external

Int

ENXIO

external

Int

EOVERFLOW

external

Int

EROFS

external

Int

abort

external

(Fn [] ())

args

external

(StaticArray String)

Represents the command line arguments.

carp-init-globals

external

(Fn [Int, (Ptr (Ptr CChar))] ())

Initializes all global variables (in correct order, based on interdependencies). Called automatically by main if the project is compiled as an executable. Client code needs to call this function manually when using a library written in Carp.

errno

external

Int

error-text

defn

(Fn [] String)

                        (error-text)
                    

returns a description for the last function from the C standard library to set System.errno. Please note that System.errno may change if strerror() does not know it (and thus sets it to EINVAL), so consider copying it before, if you should need it. Calling error-text after a successful call will return 'SUCCESS' and leave System.errno unchanged.

exit

template

(Fn [Int] a)

exits the program with the supplied exit code (thin wrapper for the C standard library).

fork

external

(Fn [] Int)

get-exit-status

external

(Fn [Int] Int)

nanotime

external

(Fn [] Long)

Gets the current system time in nanoseconds as a long.

signal

external

(Fn [Int, (Fn [Int] ())] ())

signal-abort

external

Int

signal-fpe

external

Int

signal-ill

external

Int

signal-int

external

Int

signal-segv

external

Int

signal-term

external

Int

sleep-micros

external

(Fn [Int] ())

sleep-seconds

external

(Fn [Int] ())

Sleeps for a specified number of microseconds.

strerror

defn

(Fn [Int] String)

                        (strerror error-no)
                    

get error description for error code in standard C library (thin wrapper for the C standard library).

strerror-

external

(Fn [Int] (Ptr CChar))

system

external

(Fn [(Ref String a)] Int)

Performs a system command.

time

external

(Fn [] Int)

Gets the current system time as an integer.

wait

external

(Fn [(Ptr Int)] Int)