일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
- 사요
- brew
- 민동현의토요명화
- 페이스북
- "명탐정 코난"
- ETF
- SWT
- 차트쇼쇼쇼
- 모던음악만만세
- Wibro
- 라디오
- 그녀가말했다
- 김장훈
- itmusic
- 이지형
- EV-DO Rev. B
- 자바
- 한국의 기획자들
- 유희열의라디오천국
- 위피
- 민동현
- USIM
- 공정위
- CDMA
- 러시아
- VoIP
- 김장훈의who
- Java
- HSDPA
- 퀄컴
- Today
- Total
zyint's blog
[1] Unix manual page for pipe 본문
Unix Manual Page for pipe
NAME
pipe - create an interprocess channel
SYNOPSIS
#include <unistd.h>
int pipe(int fildes[2]);
DESCRIPTION
The pipe() function creates an I/O mechanism called a pipe
and returns two file descriptors, fildes[0] and fildes[1].
The files associated with fildes[0] and fildes[1] are
streams and are both opened for reading and writing.
The O_NDELAY and O_NONBLOCK flags are cleared.
A read from fildes[0] accesses the data written to fildes[1]
on a first-in-first-out (FIFO) basis and a read from
fildes[1] accesses the data written to fildes[0] also on a
FIFO basis.
The FD_CLOEXEC flag will be clear on both file descriptors.
Upon successful completion pipe() marks for update the
st_atime, st_ctime, and st_mtime fields of the pipe.
RETURN VALUES
Upon successful completion, 0 is returned. Otherwise, -1 is
returned and errno is set to indicate the error.
ERRORS
The pipe() function will fail if:
EMFILE
There are OPEN_MAX-1 or more file descriptors
currently open for this process.
ENFILE
A file table entry could not be allocated.
ATTRIBUTES
- See attributes(5) for descriptions of the following attri-
butes:
____________________________________________________________
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
|_____________________________|_____________________________|
| MT-Level | Async-Signal-Safe |
|_____________________________|_____________________________|
SEE ALSO
sh(1), fcntl(2), fstat(2), getmsg(2), poll(2), putmsg(2),
read(2), write(2), attributes(5), streamio(7I)
NOTES
Since a pipe is bi-directional, there are two separate flows
of data. Therefore, the size (st_size) returned by a call to
fstat(2) with argument fildes[0] or fildes[1] is the number
of bytes available for reading from fildes[0] or fildes[1]
respectively. Previously, the size (st_size) returned by a
call to fstat() with argument fildes[1] (the write-end) was
the number of bytes available for reading from fildes[0]
(the read-end).
원문
http://www.scit.wlv.ac.uk/cgi-bin/mansec?2+pipe
이 글은 스프링노트에서 작성되었습니다.