⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pipe.2s

📁 7号信令功能代码,为开源代码
💻 2S
字号:
'\" rtp.\" -*- nroff -*-.\".\" @(#) pipe.2s,v 1.1.4.1 2004/01/12 23:45:03 brian Exp.\".\" =========================================================================.\".\" Copyright (C) 2001-2004  OpenSS7 Corporation <www.openss7.com>.\".\" All Rights Reserved..\".\" Permission is granted to make and distribute verbatim copies of this.\" manual provided the copyright notice and this permission notice are.\" preserved on all copies..\".\" Permission is granted to copy and distribute modified versions of this.\" manual under the conditions for verbatim copying, provided that the.\" entire resulting derived work is distributed under the terms of a.\" permission notice identical to this one.\" .\" Since the Linux kernel and libraries are constantly changing, this.\" manual page may be incorrect or out-of-date.  The author(s) assume no.\" responsibility for errors or omissions, or for damages resulting from.\" the use of the information contained herein.  The author(s) may not.\" have taken the same level of care in the production of this manual,.\" which is licensed free of charge, as they might when working.\" professionally..\" .\" Formatted or processed versions of this manual, if unaccompanied by.\" the source, must acknowledge the copyright and authors of this work..\".\" -------------------------------------------------------------------------.\".\" U.S. GOVERNMENT RESTRICTED RIGHTS.  If you are licensing this Software.\" on behalf of the U.S. Government ("Government"), the following.\" provisions apply to you.  If the Software is supplied by the Department.\" of Defense ("DoD"), it is classified as "Commercial Computer Software".\" under paragraph 252.227-7014 of the DoD Supplement to the Federal.\" Acquisition Regulations ("DFARS") (or any successor regulations) and the.\" Government is acquiring only the license rights granted herein (the.\" license rights customarily provided to non-Government users).  If the.\" Software is supplied to any unit or agency of the Government other than.\" DoD, it is classified as "Restricted Computer Software" and the.\" Government's rights in the Software are defined in paragraph 52.227-19.\" of the Federal Acquisition Regulations ("FAR") (or any success.\" regulations) or, in the cases of NASA, in paragraph 18.52.227-86 of the.\" NASA Supplement to the FAR (or any successor regulations)..\".\" =========================================================================.\".\" Modified 2004/01/12 23:45:03 by brian.\".\" =========================================================================.\".\" Copyright (C) 2000  John A. Boyd Jr.  protologos, LLC.\".\" This library is free software; you can redistribute it and/or.\" modify it under the terms of the GNU Library General Public.\" License as published by the Free Software Foundation; either.\" version 2 of the License, or (at your option) any later version..\".\" This library is distributed in the hope that it will be useful,.\" but WITHOUT ANY WARRANTY; without even the implied warranty of.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU.\" Library General Public License for more details..\".\" You should have received a copy of the GNU Library General Public.\" License along with this library; if not, write to the.\" Free Software Foundation, Inc., 59 Temple Place - Suite 330, Cambridge,.\" MA 02139, USA..\".so lis.macros.R1bracket-label "\fR[\fB" "\fR]" "\fR, \fB"no-default-databasedatabase lis.refsaccumulatemove-punctuationabbreviate Ajoin-authors ", " ", " " and "et-al " et al" 2 3abbreviate-label-ranges ".."sort-adjacent-labels.R2.\".\".TH PIPE 2 "2004/01/12 23:45:03" "LiS-2_16_18-8" "Linux STREAMS System Calls".SH NAME.B pipe\- create a \fISTREAMS\fR \fIpipe\fR.SH SYNOPSIS.PP.B "#include <unistd.h> ".HP.BI "int pipe( int " filedes "[2] ); ".SH DESCRIPTION.PP.BR pipe ()creates a.I STREAMS.B pipe(see.BR fifo "(4) "and.IR STREAMS "(4)), "and provides access to its ends as a pair of file descriptorsreturned in the.I filedesargument..spThe file descriptors returned allow both read and write accessto the pipe.  Data written to one end is readable at the other,independently in each direction;  i.e.,.I STREAMSpipes are not just.IR bidirectional ,but.IR "full-duplex" ..spStructurally, a.I STREAMS.B pipeconsists of a pair of.IR "stream heads" ,each comprising a read/write queue pair, with the write queue of eachend directed to the read queue of the other end.The point at which this occurs is referred to as the.I midpointof the pipe..spGenerally otherwise, a.I STREAMS.B pipebehaves as a pair of.I STREAMSfiles; e.g.,.I STREAMS.I modulesmay be pushed onto either end, etc...spA notable exception is that.I STREAMS.I pipesprovide the (only) means for passing open file descriptors via the.I STREAMS.B I_SENDFDand.B I_RECVFD.I ioctlmechanisms.  Specifically, a file descriptor can (and must) be senton one end of a pipe via.B I_SENDFDto the other end, where it may be received via.BR I_RECVFD ..SH "RETURN VALUE".PPUpon successful completion,.BR pipe ()returns 0.Upon failure,.BR pipe ()returns -1, and.BR errno "(3) "is set to indicate the error causing the failure..SH "APPLICATION USAGE".PPThe Linux kernel provides an independent implementation of.IR pipes ,corresponding to that provided before SVR4.[svr4.]used.I STREAMSto implement them (see .BR pipe "(3)). "Although the interface is identical, the two are quite differentotherwise..I STREAMSprovide significant additional capability, but possibly at a lowerlevel of performance.Notably,.I STREAMSpipes are full duplex (i.e., both ends support both read and writeaccess independently), and allow the use of.I STREAMS.I modulesto augment the processing of data.  Moreover, such processing maybe.IR message \- oriented :message boundaries may be established and respected by using the.BR getmsg "(2)/" getpmsg "(2) "and.BR putmsg "(2)/" putpmsg "(2) "primitives instead of.BR read "(2) "and.BR write "(2). ".spApplications wishing to use the.I STREAMSversion of the.BR pipe ()function must link with the.B LiS.[LiS.]library which provides it; otherwise,the Linux kernel version will be used via the Linux/GNU C library..SH "FUTURE DIRECTIONS".PPUnder Linux,.BR pipe ()is implemented as an.I ioctloperation on an anonymous.I STREAMSfile.An alternative system call implementation may be used in the future,and is fact already supported within.B LiS\c..[LiS.].spIt should be noted that no attention has yet been given to the issueof atomic reads and writes in.I STREAMSpipes and fifos, common to mostimplementations of these mechanisms.  This issue will be addressedhopefully in the near future..SH HISTORY.PPUNIX\(rg\ System V Release 4 (SVR4).[svr4.].SH "SEE ALSO".PP.BR pipemod "(4), ".BR connld "(4), ".BR errno "(3), ".BR fifo "(4), ".BR STREAMS "(4) ".SH AUTHOR.PPJohn Boyd, protologos LLC..[$LIST$.].TI

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -