binary-io.c 1022 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. /* Binary mode I/O.
  2. Copyright 2017 Free Software Foundation, Inc.
  3. This program is free software: you can redistribute it and/or modify
  4. it under the terms of the GNU General Public License as published by
  5. the Free Software Foundation; either version 3 of the License, or
  6. (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program. If not, see <http://www.gnu.org/licenses/>. */
  13. #include <config.h>
  14. #define BINARY_IO_INLINE _GL_EXTERN_INLINE
  15. #include "binary-io.h"
  16. #if defined __DJGPP__ || defined __EMX__
  17. # include <errno.h>
  18. # include <unistd.h>
  19. int
  20. __gl_setmode_check (int fd)
  21. {
  22. if (isatty (fd))
  23. {
  24. errno = EINVAL;
  25. return -1;
  26. }
  27. else
  28. return 0;
  29. }
  30. #endif