Index: acconfig.h
===================================================================
RCS file: /usr/local/src/security/openssh/cvs/openssh_cvs/acconfig.h,v
retrieving revision 1.180
diff -u -p -r1.180 acconfig.h
--- acconfig.h	16 Aug 2004 13:12:06 -0000	1.180
+++ acconfig.h	29 Aug 2004 05:49:24 -0000
@@ -460,6 +460,9 @@
 /* Define if you have /proc/$pid/fd */
 #undef HAVE_PROC_PID
 
+/* Define if you dup() is broken but fcntl(fd, F_DUPFD, 0) works */
+#undef USE_FCNTL_FOR_DUP
+
 @BOTTOM@
 
 /* ******************* Shouldn't need to edit below this line ************** */
Index: configure.ac
===================================================================
RCS file: /usr/local/src/security/openssh/cvs/openssh_cvs/configure.ac,v
retrieving revision 1.226
diff -u -p -r1.226 configure.ac
--- configure.ac	16 Aug 2004 13:12:06 -0000	1.226
+++ configure.ac	29 Aug 2004 05:48:31 -0000
@@ -342,6 +342,7 @@ mips-sony-bsd|mips-sony-newsos4)
 	AC_DEFINE(BROKEN_SETREUID)
 	AC_DEFINE(BROKEN_SETREGID)
 	AC_DEFINE(SSHD_ACQUIRES_CTTY)
+	AC_DEFINE(USE_FCNTL_FOR_DUP)
 	external_path_file=/etc/default/login
 	# /usr/ucblib/libucb.a no longer needed on ReliantUNIX
 	# Attention: always take care to bind libsocket and libnsl before libc,
Index: defines.h
===================================================================
RCS file: /usr/local/src/security/openssh/cvs/openssh_cvs/defines.h,v
retrieving revision 1.117
diff -u -p -r1.117 defines.h
--- defines.h	22 Jun 2004 03:27:16 -0000	1.117
+++ defines.h	29 Aug 2004 05:50:56 -0000
@@ -558,6 +558,10 @@ struct winsize {
 # define SSH_SYSFDMAX 10000
 #endif
 
+/* Some platform (eg Reliant Unix) have a broken dup() */
+#ifdef USE_FCNTL_FOR_DUP
+# define dup(fd) (fcntl(fd, F_DUPFD, 0))
+#endif
 
 /*
  * Define this to use pipes instead of socketpairs for communicating with the
