Linux POSIX共享内存方法&ipcs &struct shmid_ds
内容是主进程创建子进程计算斐波那契数列。
其中计算到第几项是有主进程命令行输入。
共享内存段,并且查看了一些信息。
参考操作系统概念第七版 3.10,3.11
关于LINUX C库函数 中的 fprintf - xiaoran_zhu的专栏 - CSDN博客
共享内存函数(shmget、shmat、shmdt、shmctl)及其范例 - guoping16的专栏 - CSDN博客
![](https://upload-images.jianshu.io/upload_images/16981913-e1662d8ec6a0f6d4.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
![](https://upload-images.jianshu.io/upload_images/16981913-03d36ed25d141a2f.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
代码:
![](https://upload-images.jianshu.io/upload_images/16981913-7456f43e0010944c.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
![](https://upload-images.jianshu.io/upload_images/16981913-dc63fd908dc3dccc.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
![](https://upload-images.jianshu.io/upload_images/16981913-a938445edbeaed28.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
![](https://upload-images.jianshu.io/upload_images/16981913-2c77cc4ceb3e0e2e.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
内容是主进程创建子进程计算斐波那契数列。
其中计算到第几项是有主进程命令行输入。
共享内存段,并且查看了一些信息。
参考操作系统概念第七版 3.10,3.11
关于LINUX C库函数 中的 fprintf - xiaoran_zhu的专栏 - CSDN博客
共享内存函数(shmget、shmat、shmdt、shmctl)及其范例 - guoping16的专栏 - CSDN博客
代码: