#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
/* Native Woe32 API. */
+# include <string.h>
+
/* Get declarations of the Win32 API functions. */
# define WIN32_LEAN_AND_MEAN
# include <windows.h>
if (!(result < 0 && errno == ENOSYS))
{
have_dup3_really = 1;
+#if REPLACE_FCHDIR
+ if (0 <= result)
+ result = _gl_register_dup (oldfd, newfd);
+#endif
return result;
}
have_dup3_really = -1;
errno = saved_errno;
}
+#if REPLACE_FCHDIR
+ if (result == newfd)
+ result = _gl_register_dup (oldfd, newfd);
+#endif
return result;
}
setmode (newfd, O_TEXT);
#endif
+#if REPLACE_FCHDIR
+ newfd = _gl_register_dup (oldfd, newfd);
+#endif
return newfd;
}