System Information & Misc.
arch_prctl
Supported functionality in SCML:
// Get or set the FS register
arch_prctl(
code = ARCH_GET_FS | ARCH_SET_FS,
addr
);
Unsupported codes:
ARCH_GET_CPUIDandARCH_SET_CPUIDARCH_GET_GSandARCH_SET_GS
For more information, see the man page.
getrusage
Supported functionality in SCML:
// Return resource usage statistics for the calling process
getrusage(
who = RUSAGE_SELF,
usage
);
// Return resource usage statistics for the calling thread
getrusage(
who = RUSAGE_THREAD,
usage
);
Unsupported who flags:
RUSAGE_CHILDREN
For more information, see the man page.
getrandom
Supported functionality in SCML:
// Obtain random bytes
getrandom(
buf, buflen,
flags =
// Optional flags:
//
// High-entropy pool
GRND_RANDOM
);
Silently-ignored flags:
GRND_NONBLOCKbecause the underlying operation never blocks
For more information, see the man page.
reboot
Supported functionality in SCML:
reboot_magic2 = LINUX_REBOOT_MAGIC2 | LINUX_REBOOT_MAGIC2A | LINUX_REBOOT_MAGIC2B | LINUX_REBOOT_MAGIC2C;
// Stop the current system
reboot(
magic = LINUX_REBOOT_MAGIC1,
magic2 = <reboot_magic2>,
op = LINUX_REBOOT_CMD_HALT | LINUX_REBOOT_CMD_POWER_OFF,
arg
);
Unsupported op flags:
LINUX_REBOOT_CMD_CAD_OFFLINUX_REBOOT_CMD_CAD_ONLINUX_REBOOT_CMD_KEXECLINUX_REBOOT_CMD_RESTARTLINUX_REBOOT_CMD_RESTART2LINUX_REBOOT_CMD_SW_SUSPEND
For more information, see the man page.
POSIX Clocks
clock_gettime
Supported functionality in SCML:
predefined_clockid = CLOCK_REALTIME | CLOCK_MONOTONIC | CLOCK_MONOTONIC_RAW |
CLOCK_REALTIME_COARSE | CLOCK_MONOTONIC_COARSE | CLOCK_BOOTTIME |
CLOCK_PROCESS_CPUTIME_ID | CLOCK_THREAD_CPUTIME_ID;
// Get the time of a clock specified by a static ID
clock_gettime(clockid = <predefined_clockid>, tp);
// Get the time of a clock specified by a dynamic ID
clock_gettime(clockid = <INTEGER>, tp);
Unsupported predefined clock IDs:
CLOCK_REALTIME_ALARMCLOCK_BOOTTIME_ALARMCLOCK_TAI
For more information, see the man page.
clock_nanosleep
Supported functionality in SCML:
// Sleep with a specified clock
clock_nanosleep(
clockid = CLOCK_REALTIME | CLOCK_MONOTONIC | CLOCK_BOOTTIME | CLOCK_PROCESS_CPUTIME_ID,
flags =
// Optional flags:
//
// Sleep until an absolute time point
TIMER_ABSTIME,
t, remain
);
Unsupported clock IDs:
CLOCK_TAI
For more information, see the man page.