dup man page on Xenix

Man page or keyword search:  
man Server   1130 pages
apropos Keyword Search (all sections)
Output format
Xenix logo
[printable version]



     DUP(S)		      XENIX System V			DUP(S)

     Name
	  dup, dup2 - Duplicates an open file descriptor.

     Syntax
	  int dup (fildes)
	  int fildes;

	  int dup2(fildes, fildes2)
	  int fildes, fildes2;

     Description
	  fildes is a file descriptor obtained from a creat, open,
	  dup, fcntl, or pipe 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(S).

	  dup returns the lowest available file descriptor.  dup2
	  causes fildes2 to refer to the same file as fildes. If
	  fildes2 already referred to an open file, it is closed
	  first.

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

	       fildes is not a valid open file descriptor.  [EBADF]

	       Sixty file descriptors are currently open.  [EMFILE]

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

     Notes
	  This routine must be linked using the linker option -lx.

     See Also
	  creat(S), close(S), exec(S), fcntl(S), open(S), pipe(S)

     Page 1					      (printed 8/7/87)

[top]
                             _         _         _ 
                            | |       | |       | |     
                            | |       | |       | |     
                         __ | | __ __ | | __ __ | | __  
                         \ \| |/ / \ \| |/ / \ \| |/ /  
                          \ \ / /   \ \ / /   \ \ / /   
                           \   /     \   /     \   /    
                            \_/       \_/       \_/ 
More information is available in HTML format for server Xenix

List of man pages available for Xenix

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net