mirror of
https://github.com/reactos/reactos.git
synced 2025-06-03 08:20:27 +00:00

Imported from https://www.nuget.org/packages/Microsoft.Windows.SDK.CRTSource/10.0.22621.3 License: MIT
20 lines
575 B
C++
20 lines
575 B
C++
//
|
|
// isatty.cpp
|
|
//
|
|
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
//
|
|
// Defines _isatty(), which tests whether a file refers to a character device.
|
|
//
|
|
#include <corecrt_internal_lowio.h>
|
|
|
|
|
|
|
|
// Tests if the given file refers to a character device (e.g. terminal, console,
|
|
// printer, serial port, etc.). Returns nonzero if so; zero if not.
|
|
extern "C" int __cdecl _isatty(int const fh)
|
|
{
|
|
_CHECK_FH_RETURN(fh, EBADF, 0);
|
|
_VALIDATE_RETURN((fh >= 0 && (unsigned)fh < (unsigned)_nhandle), EBADF, 0);
|
|
|
|
return static_cast<int>(_osfile(fh) & FDEV);
|
|
}
|