-/* Copyright (C) 1991, 1992 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1992, 1993, 1995 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
#include <ansidecl.h>
#include <errno.h>
#include <fcntl.h>
+#include <limits.h>
#include <unistd.h>
{
int save;
- if (fd2 < 0)
+ if (fd2 < 0
+#ifdef OPEN_MAX
+ || fd2 >= OPEN_MAX
+#endif
+)
{
errno = EBADF;
return -1;
return fcntl (fd, F_DUPFD, fd2);
}
+
+weak_alias (__dup2, dup2)