Subversion Repositories Kolibri OS

Rev

Rev 4872 | Rev 4921 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

  1. /* Reentrant versions of isatty system call.  */
  2.  
  3. #include <reent.h>
  4. #include <unistd.h>
  5. #include <_syslist.h>
  6. #include <errno.h>
  7.  
  8. /* Some targets provides their own versions of these functions.  Those
  9.    targets should define REENTRANT_SYSCALLS_PROVIDED in TARGET_CFLAGS.  */
  10.  
  11. #ifdef _REENT_ONLY
  12. #ifndef REENTRANT_SYSCALLS_PROVIDED
  13. #define REENTRANT_SYSCALLS_PROVIDED
  14. #endif
  15. #endif
  16.  
  17. #ifdef REENTRANT_SYSCALLS_PROVIDED
  18.  
  19. int _dummy_isatty_syscalls = 1;
  20.  
  21. #else
  22.  
  23. /* We use the errno variable used by the system dependent layer.  */
  24. #undef errno
  25. extern int errno;
  26.  
  27. /*
  28. FUNCTION
  29.         <<_isatty_r>>---Reentrant version of isatty
  30.  
  31. INDEX
  32.         _isatty_r
  33.  
  34. ANSI_SYNOPSIS
  35.         #include <reent.h>
  36.         int _isatty_r(struct _reent *<[ptr]>,
  37.                      int <[fd]>);
  38.  
  39. TRAD_SYNOPSIS
  40.         #include <reent.h>
  41.         int _isatty_r(<[ptr]>, <[fd]>)
  42.         struct _reent *<[ptr]>;
  43.         int <[fd]>;
  44.  
  45. DESCRIPTION
  46.         This is a reentrant version of <<isatty>>.  It
  47.         takes a pointer to the global data block, which holds
  48.         <<errno>>.
  49. */
  50.  
  51. int
  52. _isatty_r (ptr, fd)
  53.      struct _reent *ptr;
  54.      int fd;
  55. {
  56.   int ret;
  57.  
  58.   ptr->_errno = ENOTTY ;
  59.   return 0;
  60. }
  61.  
  62. #endif /* ! defined (REENTRANT_SYSCALLS_PROVIDED) */
  63.