/*
编写两个进程a和b,利用共享内存技术,a向共享内存写字符串,b将从共享内存中读到的字符串在屏幕上打印出来。
*/

#include <stdio.h>
#include <stdlib.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#include <string.h>
#include <unistd.h>

int main(int argc, char * argv[])
{

    char *shmbuf;
    int shmid = 0;
    shmbuf = shmat(shmid,0,0);
    pid_t pid = fork();
    if (pid ==

备份地址: 【Linux进程间通信(IPC)demo