MkObjectC - L)anguage A)bstraction L)ayer definition … More...
Data Structures | |
struct | MkIdS |
data type for process/thread identification … More... | |
struct | MkLalS |
Interface between libmkkernel and the Operating-System … More... | |
Macros | |
#define | MkSysFree(pointer) |
#define | MkSysFreeNonNull(pointer) |
#define | MkSysStringSetNULL_R(_str) |
#define | MkSysStringSet_R(_str, _val) |
#define | MkSysStringIsNULL_R(_str) |
#define | MkSysStringIsEQUAL(_str, _other) |
#define | MkSysStringIsLenEQUAL(_str, _other, _len) |
Typedefs | |
typedef uintptr_t | MK_IDNT |
process or thread identifier … | |
typedef MK_PTR(* | MkSysCallocF) (size_t, size_t) |
calloc syscall … | |
typedef MK_PTR(* | MkSysMallocF) (size_t) |
malloc syscall … | |
typedef MK_STR(* | MkSysStrDupF) (MK_STRN) |
strdup syscall … | |
typedef MK_STR(* | MkSysStrNCpyF) (char *, const char *, size_t) |
strdup strncpy … | |
typedef MK_STR(* | MkSysStrNDupF) (MK_STRN, size_t) |
strndup syscall … | |
typedef MK_PTR(* | MkSysReallocF) (MK_PTR, size_t) |
realloc syscall … | |
typedef void(* | MkSysFreeF) (MK_PTR) |
free syscall … | |
typedef pid_t(* | MkSysForkF) (void) |
fork syscall … | |
typedef enum MkErrorE(* | MkSysWaitF) (MK_OBJN const fmtobj, MK_IDNT const id) |
wait for process to finish syscall with libmkkernel error plugin | |
typedef int(* | MkSysExitF) (MK_RT mkrt, int isThread, int num) |
typedef enum MkSysPipeHandlerE | MkSysPipeHandlerE |
Enumerations | |
enum | MkIdSE { MK_ID_UNUSED = 0 , MK_ID_PROCESS = 1 , MK_ID_THREAD = 2 } |
signal type of the MkIdS data val … More... | |
enum | MkSysPipeHandlerE { MK_PIPE_KEEP = 0 , MK_PIPE_IGNORE = 1 } |
Functions | |
MK_PTR | MkSysCalloc (MK_OBJN fmtobj, size_t const nmemb, size_t const size) |
calloc syscall with libmkkernel error plugin | |
MK_PTR | MkSysMalloc (MK_OBJN fmtobj, size_t const size) |
malloc syscall with libmkkernel error plugin | |
MK_STR | MkSysStrDup (MK_OBJN fmtobj, MK_STRN const str) |
strdup syscall with libmkkernel error plugin | |
MK_STR | MkSysStrNDup (MK_OBJN fmtobj, MK_STRN const str, MK_SIZE const len) |
strndup syscall with libmkkernel error plugin | |
enum MkErrorE | MkSysStrNCpy (MK_OBJN fmtobj, MK_STR const to, MK_STRN const from, MK_SIZE const len) |
strncpy syscall with libmkkernel error plugin | |
MK_PTR | MkSysRealloc (MK_OBJN fmtobj, MK_PTR const buf, size_t const size) |
realloc syscall with libmkkernel error plugin | |
MK_PTR | MkSysReCalloc (MK_OBJN fmtobj, MK_PTR const buf, MK_NUM const oldnum, MK_NUM const addnum, size_t const size) |
realloc syscall with libmkkernel error plugin | |
MK_PTR | MkSysMemDup (MK_OBJN fmtobj, MK_PTRN const blck, size_t const size) |
memdup syscall with libmkkernel error plugin | |
MK_STRN_A | MkSysStringArrayDup (MK_OBJN fmtobj, MK_STRN_A const strA) |
strdup syscall with libmkkernel error plugin | |
void | MkSysFree (MK_PTR pointer) |
free syscall … | |
void | MkSysFreeNonNull (MK_PTR pointer) |
void | MkSysFreeP (MK_PTR data) |
free syscall with libmkkernel error plugin | |
void | MkSysPrintStackTrace_RT (MK_RT mkrt, MK_OBJN fmtobj, MK_I32 const debug, MK_STRN const callfunc, MK_I32 const lvl, MK_I32 skip, MK_I32 const num) |
backtrace syscall with libmkkernel error plugin | |
void | MkSysPrintProcessMemoryMap_RT (MK_RT mkrt, MK_OBJN fmtobj, MK_I32 const debug, MK_STRN const callfunc, MK_I32 const lvl) |
write the memory-map to MkLogFileC used at MkDisasterSignal … | |
MK_STRN | MkSysGetTrace_RT (MK_RT mkrt, MK_OBJN fmtobj, MK_I32 const debug, MK_STRN const callfunc, MK_I32 const lvl, MK_I32 skip, MK_I32 const num) |
same as MkSysPrintStackTrace but return a string… | |
static enum MkErrorE | MkSysWaitForProcess (MK_OBJN fmtobj, MK_IDNT const id) |
wait for process to finish syscall with libmkkernel error plugin | |
static enum MkErrorE | MkSysWaitForThread (MK_OBJN fmtobj, MK_IDNT const id) |
wait for thread to finish syscall with libmkkernel error plugin | |
static enum MkErrorE | MkSysUSleep (MK_OBJN fmtobj, useconds_t const usec) |
usleep syscall with libmkkernel error plugin | |
static enum MkErrorE | MkSysSleep (MK_OBJN fmtobj, MK_I32 const sec) |
sleep syscall with libmkkernel error plugin | |
static int | MkSysExit_RT (MK_RT mkrt, int isThread, int num) |
exit syscall with libmkkernel error plugin | |
MK_STR | MkSysBasename_RT (MK_RT mkrt, MK_STRN const pathName, bool const includeExtension) |
basename syscall with libmkkernel error plugin | |
MK_STR | MkSysDirname_RT (MK_RT mkrt, MK_STRN const pathName) |
dirname syscall with libmkkernel error plugin | |
MK_STR | MkSysPrintF_RT (MK_RT mkrt, MK_STRN const format,...) |
sprintf syscall with libmkkernel error plugin | |
enum MkErrorE | MkSysGetTimeOfDay (MK_OBJN fmtobj, struct mk_timeval *tv_out, struct mk_timezone *tz_out) |
gettimeofday syscall with libmkkernel error plugin | |
bool | MkSysStringSetNULL_R (MK_STRN const str) |
set string to EMPTY … | |
bool | MkSysStringSet_R (MK_STRN const str, MK_STRN const other) |
set string to value … | |
bool | MkSysStringIsNULL_R (MK_STRN const str) |
test if string EMPTY … | |
static bool | MkSysStringIsNULL (MK_STRN str) |
test if string is NULL or EMPTY … | |
static bool | MkSysStringIsNotNULL (MK_STRN str) |
test if string is NOT NULL or EMPTY … | |
bool | MkSysStringIsEQUAL (MK_STRN const str, MK_STRN const other) |
test if string(s) are equal … | |
bool | MkSysStringIsLenEQUAL (MK_STRN const str, MK_STRN const other, MK_SIZE const len) |
test if string(s) are equal … | |
static MK_STRN | MkSysStringGet (MK_STRN str) |
get string NULL or VALUE … | |
static MK_STRN | MkSysStringGetNoNULL (MK_STRN str) |
get string "" or VALUE … | |
MK_STRN | MkSysHashSTR (MK_STRN key, MK_NUM length) |
compute the HASH from a string … | |
MK_I32 | MkSysHashI32 (MK_STRN key, MK_NUM length) |
same as MkSysHashSTR but return MK_I32 … | |
enum MkErrorE | MkSysKill (MK_OBJN fmtobj, MK_I32 pid, MK_I32 signal) |
kill syscall with libmkkernel error plugin | |
enum MkErrorE | MkSysGetPid (MK_OBJN fmtobj, MK_I32 *pid_out) |
getpid syscall with libmkkernel error plugin | |
void | MkSysPipeHandler (MkSysPipeHandlerE keepPipe) |
internal support for pipe ignore | |
Variables | |
struct MkLalS | MkLal |
Language Abstraction Layer in duty. | |
MkObjectC - MkObjectC_Sys_C_API - overload | |
#define | MkSysCalloc_2(nmemb, size) |
#define | MkSysKill_2(pid, signal) |
#define | MkSysKill_E(...) |
#define | MkSysKill_C(...) |
#define | MkSysMalloc_1(size) |
#define | MkSysMemDup_2(blck, size) |
#define | MkSysReCalloc_4(buf, oldnum, addnum, size) |
#define | MkSysRealloc_2(buf, size) |
#define | MkSysSleep_1(sec) |
#define | MkSysSleep_E(...) |
#define | MkSysSleep_C(...) |
#define | MkSysStrDup_1(str) |
#define | MkSysStrNCpy_3(to, from, len) |
#define | MkSysStrNCpy_E(...) |
#define | MkSysStrNCpy_C(...) |
#define | MkSysStrNDup_2(str, len) |
#define | MkSysStringArrayDup_1(strA) |
#define | MkSysUSleep_1(usec) |
#define | MkSysUSleep_E(...) |
#define | MkSysUSleep_C(...) |
#define | MkSysWaitForProcess_1(id) |
#define | MkSysWaitForProcess_E(...) |
#define | MkSysWaitForProcess_C(...) |
#define | MkSysWaitForThread_1(id) |
#define | MkSysWaitForThread_E(...) |
#define | MkSysWaitForThread_C(...) |
#define | MkSysGetPid_1(pid_out) |
#define | MkSysGetPid_E(...) |
#define | MkSysGetPid_C(...) |
#define | MkSysGetPid_e(...) |
#define | MkSysGetTimeOfDay_2(tv_out, tz_out) |
#define | MkSysGetTimeOfDay_E(...) |
#define | MkSysGetTimeOfDay_C(...) |
#define | MkSysBasename_NULL(...) |
#define | MkSysBasename(...) |
#define | MkSysDirname_NULL(...) |
#define | MkSysDirname(...) |
#define | MkSysExit_NULL(...) |
#define | MkSysExit(...) |
#define | MkSysGetTrace_NULL(...) |
#define | MkSysGetTrace(...) |
#define | MkSysGetTrace_5(fmtobj, debug, callfunc, lvl, skip) |
#define | MkSysGetTrace_4(fmtobj, debug, callfunc, lvl) |
#define | MkSysGetTrace_3(fmtobj, debug, callfunc) |
#define | MkSysGetTrace_2(fmtobj, debug) |
#define | MkSysGetTrace_1(fmtobj) |
#define | MkSysGetTrace_0() |
#define | MkSysHashI32_1(key) |
#define | MkSysHashSTR_1(key) |
#define | MkSysPrintF_NULL(...) |
#define | MkSysPrintF(...) |
#define | MkSysPrintProcessMemoryMap_NULL(...) |
#define | MkSysPrintProcessMemoryMap(...) |
#define | MkSysPrintProcessMemoryMap_3(fmtobj, debug, callfunc) |
#define | MkSysPrintProcessMemoryMap_2(fmtobj, debug) |
#define | MkSysPrintProcessMemoryMap_1(fmtobj) |
#define | MkSysPrintProcessMemoryMap_0() |
#define | MkSysPrintStackTrace_NULL(...) |
#define | MkSysPrintStackTrace(...) |
#define | MkSysPrintStackTrace_5(fmtobj, debug, callfunc, lvl, skip) |
#define | MkSysPrintStackTrace_4(fmtobj, debug, callfunc, lvl) |
#define | MkSysPrintStackTrace_3(fmtobj, debug, callfunc) |
#define | MkSysPrintStackTrace_2(fmtobj, debug) |
#define | MkSysPrintStackTrace_1(fmtobj) |
#define | MkSysPrintStackTrace_0() |
MkObjectC - L)anguage A)bstraction L)ayer definition …
The LAL is required to give the target of embedding a change to modify the access to system functions. RUBY for example has it's own Thread-Creation function.
All wrappers to access the underlying OS,Languages and system functions are located in this section. Every external Function has additional code to map the OS/System specific error codes/messages into a libmkkernel specific error codes/messages
#define MkSysBasename | ( | ... | ) |
Definition at line 1752 of file kernel_overload_mk.h.
#define MkSysBasename_NULL | ( | ... | ) |
Definition at line 1751 of file kernel_overload_mk.h.
#define MkSysCalloc_2 | ( | nmemb, | |
size ) |
Definition at line 1714 of file kernel_overload_mk.h.
#define MkSysDirname | ( | ... | ) |
Definition at line 1754 of file kernel_overload_mk.h.
#define MkSysDirname_NULL | ( | ... | ) |
Definition at line 1753 of file kernel_overload_mk.h.
#define MkSysExit | ( | ... | ) |
Definition at line 1756 of file kernel_overload_mk.h.
#define MkSysExit_NULL | ( | ... | ) |
Definition at line 1755 of file kernel_overload_mk.h.
#define MkSysFree | ( | pointer | ) |
Definition at line 2805 of file LibMkKernel_mk.h.
#define MkSysFreeNonNull | ( | pointer | ) |
Definition at line 2814 of file LibMkKernel_mk.h.
#define MkSysGetPid_1 | ( | pid_out | ) |
Definition at line 1742 of file kernel_overload_mk.h.
#define MkSysGetPid_C | ( | ... | ) |
Definition at line 1744 of file kernel_overload_mk.h.
#define MkSysGetPid_E | ( | ... | ) |
Definition at line 1743 of file kernel_overload_mk.h.
#define MkSysGetPid_e | ( | ... | ) |
Definition at line 1745 of file kernel_overload_mk.h.
#define MkSysGetTimeOfDay_2 | ( | tv_out, | |
tz_out ) |
Definition at line 1746 of file kernel_overload_mk.h.
#define MkSysGetTimeOfDay_C | ( | ... | ) |
Definition at line 1748 of file kernel_overload_mk.h.
#define MkSysGetTimeOfDay_E | ( | ... | ) |
Definition at line 1747 of file kernel_overload_mk.h.
#define MkSysGetTrace | ( | ... | ) |
Definition at line 1758 of file kernel_overload_mk.h.
#define MkSysGetTrace_0 | ( | ) |
Definition at line 1764 of file kernel_overload_mk.h.
#define MkSysGetTrace_1 | ( | fmtobj | ) |
Definition at line 1763 of file kernel_overload_mk.h.
#define MkSysGetTrace_2 | ( | fmtobj, | |
debug ) |
Definition at line 1762 of file kernel_overload_mk.h.
#define MkSysGetTrace_3 | ( | fmtobj, | |
debug, | |||
callfunc ) |
Definition at line 1761 of file kernel_overload_mk.h.
#define MkSysGetTrace_4 | ( | fmtobj, | |
debug, | |||
callfunc, | |||
lvl ) |
Definition at line 1760 of file kernel_overload_mk.h.
#define MkSysGetTrace_5 | ( | fmtobj, | |
debug, | |||
callfunc, | |||
lvl, | |||
skip ) |
Definition at line 1759 of file kernel_overload_mk.h.
#define MkSysGetTrace_NULL | ( | ... | ) |
Definition at line 1757 of file kernel_overload_mk.h.
#define MkSysHashI32_1 | ( | key | ) |
Definition at line 1765 of file kernel_overload_mk.h.
#define MkSysHashSTR_1 | ( | key | ) |
Definition at line 1766 of file kernel_overload_mk.h.
#define MkSysKill_2 | ( | pid, | |
signal ) |
Definition at line 1715 of file kernel_overload_mk.h.
#define MkSysKill_C | ( | ... | ) |
Definition at line 1717 of file kernel_overload_mk.h.
#define MkSysKill_E | ( | ... | ) |
Definition at line 1716 of file kernel_overload_mk.h.
#define MkSysMalloc_1 | ( | size | ) |
Definition at line 1718 of file kernel_overload_mk.h.
#define MkSysMemDup_2 | ( | blck, | |
size ) |
Definition at line 1719 of file kernel_overload_mk.h.
#define MkSysPrintF | ( | ... | ) |
Definition at line 1768 of file kernel_overload_mk.h.
#define MkSysPrintF_NULL | ( | ... | ) |
Definition at line 1767 of file kernel_overload_mk.h.
#define MkSysPrintProcessMemoryMap | ( | ... | ) |
Definition at line 1770 of file kernel_overload_mk.h.
#define MkSysPrintProcessMemoryMap_0 | ( | ) |
Definition at line 1774 of file kernel_overload_mk.h.
#define MkSysPrintProcessMemoryMap_1 | ( | fmtobj | ) |
Definition at line 1773 of file kernel_overload_mk.h.
#define MkSysPrintProcessMemoryMap_2 | ( | fmtobj, | |
debug ) |
Definition at line 1772 of file kernel_overload_mk.h.
#define MkSysPrintProcessMemoryMap_3 | ( | fmtobj, | |
debug, | |||
callfunc ) |
Definition at line 1771 of file kernel_overload_mk.h.
#define MkSysPrintProcessMemoryMap_NULL | ( | ... | ) |
Definition at line 1769 of file kernel_overload_mk.h.
#define MkSysPrintStackTrace | ( | ... | ) |
Definition at line 1776 of file kernel_overload_mk.h.
#define MkSysPrintStackTrace_0 | ( | ) |
Definition at line 1782 of file kernel_overload_mk.h.
#define MkSysPrintStackTrace_1 | ( | fmtobj | ) |
Definition at line 1781 of file kernel_overload_mk.h.
#define MkSysPrintStackTrace_2 | ( | fmtobj, | |
debug ) |
Definition at line 1780 of file kernel_overload_mk.h.
#define MkSysPrintStackTrace_3 | ( | fmtobj, | |
debug, | |||
callfunc ) |
Definition at line 1779 of file kernel_overload_mk.h.
#define MkSysPrintStackTrace_4 | ( | fmtobj, | |
debug, | |||
callfunc, | |||
lvl ) |
Definition at line 1778 of file kernel_overload_mk.h.
#define MkSysPrintStackTrace_5 | ( | fmtobj, | |
debug, | |||
callfunc, | |||
lvl, | |||
skip ) |
Definition at line 1777 of file kernel_overload_mk.h.
#define MkSysPrintStackTrace_NULL | ( | ... | ) |
Definition at line 1775 of file kernel_overload_mk.h.
#define MkSysRealloc_2 | ( | buf, | |
size ) |
Definition at line 1721 of file kernel_overload_mk.h.
#define MkSysReCalloc_4 | ( | buf, | |
oldnum, | |||
addnum, | |||
size ) |
Definition at line 1720 of file kernel_overload_mk.h.
#define MkSysSleep_1 | ( | sec | ) |
Definition at line 1722 of file kernel_overload_mk.h.
#define MkSysSleep_C | ( | ... | ) |
Definition at line 1724 of file kernel_overload_mk.h.
#define MkSysSleep_E | ( | ... | ) |
Definition at line 1723 of file kernel_overload_mk.h.
#define MkSysStrDup_1 | ( | str | ) |
Definition at line 1725 of file kernel_overload_mk.h.
#define MkSysStringArrayDup_1 | ( | strA | ) |
Definition at line 1730 of file kernel_overload_mk.h.
#define MkSysStringIsEQUAL | ( | _str, | |
_other ) |
Definition at line 3046 of file LibMkKernel_mk.h.
#define MkSysStringIsLenEQUAL | ( | _str, | |
_other, | |||
_len ) |
Definition at line 3050 of file LibMkKernel_mk.h.
#define MkSysStringIsNULL_R | ( | _str | ) |
Definition at line 3032 of file LibMkKernel_mk.h.
#define MkSysStringSet_R | ( | _str, | |
_val ) |
Definition at line 3028 of file LibMkKernel_mk.h.
#define MkSysStringSetNULL_R | ( | _str | ) |
Definition at line 3024 of file LibMkKernel_mk.h.
#define MkSysStrNCpy_3 | ( | to, | |
from, | |||
len ) |
Definition at line 1726 of file kernel_overload_mk.h.
#define MkSysStrNCpy_C | ( | ... | ) |
Definition at line 1728 of file kernel_overload_mk.h.
#define MkSysStrNCpy_E | ( | ... | ) |
Definition at line 1727 of file kernel_overload_mk.h.
#define MkSysStrNDup_2 | ( | str, | |
len ) |
Definition at line 1729 of file kernel_overload_mk.h.
#define MkSysUSleep_1 | ( | usec | ) |
Definition at line 1731 of file kernel_overload_mk.h.
#define MkSysUSleep_C | ( | ... | ) |
Definition at line 1733 of file kernel_overload_mk.h.
#define MkSysUSleep_E | ( | ... | ) |
Definition at line 1732 of file kernel_overload_mk.h.
#define MkSysWaitForProcess_1 | ( | id | ) |
Definition at line 1734 of file kernel_overload_mk.h.
#define MkSysWaitForProcess_C | ( | ... | ) |
Definition at line 1736 of file kernel_overload_mk.h.
#define MkSysWaitForProcess_E | ( | ... | ) |
Definition at line 1735 of file kernel_overload_mk.h.
#define MkSysWaitForThread_1 | ( | id | ) |
Definition at line 1737 of file kernel_overload_mk.h.
#define MkSysWaitForThread_C | ( | ... | ) |
Definition at line 1739 of file kernel_overload_mk.h.
#define MkSysWaitForThread_E | ( | ... | ) |
Definition at line 1738 of file kernel_overload_mk.h.
typedef uintptr_t MK_IDNT |
process or thread identifier …
Definition at line 2243 of file LibMkKernel_mk.h.
typedef MK_PTR(* MkSysCallocF) (size_t, size_t) |
typedef int(* MkSysExitF) (MK_RT mkrt, int isThread, int num) |
Example:
MK_NO_RETURN
besause the MkSysExitF can be an overload with MkLalS::MkSysExitCB Definition at line 2566 of file LibMkKernel_mk.h.
typedef pid_t(* MkSysForkF) (void) |
fork syscall …
additional info: man fork
Definition at line 2546 of file LibMkKernel_mk.h.
typedef void(* MkSysFreeF) (MK_PTR) |
typedef MK_PTR(* MkSysMallocF) (size_t) |
typedef enum MkSysPipeHandlerE MkSysPipeHandlerE |
typedef MK_STR(* MkSysStrNCpyF) (char *, const char *, size_t) |
wait for process to finish syscall with libmkkernel error plugin
[in] | fmtobj | managed object used to format the log-message (default=MK_NULL → use default-format) |
[in] | id | process handle |
Definition at line 2546 of file LibMkKernel_mk.h.
enum MkIdSE |
signal type of the MkIdS data val …
Enumerator | ||
---|---|---|
MK_ID_UNUSED | 0 | empty struct |
MK_ID_PROCESS | 1 | val has a process handle |
MK_ID_THREAD | 2 | val has a thread handle |
Definition at line 2248 of file LibMkKernel_mk.h.
enum MkSysPipeHandlerE |
Enumerator | ||
---|---|---|
MK_PIPE_KEEP | 0 | |
MK_PIPE_IGNORE | 1 |
Definition at line 3141 of file LibMkKernel_mk.h.
basename syscall with libmkkernel error plugin
additional info: man basename
[in] | mkrt | the MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only) |
[in] | pathName | The path to extract the basename from. The value of pathName will not be changed and for MK_NULL return unknown |
[in] | includeExtension | add extension like '.exe' to the filename (true or false) |
calloc syscall with libmkkernel error plugin
additional info: man calloc
[in] | fmtobj | managed object used to format the log-message (default=MK_NULL → use default-format) |
[in] | nmemb | the number of members in the memory block |
[in] | size | the size of a single memory block |
dirname syscall with libmkkernel error plugin
additional info: man dirname
[in] | mkrt | the MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only) |
[in] | pathName | path to extract the dirname from (value of in will not be changed) |
|
inlinestatic |
exit syscall with libmkkernel error plugin
The MkLalS::MkSysExitCB decide how to exit from a process or a thread. The default-exit is the SysExit
static function with pthread_exit
on thread or exit
on process. The MkLalS::MkSysExitCB can be replaced or set to MK_NULL
. With MK_NULL
only the num is returned and the process/thread have to deal with it.
[in] | mkrt | the MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only) |
[in] | isThread | exit a thread? |
[in] | num | exit code |
MK_NO_RETURN
besause the MkSysExit can be an overload with MkLalS::MkSysExitCB Definition at line 2941 of file LibMkKernel_mk.h.
void MkSysFree | ( | MK_PTR | pointer | ) |
free syscall …
additional info: man free
[in,out] | pointer | of the memory-block to delete, the pointer will be set to MK_NULL |
void MkSysFreeNonNull | ( | MK_PTR | pointer | ) |
void MkSysFreeP | ( | MK_PTR | data | ) |
free syscall with libmkkernel error plugin
additional info: man free
Free memory of data if data is not MK_NULL
.
[in] | data | block to be freed |
getpid syscall with libmkkernel error plugin
additional info: man 3 getpid
[in] | fmtobj | managed object used to format the log-message (default=MK_NULL → use default-format) |
[out] | pid_out | the own pid |
enum MkErrorE MkSysGetTimeOfDay | ( | MK_OBJN | fmtobj, |
struct mk_timeval * | tv_out, | ||
struct mk_timezone * | tz_out ) |
gettimeofday syscall with libmkkernel error plugin
additional info: man gettimeofday
[in] | fmtobj | managed object used to format the log-message (default=MK_NULL → use default-format) |
[out] | tv_out | the timeval object |
[out] | tz_out | the timezone object |
MK_STRN MkSysGetTrace_RT | ( | MK_RT | mkrt, |
MK_OBJN | fmtobj, | ||
MK_I32 const | debug, | ||
MK_STRN const | callfunc, | ||
MK_I32 const | lvl, | ||
MK_I32 | skip, | ||
MK_I32 const | num ) |
same as MkSysPrintStackTrace but return a string…
same as MkSysHashSTR but return MK_I32 …
key | key from which to compute hash value. |
length | length from key, if "<0" the size will be computed |
compute the HASH from a string …
The hash-value is computed with the fast TCL hash-function
I tried a zillion different hash functions and asked many other people for advice. Many people had their own favorite functions, all different, but no-one had much idea why they were good ones. I chose the one below (multiply by 9 and add new character) because of the following reasons:
Note that this function is very weak against malicious strings; it's very easy to generate multiple keys that have the same hashcode. On the other hand, that hardly ever actually occurs and this function is very cheap, even by comparison with industry-standard hashes like FNV. If real strength of hash is required though, use a custom hash based on Bob Jenkins's lookup3(), but be aware that it's significantly slower. Tcl does not use that level of strength because it typically does not need it (and some of the aspects of that strength are genuinely unnecessary given the rest of Tcl's hash machinery, and the fact that we do not either transfer hashes to another machine, use them as a true substitute for equality, or attempt to minimize work in rebuilding the hash table).
HashStringKey
in tclHash.c
HashString
in tclLiteral.c
See [tcl-Feature Request #2958832]
sprint("%08X")
) in hex key | key from which to compute hash value. |
length | length from key, if "<0" the size will be computed |
kill syscall with libmkkernel error plugin
additional info: man 3 kill
[in] | fmtobj | managed object used to format the log-message (default=MK_NULL → use default-format) |
[in] | pid | the process to kill |
[in] | signal | the signal to send |
malloc syscall with libmkkernel error plugin
additional info: man malloc
[in] | fmtobj | managed object used to format the log-message (default=MK_NULL → use default-format) |
[in] | size | the size of the new memory block |
memdup syscall with libmkkernel error plugin
additional info: like strdup but for ordinary memory
[in] | fmtobj | managed object used to format the log-message (default=MK_NULL → use default-format) |
[in] | blck | the old memory block to duplicate |
[in] | size | the size of the memory in buf |
void MkSysPipeHandler | ( | MkSysPipeHandlerE | keepPipe | ) |
internal support for pipe ignore
sprintf syscall with libmkkernel error plugin
additional info: man sprintf
[in] | mkrt | the MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only) |
[in] | format | the format string |
void MkSysPrintProcessMemoryMap_RT | ( | MK_RT | mkrt, |
MK_OBJN | fmtobj, | ||
MK_I32 const | debug, | ||
MK_STRN const | callfunc, | ||
MK_I32 const | lvl ) |
write the memory-map to MkLogFileC used at MkDisasterSignal …
[in] | mkrt | the MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only) |
[in] | fmtobj | managed object used to format the log-message (default=MK_NULL → use default-format) |
[in] | debug | the debug level from MkRuntimeS::debug, use 0 <= debug <= 9 (default=0 ) |
[in] | callfunc | a user-defined postfix to identify the calling function or the environment (default=name-of-function ) |
[in] | lvl | a user-defined prefix starting with "" for lvl=0 and increase with " " for lvl+1 (default=0 ) |
void MkSysPrintStackTrace_RT | ( | MK_RT | mkrt, |
MK_OBJN | fmtobj, | ||
MK_I32 const | debug, | ||
MK_STRN const | callfunc, | ||
MK_I32 const | lvl, | ||
MK_I32 | skip, | ||
MK_I32 const | num ) |
backtrace syscall with libmkkernel error plugin
Get a full stack backtrace. SKIP is the number of frames to skip; passing 0 will start the trace with the function calling backtrace_full. DATA is passed to the callback routine. If any call to CALLBACK returns a non-zero value, the stack backtrace stops, and backtrace returns that value; this may be used to limit the number of stack frames desired. If all calls to CALLBACK return 0, backtrace returns 0. The backtrace_full function will make at least one call to either CALLBACK or ERROR_CALLBACK. This function requires debug info for the executable.
[in] | mkrt | the MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only) |
[in] | fmtobj | managed object used to format the log-message (default=MK_NULL → use default-format) |
[in] | skip | the number of of frames to skip |
[in] | num | the number of traces to print |
[in] | debug | the debug level from MkRuntimeS::debug, use 0 <= debug <= 9 (default=0 ) |
[in] | callfunc | a user-defined postfix to identify the calling function or the environment (default=name-of-function ) |
[in] | lvl | a user-defined prefix starting with "" for lvl=0 and increase with " " for lvl+1 (default=0 ) |
realloc syscall with libmkkernel error plugin
additional info: man realloc
[in] | fmtobj | managed object used to format the log-message (default=MK_NULL → use default-format) |
[in] | buf | the old memory block to extend |
[in] | size | the size of the new memory block |
MK_PTR MkSysReCalloc | ( | MK_OBJN | fmtobj, |
MK_PTR const | buf, | ||
MK_NUM const | oldnum, | ||
MK_NUM const | addnum, | ||
size_t const | size ) |
realloc syscall with libmkkernel error plugin
additional info: man realloc
but set the NEW bytes to '\0'
[in] | fmtobj | managed object used to format the log-message (default=MK_NULL → use default-format) |
[in] | buf | the old memory block to extend |
[in] | oldnum | the old number of the memory block items |
[in] | addnum | add addnum to oldnum of the memory block items, final number of items is newnum = oldnum + addnum |
[in] | size | the size of the memory block item |
sleep syscall with libmkkernel error plugin
[in] | fmtobj | managed object used to format the log-message (default=MK_NULL → use default-format) |
[in] | sec | the seconds to sleep |
Definition at line 2920 of file LibMkKernel_mk.h.
strdup syscall with libmkkernel error plugin
additional info: man strdup
[in] | fmtobj | managed object used to format the log-message (default=MK_NULL → use default-format) |
[in] | str | the string to duplicate |
MK_NULL
on error strdup syscall with libmkkernel error plugin
additional info: like strdup but for an array of string
[in] | fmtobj | managed object used to format the log-message (default=MK_NULL → use default-format) |
[in] | strA | the original array of strings |
get string NULL or VALUE …
Definition at line 3053 of file LibMkKernel_mk.h.
get string "" or VALUE …
Definition at line 3058 of file LibMkKernel_mk.h.
test if string(s) are equal …
|
inlinestatic |
test if string is NOT NULL or EMPTY …
Definition at line 3040 of file LibMkKernel_mk.h.
|
inlinestatic |
test if string is NULL or EMPTY …
Definition at line 3035 of file LibMkKernel_mk.h.
bool MkSysStringIsNULL_R | ( | MK_STRN const | str | ) |
test if string EMPTY …
bool MkSysStringSetNULL_R | ( | MK_STRN const | str | ) |
set string to EMPTY …
enum MkErrorE MkSysStrNCpy | ( | MK_OBJN | fmtobj, |
MK_STR const | to, | ||
MK_STRN const | from, | ||
MK_SIZE const | len ) |
strncpy syscall with libmkkernel error plugin
additional info: man strncpy
[in] | fmtobj | managed object used to format the log-message (default=MK_NULL → use default-format) |
[in] | to | the string to copy "to" |
[in] | from | the string to copy "from" |
[in] | len | the length of the string |
strndup syscall with libmkkernel error plugin
additional info: man strdup
[in] | fmtobj | managed object used to format the log-message (default=MK_NULL → use default-format) |
[in] | str | the string to duplicate |
[in] | len | the length of the string |
usleep syscall with libmkkernel error plugin
[in] | fmtobj | managed object used to format the log-message (default=MK_NULL → use default-format) |
[in] | usec | the micro (10^-6) seconds to sleep |
Definition at line 2909 of file LibMkKernel_mk.h.
wait for process to finish syscall with libmkkernel error plugin
[in] | fmtobj | managed object used to format the log-message (default=MK_NULL → use default-format) |
[in] | id | process handle |
Definition at line 2885 of file LibMkKernel_mk.h.
wait for thread to finish syscall with libmkkernel error plugin
[in] | fmtobj | managed object used to format the log-message (default=MK_NULL → use default-format) |
[in] | id | thread handle |
Definition at line 2897 of file LibMkKernel_mk.h.
|
extern |
Language Abstraction Layer in duty.