ChinaUnix.net
相关文章推荐:

linux pipe buffer

网上看了一下,大部分的pipe()都是和fork()同时出现的 想问问高手,有没有什么方法可以不用pipe()+fork() 而用pipe() read() write() dup2() system ()实现popen() 的功能?

by yelavender - C/C++ - 2009-11-30 10:03:52 阅读(1357) 回复(2)

相关讨论

小程序建立一个父进程到子进程的管道,父进程关闭读端,子进程关闭写端,经过管道父进程向子进程传送数据. #include stdio.h> #include stdlib.h> #include unistd.h> #include sys/types.h> void write_to_pipe(int fd) { FILE *pstream; pstream = fdopen(fd, "w"); if (pstream == NULL) { perror("open for write error!\n"); exit(EXIT_FAILURE); } fprintf(pstream,"hi pipe!\n...

by ekin1999 - Linux文档专区 - 2009-11-01 00:08:02 阅读(678) 回复(0)

linux 系統的管線 (pipe) 概念十分實用及重要。所謂管線就是使用 “|” 符號,將第一個指令的輸出引導到第二個指令當作輸入,例如: ls /etc/ | grep ftp 以上指令分為兩部份,”ls /etc” 是列出 /etc 目錄下的檔案及目錄,而 “grep ftp” 則是搜索包括有 ftp 的內容。所以以上指令的執行結果就會是列出 /etc 裡面包括有 ftp 的檔案或目錄 本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u2/68521/showa...

by chinagdszvv - Linux文档专区 - 2008-06-11 14:22:28 阅读(566) 回复(0)

mkfifo pipe while read do read inputCmd eval $inputCmd done <pipe 在网上看到一段这样的pipe的code。自己试验了,没有什么结果。 请问shell的pipe有什么作用,可以用temp file代替吗。 shell的pipe和c语言的pipe有什么区别

by fufelixzh - Shell - 2013-01-03 17:58:47 阅读(1271) 回复(3)

/*the parent and child process comminucates through the pipe the child process write data to pipe the parent process read data from pipe */ #include #include #include #include #include #include #include #define BUF_SIZE 511 int main(int argc,char **argv) { char buffer[BUF_SIZE+1]; int fd[2];/*pipe file descriptor*/ if(argc!=2) { fprintf(stderr,"Usage:%s string\n",argv[0]); return 0; } /*cr...

by creatory - Linux文档专区 - 2008-12-12 19:27:24 阅读(775) 回复(0)

/******************************************** *Created By: Prometheus *Date : 2009-5-20 ********************************************/ /* * linux/fs/pipe.c * * Copyright (C) 1991, 1992 Linus Torvalds */ #include #include #include #include #include #include #include /* We don't use the head/tail construction any more. Now we use the start/len*/ /* contruction providing ...

by taozhijiangscu - Linux文档专区 - 2009-05-20 14:18:26 阅读(683) 回复(0)

前两天在另外一个帖子中跟别人争论readline/writelines的问题时,特意运行了程序测试,结果在windows下跟在linux下的执行结果竟然不一样。[code]#!/usr/bin/python fpath = 'abc.txt' fin = open(fpath,'r+') result = fin.readline() print result result=fin.writelines(['111\n']) fin.close [/code]abc.txt内容如下: abc abc abc abc abc 结果在linux下运行结果: abc 111 abc abc abc 但是在windows cygwin下执行的结果为:...

by wpdzyx - Python - 2012-09-23 11:28:19 阅读(3102) 回复(10)

Andrew Huang <bluedrum@163.com>  转载请注明作者及联络方式


FB最重要的操作绘制显存并且在LCD显示.显存是由LCD驱动在内核中分配的可以进行DMA的SDRAM空间.如果用户进程需要操作显存,必须用mmap将内核空间映射到用户进程来可操作.

by bluedrum - 移动操作系统 - 2011-12-21 08:41:36 阅读(1141) 回复(0)

本帖最后由 没本 于 2010-06-24 04:42 编辑 linux下各种buffer的比较(转载) 原文发表于「桃源」: http://linux.cuit.edu.cn/?p=919 [td=2,1]类型默认大小[1]存储位置操作函数备注 [td=1,4]标准I/O流[2]FileBUFSIZ[3] (8192) 或者st_blksize[4] (4096)[td=1,4]User Spacestat(2),setvbuf(),fflush()[td=1,4]每一个标准I/O流都有一个buffer stdinstdin->_IO_buf_end[5] - stdin->_IO_buf_base(1024) stdoutstdout->_IO_buf_end - ...

by 没本 - C/C++ - 2010-06-24 07:16:39 阅读(1603) 回复(1)

cache和buffer的区别? 答:写缓存和读缓存,目前就知道这么多 如果linux的cache达到了7个g多,如何清除 答:echo 1 > drop_caches 就清了 本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u3/98137/showart_1954915.html

by weiscott - Linux文档专区 - 2009-06-04 13:42:31 阅读(719) 回复(0)

buffer cache由两部分组成:一个或多个缓冲区拼合成的缓冲页面以及对缓冲区进行管理的buffer_head结构。从buffer cache所缓冲的数据来看,可以分成两种类型:块设备缓冲区、常规文件缓冲区。 一个缓冲区由一个buffer_head结构描述,对应着块设备buffer_head::b_dev上的一个块,块号为buffer_head::b_blocknr,块长度为buffer_head::b_size,缓冲区所在的物理页面为buffer_head::b_page,起始虚存地址为buffer_head::b...

by jaffaz - Linux文档专区 - 2008-03-09 16:02:59 阅读(797) 回复(0)