2012年4月7日

有名管道

摘要: 写程序#include<stdio.h>#include<stdlib.h>#include<string.h>#include<unistd.h>#include<sys/types.h>#include<sys/stat.h>#include<fcntl.h>int main(){int f;int fd;//char buff[10];f = mkfifo("myfifo",06666);//创建有名管道char buf[] = "abcd";fd = open(& 阅读全文

posted @ 2012-04-07 22:57 小风儿_xf 阅读(469) 评论(0) 推荐(0) 编辑

无名管道pipe

摘要: #include<stdio.h>#include<stdlib.h>#include<unistd.h>#include<string.h>int main(){pid_t pid;int pipefd[2];pipe(pipefd);pid = fork();if(pid == 0){//子进程char buf_2[20];bzero(buf_2, 20);sleep(2);read(pipefd[0], buf_2, 17);//从管道的读端读出数据printf("%s",buf_2);close(pipefd[0]); 阅读全文

posted @ 2012-04-07 20:43 小风儿_xf 阅读(193) 评论(0) 推荐(0) 编辑

进程

摘要: #include<stdio.h>#include<stdlib.h>#include<unistd.h>#include<sys/wait.h>#include<sys/types.h>int main(){pid_t t;char buf[] = "test!";t = fork();//创建一个子进程 if(t == 0){printf("child\n");printf("C: %s\n",buf);execlp("ls","ls&quo 阅读全文

posted @ 2012-04-07 19:31 小风儿_xf 阅读(135) 评论(0) 推荐(0) 编辑

2012年3月13日

android之button

摘要: 1:新建工程TEST42:在mai.xml中,如下代码<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertic 阅读全文

posted @ 2012-03-13 17:33 小风儿_xf 阅读(186) 评论(0) 推荐(0) 编辑

2012年3月9日

3_9笔记

该文被密码保护。 阅读全文

posted @ 2012-03-09 18:16 小风儿_xf 阅读(7) 评论(0) 推荐(0) 编辑

2012年3月8日

3_8笔记

该文被密码保护。 阅读全文

posted @ 2012-03-08 19:42 小风儿_xf 阅读(7) 评论(0) 推荐(0) 编辑

2012年3月7日

3_7心得

该文被密码保护。 阅读全文

posted @ 2012-03-07 20:25 小风儿_xf 阅读(4) 评论(0) 推荐(0) 编辑

3_7笔记

该文被密码保护。 阅读全文

posted @ 2012-03-07 20:19 小风儿_xf 阅读(8) 评论(0) 推荐(0) 编辑

2011年12月10日

arm模块调试环境

摘要: 硬件: 1:arm板子,usb线,usb转串口线,电源线软件: dnw 0.50L.exe, xf_arm.ht(超级终端), 虚拟机+linux调试流程: 通过在linux下编写程序,然后编写makefile;将生成的***.bin文件通过搭建的smb复制到windows下,可以在桌面建一个文件专门进行存放; 在硬件连接好和软件开启的情况下,设置arm9开发板的启动方式为norflash启动,打开arm开发板电源,在超级终端下面选择数字键7,对应的是Download Program to SDRAM and Run it;然后在dnw 0.50L.exe选择USB Port-... 阅读全文

posted @ 2011-12-10 00:29 小风儿_xf 阅读(213) 评论(0) 推荐(0) 编辑

2011年12月1日

将一个文件读到另一个文件

摘要: #include<stdio.h>#include<sys/stat.h>#include<sys/types.h>#include<fcntl.h>#include<errno.h>#define BUFFER_SIZE 1024int main(int argc, char **argv){ int from_fd, to_fd; int read_bytes, write_bytes; char buffer[BUFFER_SIZE]; char *ptr; if(argc != 3) { fprintf(stde... 阅读全文

posted @ 2011-12-01 22:46 小风儿_xf 阅读(222) 评论(0) 推荐(0) 编辑

导航