blob: ba7f9391b1ec9baa6023f9a66f569b46a1f85ba2 [file] [log] [blame]
Rich Felker0b44a032011-02-12 00:22:29 -05001#include "stdio_impl.h"
2
3int fileno(FILE *f)
4{
Rich Felkerc8cb6bc2012-10-24 23:16:41 -04005 /* f->fd never changes, but the lock must be obtained and released
6 * anyway since this function cannot return while another thread
7 * holds the lock. */
8 FLOCK(f);
9 FUNLOCK(f);
Rich Felker0b44a032011-02-12 00:22:29 -050010 return f->fd;
11}
12
13weak_alias(fileno, fileno_unlocked);