Chinaunix首页 | 论坛 | 博客
  • 博客访问: 222262
  • 博文数量: 48
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 412
  • 用 户 组: 普通用户
  • 注册时间: 2013-04-24 10:27
个人简介

Continuous pursuit technical details

文章分类

全部博文(48)

文章存档

2014年(1)

2013年(47)

分类: C/C++

2013-12-10 15:39:59

#include
#include
#include
#include
#include


#define SHMSZ 32


int main()
{
        char c;
        int shmid;
        key_t key;
        char *shm,*s;


        key = 34567;
        if((shmid=shmget(key,SHMSZ,IPC_CREAT|0666))<0){
                perror("shmget");
                exit(1);
        }


        if((shm=(char*)shmat(shmid,NULL,0)) == (char*)-1){
                perror("shmat");
                exit(1);
        }


        printf("shm is %s\n", shm);
        return 0;
}

阅读(2731) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~