[Previous] [Contents] [Index] [Next]

PgShmemAttach()

Record a shared memory reference

Synopsis:

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

Description:

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

PgShmemCleanup() is called automatically by atexit() when your program terminates normally. If your program terminates abnormally, it should call PgShmemCleanup() explicitly.

Returns:

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

Errors:

See the errors for shm_open() in the C Library Reference.

Classification:

Photon

Safety:
Interrupt handler No
Signal handler No
Thread No

See also:

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

shm_open(), ltrunc(), mmap() in the C Library Reference


[Previous] [Contents] [Index] [Next]