summaryrefslogtreecommitdiffstats
path: root/c/src/exec/libcsupport/src/dup.c
diff options
context:
space:
mode:
Diffstat (limited to 'c/src/exec/libcsupport/src/dup.c')
-rw-r--r--c/src/exec/libcsupport/src/dup.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/c/src/exec/libcsupport/src/dup.c b/c/src/exec/libcsupport/src/dup.c
new file mode 100644
index 0000000000..c17db588a7
--- /dev/null
+++ b/c/src/exec/libcsupport/src/dup.c
@@ -0,0 +1,23 @@
+/*
+ * dup() - POSIX 1003.1b 6.2.1 Duplicate an Open File Descriptor
+ *
+ * COPYRIGHT (c) 1989-1998.
+ * On-Line Applications Research Corporation (OAR).
+ * Copyright assigned to U.S. Government, 1994.
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.OARcorp.com/rtems/license.html.
+ *
+ * $Id$
+ */
+
+#include <unistd.h>
+#include <fcntl.h>
+
+int dup(
+ int fildes
+)
+{
+ return fcntl( fildes, F_DUPFD, 0 );
+}