fileno.c 283 B

12345678910111213
  1. #include "stdio_impl.h"
  2. int fileno(FILE *f)
  3. {
  4. /* f->fd never changes, but the lock must be obtained and released
  5. * anyway since this function cannot return while another thread
  6. * holds the lock. */
  7. FLOCK(f);
  8. FUNLOCK(f);
  9. return f->fd;
  10. }
  11. weak_alias(fileno, fileno_unlocked);