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

📄 pipe.2

📁 Unix操作系统minix 2.0源码
💻 2
字号:
.\" Copyright (c) 1980 Regents of the University of California..\" All rights reserved.  The Berkeley software License Agreement.\" specifies the terms and conditions for redistribution..\".\"	@(#)pipe.2	6.2 (Berkeley) 8/26/85.\".TH PIPE 2 "August 26, 1985".UC 4.SH NAMEpipe \- create an interprocess communication channel.SH SYNOPSIS.nf.ft B#include <unistd.h>int pipe(int \fIfildes\fP[2]).fi.ft R.SH DESCRIPTIONThe.B pipesystem callcreates an I/O mechanism called a pipe.The file descriptors returned canbe used in read and write operations.When 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]will pick up the data..PPPIPE_MAX equals 7168 under Minix, but note that most systems use 4096..PPIt is assumed that after thepipe has been set up,two (or more)cooperating processes(created by subsequent.B forkcalls)will pass data through thepipe with.B readand.B writecalls..PPThe shell has a syntaxto set up a linear array of processesconnected by pipes..PPRead calls on an emptypipe (no buffered data) with only one end(all write file descriptors closed)returns an end-of-file..PPThe signal SIGPIPE is generated if a write on a pipe with only one endis attempted..SH "RETURN VALUEThe function value zero is returned if thepipe was created; \-1 if an error occurred..SH ERRORSThe \fBpipe\fP call will fail if:.TP 15[EMFILE]Too many descriptors are active..TP 15[ENFILE]The system file table is full..TP 15[ENOSPC]The pipe file system (usually the root file system) has no free inodes..TP 15[EFAULT]The \fIfildes\fP buffer is in an invalid area of the process's addressspace..SH "SEE ALSO".BR sh (1),.BR read (2),.BR write (2),.BR fork (2)..SH NOTESWrites may return ENOSPC errors if no pipe data can be buffered, becausethe pipe file system is full..SH BUGSShould more than PIPE_MAX bytes be necessary in anypipe among a loop of processes, deadlock will occur.

⌨️ 快捷键说明

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