aboutsummaryrefslogtreecommitdiff
path: root/lib/libc/stdio/fileno.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/stdio/fileno.c')
-rw-r--r--lib/libc/stdio/fileno.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/libc/stdio/fileno.c b/lib/libc/stdio/fileno.c
index 0c3a8dc0c612..b8f500e05ab8 100644
--- a/lib/libc/stdio/fileno.c
+++ b/lib/libc/stdio/fileno.c
@@ -45,13 +45,14 @@ static const char rcsid[] =
#include <stdio.h>
/*
- * A subroutine version of the macro fileno.
+ * fileno has traditionally been a macro in <stdio.h>. That is
+ * no longer true because it needs to be thread-safe.
+ *
+ * #undef fileno
*/
-#undef fileno
-
int
-fileno(fp)
- FILE *fp;
+fileno(FILE *fp)
{
+ /* ??? - Should probably use atomic_read. */
return (__sfileno(fp));
}