Back to index

glibc  2.9
Functions
dup3.c File Reference
#include <errno.h>
#include <fcntl.h>
#include <unistd.h>
#include <stub-tag.h>

Go to the source code of this file.

Functions

int dup3 (int fd, int fd2, int flags)

Function Documentation

int dup3 ( int  fd,
int  fd2,
int  flags 
)

Definition at line 28 of file dup3.c.

{
  if (fd < 0 || fd2 < 0)
    {
      __set_errno (EBADF);
      return -1;
    }

  if (fd == fd2)
    /* No way to check that they are valid.  */
    return fd2;

  __set_errno (ENOSYS);
  return -1;
}