Options for shared memory functions

SHM_KEEP_LOCK

Option for the read_shared_memory() and write_shared_memory() functions that prevents other programs writing to a shared memory segment until it has been released by the current program.

SHM_USE_FTOK

Unix only option for the create_shared_memory() and link_shared_memory(). If not specified creates the system key from a simple hash of share_name.

If options = SHM_USE_FTOK, the C library function ftok() is called to create the key. In this case the first character of share_name is used as the id char for ftok(), and the remaining text as the pathname of an existing file that must be accessible to the process. See the UNIX documentation of ftok() for more details.

SHM_PERSIST

Since Sculptor version 6.2.0

Windows: Create the shared memory backed with a real file (stored in $SCULPTOR/shmem/<sharename>), which will permit the shared memory to persist even if all the shared memory handles are released.

UNIX: Flag the shared memory to not be removed on last client detach.

SHM_GLOBAL

Since Sculptor version 6.2.0

Windows only option for the create_shared_memory() and link_shared_memory().

By default the shared memory is created in the “Local\” namespace, this option permits to create the shared memory in the “Global\” namespace so that it can be shared between different sessions in a Windows Host.

Note: This file mapping object created in the “Global\” namespace requires the SeCreateGlobalPrivilege privilege (the privilege is only needed in the creation not in the link). See Kernel object namespaces (MSDN link).


RELATED TOPICS

Shared memory functions

The include file sculptor.h