diff options
| author | Tim J. Robbins <tjr@FreeBSD.org> | 2003-01-13 02:58:18 +0000 |
|---|---|---|
| committer | Tim J. Robbins <tjr@FreeBSD.org> | 2003-01-13 02:58:18 +0000 |
| commit | 2c19171bc113241ee7c630c9ab46d2e95c18c942 (patch) | |
| tree | 409fb180fd40239aceb5e57cc2dd6eb80e8d67e5 /lib/libc | |
| parent | 83bb3b49797d527f778fa7ea9d7eb4aa27d6bdd5 (diff) | |
Notes
Diffstat (limited to 'lib/libc')
| -rw-r--r-- | lib/libc/stdio/fileno.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/libc/stdio/fileno.c b/lib/libc/stdio/fileno.c index 97f25e37a333..d7bf93deeaa9 100644 --- a/lib/libc/stdio/fileno.c +++ b/lib/libc/stdio/fileno.c @@ -40,7 +40,10 @@ static char sccsid[] = "@(#)fileno.c 8.1 (Berkeley) 6/4/93"; #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); +#include "namespace.h" #include <stdio.h> +#include "un-namespace.h" +#include "libc_private.h" /* * fileno has traditionally been a macro in <stdio.h>. That is @@ -51,6 +54,11 @@ __FBSDID("$FreeBSD$"); int fileno(FILE *fp) { - /* ??? - Should probably use atomic_read. */ - return (__sfileno(fp)); + int fd; + + FLOCKFILE(fp); + fd = __sfileno(fp); + FUNLOCKFILE(fp); + + return (fd); } |
