PgShmemAttach()

Record a shared memory reference

Synopsis:

int PgShmemAttach( char const *name,
                   unsigned long size,
                   void *addr );

Library:

ph

Description:

This function records a reference to an existing block of shared memory (that is, a block created with shm_open(), sized with ftruncate(), and mapped into the process's address space with mmap() — see the QNX Neutrino Library Reference).

The Photon library uses atexit() to arrange for PgShmemCleanup() to be called when your program terminates normally. If your program terminates abnormally, it should call PgShmemCleanup() explicitly.

Returns:

0
Successful completion.
-1
An error occurred ( errno is set).

Errors:

See the errors for shm_open() in the QNX Neutrino Library Reference.

Classification:

Photon

Safety:
Interrupt handler No
Signal handler No
Thread No

See also:

PgDrawBitmapmx(), PgDrawImagemx(), PgShmemCleanup(), PgShmemCreate(), PgShmemDestroy(), PgShmemDetach()

atexit(), errno, ftruncate(), mmap(), shm_open() in the QNX Neutrino Library Reference