天天看点

SYSTEM V标准的共享内存用于进程间通信的权限管理示例

输出同现SEGMENTATION FAULT是因为试图写操作,这是因为将虚拟内存挂载为了READ ONLY方式导致的权限不够。

输出:

 ./shmat_rd_flag_regular

get the share memory id is 32769

in yangzd the attach add is 0xb7734000

Now ,try to write the memory.

Segmentation fault

查看当前系统的共享内存信息,可以看到新建的共享内存段:

SYSTEM V标准的共享内存用于进程间通信的权限管理示例

继续阅读