*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->IRIX man pages -> standard/dup (2)              
Title
Content
Arch
Section
 

Contents


dup(2)									dup(2)


NAME    [Toc]    [Back]

     dup - duplicate an	open file descriptor

SYNOPSIS    [Toc]    [Back]

     #include <unistd.h>

     int dup(int fildes);

DESCRIPTION    [Toc]    [Back]

     fildes is a file descriptor obtained from a creat,	open, dup, fcntl,
     pipe, or ioctl system call.  dup returns a	new file descriptor having the
     following in common with the original:

	  Same open file (or pipe).

	  Same file pointer (i.e., both	file descriptors share one file
	  pointer).

	  Same access mode (read, write	or read/write).

     The new file descriptor is	set to remain open across exec system calls
     [see fcntl(2)].

     The file descriptor returned is the lowest	one available.

     dup will fail if one or more of the following are true:

     EBADF	    fildes is not a valid open file descriptor.

     EINTR	    A signal was caught	during the dup system call.

     EMFILE	    The	process	has too	many open files	[see getrlimit(2)].

     ENOLINK	    fildes is on a remote machine and the link to that machine
		    is no longer active.

SEE ALSO    [Toc]    [Back]

      
      
     close(2), creat(2), exec(2), fcntl(2), getrlimit(2), open(2), pipe(2),
     dup2(3C), lockf(3C).

DIAGNOSTICS    [Toc]    [Back]

     Upon successful completion	a non-negative integer,	namely the file
     descriptor, is returned.  Otherwise, a value of -1	is returned and	errno
     is	set to indicate	the error.


									PPPPaaaaggggeeee 1111
[ Back ]
 Similar pages
Name OS Title
dup2 HP-UX duplicate an open file descriptor to a specific slot
dup Linux duplicate a file descriptor
dup2 FreeBSD duplicate an existing file descriptor
dup NetBSD duplicate an existing file descriptor
dup OpenBSD duplicate an existing file descriptor
dup2 OpenBSD duplicate an existing file descriptor
dup FreeBSD duplicate an existing file descriptor
dup2 NetBSD duplicate an existing file descriptor
AFidentifyfd IRIX retrieve the audio file format of a file descriptor / open AFfilehandle
getdtablehi IRIX get largest open file descriptor index
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service