]> gcc.gnu.org Git - gcc.git/commitdiff
entered into RCS
authorRichard Stallman <rms@gnu.org>
Tue, 28 Jul 1992 02:18:03 +0000 (02:18 +0000)
committerRichard Stallman <rms@gnu.org>
Tue, 28 Jul 1992 02:18:03 +0000 (02:18 +0000)
From-SVN: r1697

gcc/collect2.c

index 5915cf079bbd46fd544a7303805121ad38fc330c..532f1824b08b96a92d373edb6a709b23d7aea42f 100644 (file)
@@ -206,6 +206,25 @@ generic *xmalloc ();
 extern char *index ();
 extern char *rindex ();
 \f
+#ifdef NO_DUP2
+dup2 (oldfd, newfd)
+     int oldfd;
+     int newfd;
+{
+  int fdtmp[256];
+  int fdx = 0;
+  int fd;
+  if (oldfd == newfd)
+    return 0;
+  close (newfd);
+  while ((fd = dup (oldfd)) != newfd) /* good enough for low fd's */
+    fdtmp[fdx++] = fd;
+  while (fdx > 0)
+    close (fdtmp[--fdx]);
+}
+#endif
+
 char *
 my_strerror (e)
      int e;
This page took 0.060868 seconds and 5 git commands to generate.