Loading...
stdio/FreeBSD/fdopen.c Libc-763.13 Libc-1669.40.2
--- Libc/Libc-763.13/stdio/FreeBSD/fdopen.c
+++ Libc/Libc-1669.40.2/stdio/FreeBSD/fdopen.c
@@ -30,6 +30,15 @@
  * SUCH DAMAGE.
  */
 
+#ifdef VARIANT_DARWINEXTSN
+#define _DARWIN_UNLIMITED_STREAMS
+#define COUNT	0
+#elif defined(VARIANT_LEGACY)
+#define COUNT	0
+#else
+#define COUNT	1
+#endif
+
 #if defined(LIBC_SCCS) && !defined(lint)
 static char sccsid[] = "@(#)fdopen.c	8.1 (Berkeley) 6/4/93";
 #endif /* LIBC_SCCS and not lint */
@@ -45,14 +54,15 @@
 #include <limits.h>
 #include "un-namespace.h"
 #include "local.h"
+#include "libc_hooks_impl.h"
 
 FILE *
-fdopen(fd, mode)
-	int fd;
-	const char *mode;
+fdopen(int fd, const char *mode)
 {
 	FILE *fp;
 	int flags, oflags, fdflags, tmp;
+
+	libc_hooks_will_read_cstring(mode);
 
 	/*
 	 * File descriptors are a full int, but _file is only a short.
@@ -78,7 +88,7 @@
 		return (NULL);
 	}
 
-	if ((fp = __sfp()) == NULL)
+	if ((fp = __sfp(COUNT)) == NULL)
 		return (NULL);
 	fp->_flags = flags;
 	/*