Types and Constants v0.1.0

Source
Types and constants exported by the Linux package.

Package: Linux

Standard File Descriptors

NameTypeValueDescription
StdInint320Standard input.
StdOutint321Standard output.
StdErrint322Standard error.

A process may close or redirect these conventional descriptors.

Syscall Numbers

Syscall numbers differ by architecture; the package selects the right set for the active target:

Namex86-64AArch64
SysRead063
SysWrite164
SysClose357
SysMmap9222
SysMunmap11215
SysBrk12214
SysNanosleep35101
SysGetPid39172
SysExit6093
SysClockGetTime228113

Memory Protection

NameTypeValueDescription
ProtectionNoneint320No access.
ProtectionReadint321Pages may be read.
ProtectionWriteint322Pages may be written.
ProtectionExecuteint324Pages may be executed.

Combine protection values with bitwise OR.

Mapping Flags

NameTypeValueDescription
MapSharedint321Create a shared mapping.
MapPrivateint322Create a private copy-on-write mapping.
MapFixedint3216Place the mapping at the exact address.
MapAnonymousint3232Create a mapping not backed by a file.

Clock IDs

NameTypeValueDescription
ClockRealtimeint320Settable wall-clock time.
ClockMonotonicint321Monotonic time since an unspecified point.

Timespec

struct Timespec {
    seconds: int64;
    nanoseconds: int64;
}
FieldTypeDescription
secondsint64Whole seconds.
nanosecondsint64Nanoseconds within the second, normally 0–999,999,999.

Nanosleep reads it as a relative duration; ClockGetTime writes a timestamp for the selected clock.

See also