[Overview][Constants][Types][Procedures and functions] |
Attach a shared memory block.
Source position: ipc.pp line 171
function shmat( |
shmid: cint; |
shmaddr: pointer; |
shmflg: cint |
):pointer; |
shmatattaches a shared memory block with identified shmidto the current process. The function returns a pointer to the shared memory block.
If shmaddris Nil, then the system chooses a free unmapped memory region, as high up in memory space as possible.
If shmaddris non-nil, and SHM_RNDis in shmflg, then the returned address is shmaddr, rounded down to SHMLBA. If SHM_RNDis not specified, then shmaddrmust be a page-aligned address.
The parameter shmflgcan be used to control the behaviour of the shmatcall. It consists of a ORed combination of the following constants:
For an example, see shmctl.
If an error occurs, -1 is returned, and IPCerroris set.
|
Return the ID of a shared memory block, possibly creating it |
|
|
Detach shared memory block. |
|
|
Perform control operations on a shared memory block. |