CDMmap (FUN)ΒΆ
FUNCTION CDMmap : POINTER TO BYTE
Map files or devices into memory. mmap() creates a new mapping in the virtual address space of the calling process.
- InOut:
Scope
Name
Type
Comment
Return
CDMmapPOINTER TO BYTE
pointer to the mapped area, or MAP_FAILED if failed.
Input
addrPOINTER TO BYTE
Pointer to starting address for the new mapping
lengthUDINTNumber of bytes mapped
protDINT- Memory protection of the mapping. It is either PROT_NONE or the bitwise OR of one or more of the following flags:
PROT_EXEC: Pages may be executed
PROT_READ: Pages may be read
PROT_WRITE: Pages may be written
PROT_NONE: Pages may not be accessed
flagsDINT- one of the following flags
MAP_SHARED: Share this mapping
MAP_SHARED_VALIDATE: This flag provides the same behavior as MAP_SHARED except that MAP_SHARED mappings ignore unknown flags in flags
MAP_PRIVATE: Create a private copy-on-write mapping
Optional flags for mmap: See linux man page for Details
hFileRTS_IEC_HANDLEFile descriptor of the file to be mapped
offsetDINTOffset in the file (or other object) where mapping starts
pResultPOINTER TO DINT
Pointer to linux errno error code, 0 is ok