posix_nifs.c

Include dependency graph for posix_nifs.c:

digraph {
    graph [bgcolor="#00000000"]
    node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2]
    edge [color="#1414CE"]
    "8" [label="stdbool.h" tooltip="stdbool.h"]
    "16" [label="stdatomic.h" tooltip="stdatomic.h"]
    "5" [label="atom.h" tooltip="atom.h"]
    "1" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/posix_nifs.c" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/posix_nifs.c" fillcolor="#BFBFBF"]
    "33" [label="posix_nifs.h" tooltip="posix_nifs.h"]
    "11" [label="assert.h" tooltip="assert.h"]
    "17" [label="synclist.h" tooltip="synclist.h"]
    "2" [label="defaultatoms.h" tooltip="defaultatoms.h"]
    "4" [label="stdint.h" tooltip="stdint.h"]
    "6" [label="stdlib.h" tooltip="stdlib.h"]
    "32" [label="exportedfunction.h" tooltip="exportedfunction.h"]
    "28" [label="context.h" tooltip="context.h"]
    "22" [label="utils.h" tooltip="utils.h"]
    "7" [label="atom_table.h" tooltip="atom_table.h"]
    "10" [label="term_typedef.h" tooltip="term_typedef.h"]
    "23" [label="stddef.h" tooltip="stddef.h"]
    "12" [label="limits.h" tooltip="limits.h"]
    "24" [label="refc_binary.h" tooltip="refc_binary.h"]
    "20" [label="string.h" tooltip="string.h"]
    "29" [label="mailbox.h" tooltip="mailbox.h"]
    "19" [label="term.h" tooltip="term.h"]
    "9" [label="erl_nif.h" tooltip="erl_nif.h"]
    "30" [label="interop.h" tooltip="interop.h"]
    "25" [label="resources.h" tooltip="resources.h"]
    "15" [label="smp.h" tooltip="smp.h"]
    "27" [label="erl_nif_priv.h" tooltip="erl_nif_priv.h"]
    "31" [label="nifs.h" tooltip="nifs.h"]
    "3" [label="globalcontext.h" tooltip="globalcontext.h"]
    "21" [label="memory.h" tooltip="memory.h"]
    "18" [label="stdio.h" tooltip="stdio.h"]
    "26" [label="timer_list.h" tooltip="timer_list.h"]
    "14" [label="list.h" tooltip="list.h"]
    "13" [label="inttypes.h" tooltip="inttypes.h"]
    "5" -> "4" [dir=forward tooltip="include"]
    "5" -> "6" [dir=forward tooltip="include"]
    "1" -> "2" [dir=forward tooltip="include"]
    "1" -> "27" [dir=forward tooltip="include"]
    "1" -> "3" [dir=forward tooltip="include"]
    "1" -> "30" [dir=forward tooltip="include"]
    "1" -> "31" [dir=forward tooltip="include"]
    "1" -> "33" [dir=forward tooltip="include"]
    "33" -> "32" [dir=forward tooltip="include"]
    "33" -> "3" [dir=forward tooltip="include"]
    "33" -> "19" [dir=forward tooltip="include"]
    "17" -> "14" [dir=forward tooltip="include"]
    "17" -> "18" [dir=forward tooltip="include"]
    "17" -> "15" [dir=forward tooltip="include"]
    "2" -> "3" [dir=forward tooltip="include"]
    "32" -> "19" [dir=forward tooltip="include"]
    "28" -> "3" [dir=forward tooltip="include"]
    "28" -> "14" [dir=forward tooltip="include"]
    "28" -> "29" [dir=forward tooltip="include"]
    "28" -> "15" [dir=forward tooltip="include"]
    "28" -> "19" [dir=forward tooltip="include"]
    "28" -> "26" [dir=forward tooltip="include"]
    "22" -> "23" [dir=forward tooltip="include"]
    "7" -> "8" [dir=forward tooltip="include"]
    "7" -> "5" [dir=forward tooltip="include"]
    "10" -> "11" [dir=forward tooltip="include"]
    "10" -> "12" [dir=forward tooltip="include"]
    "10" -> "13" [dir=forward tooltip="include"]
    "10" -> "4" [dir=forward tooltip="include"]
    "24" -> "8" [dir=forward tooltip="include"]
    "24" -> "6" [dir=forward tooltip="include"]
    "24" -> "14" [dir=forward tooltip="include"]
    "24" -> "25" [dir=forward tooltip="include"]
    "24" -> "15" [dir=forward tooltip="include"]
    "29" -> "8" [dir=forward tooltip="include"]
    "29" -> "14" [dir=forward tooltip="include"]
    "29" -> "15" [dir=forward tooltip="include"]
    "29" -> "10" [dir=forward tooltip="include"]
    "29" -> "22" [dir=forward tooltip="include"]
    "19" -> "8" [dir=forward tooltip="include"]
    "19" -> "4" [dir=forward tooltip="include"]
    "19" -> "18" [dir=forward tooltip="include"]
    "19" -> "6" [dir=forward tooltip="include"]
    "19" -> "20" [dir=forward tooltip="include"]
    "19" -> "21" [dir=forward tooltip="include"]
    "19" -> "24" [dir=forward tooltip="include"]
    "19" -> "22" [dir=forward tooltip="include"]
    "19" -> "10" [dir=forward tooltip="include"]
    "9" -> "10" [dir=forward tooltip="include"]
    "30" -> "28" [dir=forward tooltip="include"]
    "30" -> "19" [dir=forward tooltip="include"]
    "25" -> "6" [dir=forward tooltip="include"]
    "25" -> "9" [dir=forward tooltip="include"]
    "25" -> "14" [dir=forward tooltip="include"]
    "25" -> "21" [dir=forward tooltip="include"]
    "15" -> "8" [dir=forward tooltip="include"]
    "15" -> "16" [dir=forward tooltip="include"]
    "27" -> "28" [dir=forward tooltip="include"]
    "27" -> "21" [dir=forward tooltip="include"]
    "31" -> "5" [dir=forward tooltip="include"]
    "31" -> "28" [dir=forward tooltip="include"]
    "31" -> "32" [dir=forward tooltip="include"]
    "3" -> "4" [dir=forward tooltip="include"]
    "3" -> "5" [dir=forward tooltip="include"]
    "3" -> "7" [dir=forward tooltip="include"]
    "3" -> "9" [dir=forward tooltip="include"]
    "3" -> "14" [dir=forward tooltip="include"]
    "3" -> "15" [dir=forward tooltip="include"]
    "3" -> "17" [dir=forward tooltip="include"]
    "3" -> "19" [dir=forward tooltip="include"]
    "3" -> "26" [dir=forward tooltip="include"]
    "21" -> "9" [dir=forward tooltip="include"]
    "21" -> "10" [dir=forward tooltip="include"]
    "21" -> "22" [dir=forward tooltip="include"]
    "21" -> "4" [dir=forward tooltip="include"]
    "21" -> "6" [dir=forward tooltip="include"]
    "26" -> "8" [dir=forward tooltip="include"]
    "26" -> "4" [dir=forward tooltip="include"]
    "26" -> "14" [dir=forward tooltip="include"]
}

Implementation of NIFs based on POSIX functions.

Functions

term posix_errno_to_term(int err, GlobalContext *glb)

Convenient function to return posix errors as atom.

POSIX does not define the values of errno errors, so this function makes sure Erlang code can interpret error codes whatever the platform.

Parameters:
  • err – the error code, typically obtained from errno(3)

  • glb – the global context

Returns:

an atom representing the error or an integer if the error number is not known.