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

📄 pipe.2

📁 <B>Digital的Unix操作系统VAX 4.2源码</B>
💻 2
字号:
.\" SCCSID: @(#)pipe.2	8.1	9/11/90.TH pipe 2.SH Namepipe \- create an interprocess channel.SH Syntaxinclude <limits.h> /*Definition of PIPE_MAX*/.nfpipe(\fIfildes\fP)int \fIfildes[2]\fP;.fi.SH Arguments.TP 10.I fildesPassing an address as an array of two integers into the.PN pipesystem call..SH Description.NXR "pipe system call".NXR "pipe" "creating"The.PN pipesystem callcreates an I/O mechanism called a pipe.The file descriptors returned canbe used in.PN readand.PN writeoperations.  Their integer values will be the two lowest available at the timeof the.PN pipefunction call.  The O_NONBLOCK and FD_CLOEXEC flagswill be clear on both file descriptors..PPWhen the pipe is written using the descriptor.IR fildes [1],up to PIPE_MAX bytes of data are bufferedbefore the writing process is suspended.A read using the descriptor.IR fildes [0]picks up the data..PPIt is assumed that after the pipe has been set up, two (or more)cooperating processes (created by subsequent.PN forkcalls) pass data through the pipe with.PN readand.PN writecalls..PPThe shell has a syntax to set up a linear array of processesconnected by pipes..PPFor further information on how .PN readand.PN writecalls behave with pipes, see the.MS read 2and.MS write 2reference pages..PPA signal is generatedif a write on a pipe with only one end is attempted..SH RestrictionsShould more than 4096 bytes be necessary in anypipe among a loop of processes, deadlock may occur..PPThe underlying implementation of pipes is no longersocket based, but rather implemented through thefile system.  Any application that needs socketfunctionality from pipes should use the .PN socketpair system call..SH Return ValuesThe function value zero is returned if thepipe was created; \-1 if an error occurred..SH DiagnosticsThe .PN pipecall fails if:.TP 15[EMFILE]Too many descriptors are active..TP 15[ENFILE]The system file table is full..TP 15[EFAULT]The.I fildesbuffer is in an invalid area of the process's address space..SH EnvironmentDiffers from the System V definition in that ENFILEis not a possible error condition..SH See Alsosh(1), fork(2), read(2), socketpair(2), write(2)

⌨️ 快捷键说明

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