📄 pipe.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html><head><!-- Copyright 1997 The Open Group, All Rights Reserved --><title>pipe</title></head><body bgcolor=white><center><font size=2>The Single UNIX ® Specification, Version 2<br>Copyright © 1997 The Open Group</font></center><hr size=2 noshade><h4><a name = "tag_000_007_973"> </a>NAME</h4><blockquote>pipe - create an interprocess channel</blockquote><h4><a name = "tag_000_007_974"> </a>SYNOPSIS</h4><blockquote><pre><code>#include <<a href="unistd.h.html">unistd.h</a>>int pipe(int <i>fildes</i>[2]);</code></pre></blockquote><h4><a name = "tag_000_007_975"> </a>DESCRIPTION</h4><blockquote>The<i>pipe()</i>function will create a pipe and place two file descriptors, oneeach into the arguments<i>fildes</i>[0]and<i>fildes</i>[1],that refer to the open file descriptions for the read and writeends of the pipe.Their integer values will be the two lowest available at the timeof the<i>pipe()</i>call.The O_NONBLOCK and FD_CLOEXEC flags shall be clear on both filedescriptors.(The<i><a href="fcntl.html">fcntl()</a></i>function can be used to set both these flags.)<p>Data can be written to the file descriptor<i>fildes</i>[1]and read from file descriptor<i>fildes</i>[0].A read on the file descriptor<i>fildes</i>[0]will access data written to file descriptor<i>fildes</i>[1]on a first-in-first-out basis.It is unspecified whether <i>fildes</i>[0] is also open for writingand whether <i>fildes</i>[1] is also open for reading.<p>A process has the pipe open for reading (correspondingly writing)if it has a file descriptor open that refers to the read end,<i>fildes</i>[0](write end,<i>fildes</i>[1]).<p>Upon successful completion,<i>pipe()</i>will mark for update the<i>st_atime</i>,<i>st_ctime</i>and<i>st_mtime</i>fields of the pipe.</blockquote><h4><a name = "tag_000_007_976"> </a>RETURN VALUE</h4><blockquote>Upon successful completion, 0 is returned. Otherwise, -1 is returned and<i>errno</i>is set to indicate the error.</blockquote><h4><a name = "tag_000_007_977"> </a>ERRORS</h4><blockquote>The<i>pipe()</i>function will fail if:<dl compact><dt>[EMFILE]<dd>More than {OPEN_MAX} minus two file descriptors are already inuse by this process.<dt>[ENFILE]<dd>The number of simultaneously open files in the system wouldexceed a system-imposed limit.</dl></blockquote><h4><a name = "tag_000_007_978"> </a>EXAMPLES</h4><blockquote>None.</blockquote><h4><a name = "tag_000_007_979"> </a>APPLICATION USAGE</h4><blockquote>None.</blockquote><h4><a name = "tag_000_007_980"> </a>FUTURE DIRECTIONS</h4><blockquote>None.</blockquote><h4><a name = "tag_000_007_981"> </a>SEE ALSO</h4><blockquote><i><a href="fcntl.html">fcntl()</a></i>,<i><a href="read.html">read()</a></i>,<i><a href="write.html">write()</a></i>,<i><a href="fcntl.h.html"><fcntl.h></a></i>,<i><a href="unistd.h.html"><unistd.h></a></i>.</blockquote><h4>DERIVATION</h4><blockquote>Derived from Issue 1 of the SVID.</blockquote><hr size=2 noshade><center><font size=2>UNIX ® is a registered Trademark of The Open Group.<br>Copyright © 1997 The Open Group<br> [ <a href="../index.html">Main Index</a> | <a href="../xshix.html">XSH</a> | <a href="../xcuix.html">XCU</a> | <a href="../xbdix.html">XBD</a> | <a href="../cursesix.html">XCURSES</a> | <a href="../xnsix.html">XNS</a> ]</font></center><hr size=2 noshade></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -