Chinaunix首页 | 论坛 | 博客
  • 博客访问: 140563
  • 博文数量: 43
  • 博客积分: 264
  • 博客等级: 二等列兵
  • 技术积分: 320
  • 用 户 组: 普通用户
  • 注册时间: 2012-05-25 08:46
文章分类

全部博文(43)

文章存档

2015年(4)

2014年(1)

2012年(38)

分类:

2012-07-16 10:15:23

原文已删除
阅读(986) | 评论(2) | 转发(0) |
给主人留下些什么吧!~~

gjf05_052012-07-18 23:09:23

二陷阱
fedora 下运行结果是:
[gou@localhost onweb]$ ./share_memory_pitfall
Failed to attach shared memory,times[01],errno:13
Failed to attach shared memory,times[02],errno:13
Failed to attach shared memory,times[03],errno:13
Failed to attach shared memory,times[04],errno:13
Failed to attach shared memory,times[05],errno:13
Failed to attach shared memory,times[06],errno:13
Failed to attach shared memory,times[07],errno:13
Failed to atta

gjf05_052012-07-18 12:56:03

一.应用的示例程序  strncpy(p_setting->agen,"jinyh",10);
中的str  ncpy 我第一次把它看成是st  m cpy,结果错了。
最后我编译时写成:strcpy(p_setting->agen,"jinyh");成功。
strncpy也能行。
运行结果:[gou@localhost onweb]$ ./share_memory
agen;jinyh
file_no:1

------ Shared Memory Segments --------
key        shmid      owner      perms      b