这是文件I/O的常用函数,open函数,open函数用来打开一个设备,他返回的是一个整型变量,如果这个值等于-1,说明打开文件出现错误,如果为大于0的值,那么这个值代表的就是文件描述符。一般的写法是if((fd=open("/dev/ttys0",O_RDWR | O_NOCTTY | O_ND.....
分类:
其他好文 时间:
2014-08-17 01:04:51
阅读次数:
195
1. read函数1) 函数原型: #include ssize_t read(int fd, void *buf, size_t count);2) 函数功能: read系统调用从文件描述符fd指向的文件中,读取count个字节到buf中。3) 参数说明: fd:文件描述符 buf:保存读入...
分类:
其他好文 时间:
2014-08-17 01:02:41
阅读次数:
214
Linux红帽磁盘管理~~~~RAID5+LVM实验环境:在Linux操作系统的PC机上添加3块20G大小的磁盘实验步骤:一.创建RAID5:1.准备工作:[root@112~]#uname-a//查看基本信息[root@112~]#cat/etc/redhat-release//查看红帽的发行版本为添加好的三个磁盘进行分区,分区的类型:FD(全称:..
分类:
系统相关 时间:
2014-08-16 17:14:11
阅读次数:
568
给自己挖了个坑,一切都得从“HelloWorld”开始。hello.S.data
msg:
.ascii"Hello,World!\n"
len=.-msg
.text
.globl_start
_start:
/*syscallwrite(intfd,constvoid*buf,size_tcount)*/
mov%r0,$1/*fd->stdout*/
ldr%r1,=msg/*buf->msg*/
ldr%r2,=len/*count->le..
分类:
移动开发 时间:
2014-08-15 02:49:58
阅读次数:
235
桌面环境[root@localhost~]#uname-aLinuxlocalhost.localdomain3.10.0-123.el7.x86_64#1SMPMonJun3012:09:22UTC2014x86_64x86_64x86_64GNU/Linux[root@localhost~]#cat/etc/redhat-releaseCentOSLinuxrelease7.0.1406(Core)[root@localhost~]#先格式化硬盘[root@localhost~]#fd..
分类:
其他好文 时间:
2014-08-15 02:45:58
阅读次数:
414
今天遇到了这个问题,之前找了半天原来是IO事件的socket描述符在epoll_ctl()处理之前关闭了。if(epoll_ctl(epollFd, EPOLL_CTL_DEL, ev->fd, &epv) fd, strerror(errno));在删除事件 epoll_ctl(kdpfd, EP...
分类:
其他好文 时间:
2014-08-12 18:18:34
阅读次数:
302