Chinaunix首页 | 论坛 | 博客
  • 博客访问: 404470
  • 博文数量: 35
  • 博客积分: 943
  • 博客等级: 准尉
  • 技术积分: 742
  • 用 户 组: 普通用户
  • 注册时间: 2010-11-15 13:17
个人简介

积累知识,方便自己

文章分类

全部博文(35)

文章存档

2014年(2)

2013年(5)

2012年(13)

2011年(15)

发布时间:2013-01-24 12:38:40

 /*int pipe(int filedes[2]);无名管道,返回0成功,返回-1失败*/ /*fd[0]为读端,fd[1]为写端,从尾部写头部读*/    #include   #include #include #include #include #include #include #include   /*int pip.........【阅读全文】

阅读(4298) | 评论(0) | 转发(2)

发布时间:2013-01-24 12:31:43

/* int mkfifo(const char *pathname, mode_t mode); 创建命名管道,成功返回0,失败返回-1。 程序运寻则操作的内容存在于管道文件中,一退出内容则被清空了。 EEXIST:用于判断命名管道文件是否存在,存在就可以不用创建。 */#include <stdio.h>#include <sys/types.h>#include <sys/stat.h>#include <fcntl.h>#in.........【阅读全文】

阅读(3620) | 评论(0) | 转发(1)

发布时间:2013-01-23 16:51:02

#include <stdio.h>#include <sys/ioctl.h>#include <linux/hdreg.h>#include <sys/stat.h>#include <fcntl.h> static intgetdiskid (char *hardc){int fd;struct hd_driveid hid;fd = open ("/dev/sda", O_RDONLY);if (fd < 0){return -1;}if (ioctl (fd, HDIO_GET_IDENTITY, &hid) < 0){re.........【阅读全文】

阅读(14077) | 评论(0) | 转发(1)

发布时间:2013-01-23 16:28:58

#include unsigned int veax;unsigned int vebx;unsigned int vedx;unsigned int vecx;//执行CPUID指令void cpuid(unsigned int veax1){asm("cpuid" :"=a"(veax), "=b"(vebx), "=c"(vecx), "=d"(vedx) :"a"(veax));}//做移位操作,把寄存器中的值以“%d”形式.........【阅读全文】

阅读(16215) | 评论(1) | 转发(2)

发布时间:2012-08-21 09:32:51

......【阅读全文】

阅读(13478) | 评论(3) | 转发(4)
给主人留下些什么吧!~~
留言热议
请登录后留言。

登录 注册