fstat.c 248 B

12345678910111213141516
  1. /* See LICENSE of license details. */
  2. #include <errno.h>
  3. #include <unistd.h>
  4. #include <sys/stat.h>
  5. #include "stub.h"
  6. int _fstat(int fd, struct stat* st)
  7. {
  8. if (isatty(fd)) {
  9. st->st_mode = S_IFCHR;
  10. return 0;
  11. }
  12. return _stub(EBADF);
  13. }