POSIX and System V shared memory functions differ

Source: Internet
Author: User
Tags posix

POSIX standard
Shm_open:Open or create a shared memory area
shm_unlink: Delete a shared memory area
ftruncate: resizing a file or shared memory area
Sem_open:CreateSignal Volume
Sem_wait: Wait for the semaphore
Sem_post: Send Signal volume
Sem_close: Off Signal volume

System v Standard
Ftok:Generate key
shmget: Create shared memory
shmdt: delete shared memory Area
Semget: create semaphore
Semop: Operation Semaphore
Semctl: Control semaphore


briefly explain the IPCS command and the IPCRM command.
Obtain IPC information:
IPCS [-m|-q|-s]
-m outputs information about shared memory
-Q output Information about information queue (Message queue)
-s output about the "breaker" ( Semaphore) Information
%ipcs-m

Delete IPC
ipcrm-m|-q|-s shm_id
%ipcrm-m

SYSTEMV Code Delete:
Semctl (m_ sem_id,0, Ipc_rmid);
Shmctl (m_shm_id,ipc_rmid,null);

Linux feels good for SYSTEMV, many older versions do not support POSIX-related functions

POSIX and System V shared memory functions differ

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.