Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/fcntl.cc')
-rw-r--r--winsup/cygwin/fcntl.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/winsup/cygwin/fcntl.cc b/winsup/cygwin/fcntl.cc
index 78ce36569..de13f10bf 100644
--- a/winsup/cygwin/fcntl.cc
+++ b/winsup/cygwin/fcntl.cc
@@ -1,7 +1,7 @@
/* fcntl.cc: fcntl syscall
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2008,
- 2009 Red Hat, Inc.
+ 2009, 2010 Red Hat, Inc.
This file is part of Cygwin.
@@ -41,8 +41,10 @@ fcntl64 (int fd, int cmd, ...)
switch (cmd)
{
case F_DUPFD:
+ case F_DUPFD_CLOEXEC:
if ((int) arg >= 0 && (int) arg < OPEN_MAX_MAX)
- res = dup2 (fd, cygheap_fdnew (((int) arg) - 1));
+ res = dup3 (fd, cygheap_fdnew (((int) arg) - 1),
+ cmd == F_DUPFD_CLOEXEC ? O_CLOEXEC : 0);
else
{
set_errno (EINVAL);