|
Hopefully, this page is exactly what you are looking for, but if not, you can always find further assistance on Unix/Linux Forum!
System Calls dup(2)
NAME
dup - duplicate an open file descriptor
SYNOPSIS
#include <unistd.h>
int dup(int fildes);
DESCRIPTION
The dup() function returns a new file descriptor having the
following in common with the original open file descriptor
fildes:
o same open file (or pipe)
o same file pointer (that is, both file descriptors share
one file pointer)
o same access mode (read, write or read/write).
The new file descriptor is set to remain open across exec
functions (see fcntl(2)).
The file descriptor returned is the lowest one available.
The dup(fildes) function call is equivalent to:
fcntl(fildes, F_DUPFD, 0)
RETURN VALUES
Upon successful completion, a non-negative integer
representing the file descriptor is returned. Otherwise, -1
is returned and errno is set to indicate the error.
ERRORS
The dup() function will fail if:
EBADF The fildes argument is not a valid open file
descriptor.
EINTR A signal was caught during the execution of
the dup() function.
EMFILE The process has too many open files (see
getrlimit(2)).
SunOS 5.10 Last change: 28 Dec 1996 1
System Calls dup(2)
ENOLINK The fildes argument is on a remote machine
and the link to that machine is no longer
active.
ATTRIBUTES
See attributes(5) for descriptions of the following attri-
butes:
____________________________________________________________
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
|_____________________________|_____________________________|
| Interface Stability | Standard |
|_____________________________|_____________________________|
| MT-Level | Async-Signal-Safe |
|_____________________________|_____________________________|
SEE ALSO
close(2), creat(2), exec(2), fcntl(2), getrlimit(2),
open(2), pipe(2), dup2(3C), lockf(3C), attributes(5), stan-
dards(5)
SunOS 5.10 Last change: 28 Dec 1996 2
Man(1) output converted with
man2html and wrapped by fishsponge
This page was generated on Wed Sep 12 21:37:21 GMT 2007
|
Your favourite pages:
No pages logged yet. Trying to save cookie... Top 10 most popular pages:
sqlite3 man page (5080 hits) (openSUSE 10.2)
adv_cap_autoneg man page (4745 hits) (Solaris 10 11_06)
CPAN man page (4465 hits) (Suse Linux 10.1)
ssh man page (4248 hits) (Suse Linux 10.1)
svn man page (4222 hits) (FreeBSD 6.2)
startproc man page (2190 hits) (Suse Linux 10.1)
ssh-socks5-proxy-connect man page (2183 hits) (Solaris 10 11_06)
netcat man page (2151 hits) (Suse Linux 10.1)
pprosetup man page (2007 hits) (Solaris 10 11_06)
signal man page (1991 hits) (Suse Linux 10.1)
|