/contrib/sdk/sources/newlib/libc/stdio/fileno.c |
---|
47,6 → 47,7 |
#include <_ansi.h> |
#include <stdio.h> |
#include <errno.h> |
#include "local.h" |
int |
55,8 → 56,14 |
{ |
int result; |
CHECK_INIT (_REENT, f); |
_flockfile (f); |
_newlib_flockfile_start (f); |
if (f->_flags) |
result = __sfileno (f); |
_funlockfile (f); |
else |
{ |
result = -1; |
_REENT->_errno = EBADF; |
} |
_newlib_flockfile_end (f); |
return result; |
} |