일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 퀄컴
- EV-DO Rev. B
- itmusic
- 사요
- Wibro
- 유희열의라디오천국
- USIM
- 차트쇼쇼쇼
- 러시아
- "명탐정 코난"
- VoIP
- 한국의 기획자들
- brew
- HSDPA
- 페이스북
- CDMA
- 위피
- ETF
- 그녀가말했다
- Java
- 공정위
- 이지형
- 김장훈
- 김장훈의who
- 민동현
- 라디오
- 민동현의토요명화
- 모던음악만만세
- SWT
- 자바
- Today
- Total
zyint's blog
[1] Unix manual page for dup2 본문
Unix Manual Page for dup2
NAME
dup2 - duplicate an open file descriptor
SYNOPSIS
#include <unistd.h>
int dup2(int fildes, int fildes2);
DESCRIPTION
The dup2() function causes the file descriptor fildes2 to
refer to the same file as fildes. The fildes argument is a
file descriptor referring to an open file, and fildes2 is a
non-negative integer less than the current value for the
maximum number of open file descriptors allowed the calling
process. See getrlimit(2). If fildes2 already refers to an
open file, not fildes, it is closed first. If fildes2 refers
to fildes, or if fildes is not a valid open file descriptor,
fildes2 will not be closed first.
The dup2() function is equivalent to fcntl(fildes,
F_DUP2FD, fildes2).
RETURN VALUES
Upon successful completion a non-negative integer represent-
ing the file descriptor is returned. Otherwise, -1 is
returned and errno is set to indicate the error.
ERRORS
The dup2() function will fail if:
EBADF The fildes argument is not a valid open file descrip-
tor.
EBADF The files2 argument is negative or is not less than
the current resource limit returned by
getrlimit(RLIMIT_NOFILE, ...).
EINTR A signal was caught during the dup2() call.
EMFILE
The process has too many open files. See fcntl(2).
ATTRIBUTES
- See attributes(5) for descriptions of the following attri-
butes:
____________________________________________________________
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
|_____________________________|_____________________________|
| MT-Level | Safe |
|_____________________________|_____________________________|
SEE ALSO
close(2), creat(2), exec(2), fcntl(2), getrlimit(2),
open(2), pipe(2), lockf(3C), attributes(5)
원문
http://www.scit.wlv.ac.uk/cgi-bin/mansec?3C+dup2
이 글은 스프링노트에서 작성되었습니다.