On Thu, Apr 26, 2012 at 10:18:11AM -0400, Mark Salter wrote:
> +#ifdef __NR_dup2
>  _syscall2(int, dup2, int, oldfd, int, newfd)
> +#elif defined __NR_dup3
> +#include <fcntl.h>
> +
> +int
> +dup2 (int fd, int fd2)
> +{
> +     /* For the degenerate case, check if the fd is valid (by trying to
> +        get the file status flags) and return it, or else return EBADF.  */
> +     if (fd == fd2)
> +             return __libc_fcntl(fd, F_GETFL, 0) < 0 ? -1 : fd;

Is there a reason this special case is necessary? Not questioning it,
I just want to know.

Rich
_______________________________________________
uClibc mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/uclibc

Reply via email to