AT&T UNIX™PC Unix System V Users Manual - tenox

AT&T UNIX™PC Unix System V Users Manual - tenox AT&T UNIX™PC Unix System V Users Manual - tenox

01.01.2013 Views

CREAT (2) CREAT (2) file descriptor, is returned. Otherwise, a value of -1 is returned and errno is set to indicate the error. SEE ALSO close(2), dup(2), lseek(2), open(2), read(2), umask(2), write(2). - 2-

DUP (2) DUP (2) NAME dup - duplicate an open file descriptor SYNOPSIS int dup (fildes) int fildes; DESCRIPTION Fildes is a file descriptor obtained from a ere at, 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(2). The file descriptor returned is the lowest one available. Dup will fail if one or more of the following are true: Fildes is not a valid open file descriptor. [EBADF[ Eighty (80) file descriptors are currently open. [EMFILE[ RETURN VALUE 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. SEE ALSO creat(2), close(2), exec(2), fcnt1(2), open(2), pipe(2). - 1 -

DUP (2) DUP (2)<br />

NAME<br />

dup - duplicate an open file descriptor<br />

SYNOPSIS<br />

int dup (fildes)<br />

int fildes;<br />

DESCRIPTION<br />

Fildes is a file descriptor obtained from a ere at, open, dup , fcntl,<br />

or pipe system call. Dup returns a new file descriptor having the<br />

following in common with the original:<br />

Same open file (or pipe).<br />

Same file pointer. (i.e., both file descriptors share one file<br />

pointer.)<br />

Same access mode (read, write or read/write).<br />

The new file descriptor is set to remain open across exec system<br />

calls. See fcntl(2).<br />

The file descriptor returned is the lowest one available.<br />

Dup will fail if one or more of the following are true:<br />

Fildes is not a valid open file descriptor. [EBADF[<br />

Eighty (80) file descriptors are currently open. [EMFILE[<br />

RETURN VALUE<br />

Upon successful completion a non-negative integer, namely the file<br />

descriptor, is returned. Otherwise, a value of -1 is returned and<br />

errno is set to indicate the error.<br />

SEE ALSO<br />

creat(2), close(2), exec(2), fcnt1(2), open(2), pipe(2).<br />

- 1 -

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!