- 论坛徽章:
- 0
|
回复 1楼 lee_scs 的帖子
The shmctl (“SHared Memory ConTroL”) call returns information about a shared
memory segment and can modify it.The first parameter is a shared memory segment
identifier.
To obtain information about a shared memory segment, pass IPC_STAT as the
second argument and a pointer to a struct shmid_ds.
To remove a segment, pass IPC_RMID as the second argument, and pass NULL as the
third argument.The segment is removed when the last process that has attached it
finally detaches it.
Each shared memory segment should be explicitly deallocated using shmctl when
you’re finished with it, to avoid violating the systemwide limit on the total number of
shared memory segments. Invoking exit and exec detaches memory segments but
does not deallocate them.
这个够详细了把。 |
|