ReactOS
0.4.16-dev-1946-g52006dd
isatty.cpp
Go to the documentation of this file.
1
//
2
// isatty.cpp
3
//
4
// Copyright (c) Microsoft Corporation. All rights reserved.
5
//
6
// Defines _isatty(), which tests whether a file refers to a character device.
7
//
8
#include <
corecrt_internal_lowio.h
>
9
10
11
12
// Tests if the given file refers to a character device (e.g. terminal, console,
13
// printer, serial port, etc.). Returns nonzero if so; zero if not.
14
extern
"C"
int
__cdecl
_isatty
(
int
const
fh)
15
{
16
_CHECK_FH_RETURN
(fh,
EBADF
, 0);
17
_VALIDATE_RETURN
((fh >= 0 && (
unsigned
)fh < (
unsigned
)
_nhandle
),
EBADF
, 0);
18
19
return
static_cast<
int
>
(
_osfile
(fh) &
FDEV
);
20
}
EBADF
#define EBADF
Definition:
acclib.h:82
__cdecl
#define __cdecl
Definition:
accygwin.h:79
_CHECK_FH_RETURN
#define _CHECK_FH_RETURN(handle, errorcode, retexpr)
Definition:
corecrt_internal.h:1730
corecrt_internal_lowio.h
_nhandle
int _nhandle
Definition:
ioinit.cpp:34
FDEV
@ FDEV
Definition:
corecrt_internal_lowio.h:85
_VALIDATE_RETURN
#define _VALIDATE_RETURN(expr, errorcode, retexpr)
Definition:
corecrt_internal_strtox.h:38
_isatty
int __cdecl _isatty(int const fh)
Definition:
isatty.cpp:14
_osfile
#define _osfile(i)
Definition:
internal.h:72
sdk
lib
ucrt
lowio
isatty.cpp
Generated on Thu Dec 4 2025 06:16:20 for ReactOS by
1.9.6