1 // 2 // fileno.cpp 3 // 4 // Copyright (c) Microsoft Corporation. All rights reserved. 5 // 6 // Defines _fileno(), which returns the lowio file handle for the given stdio 7 // stream. 8 // 9 #include <corecrt_internal_stdio.h> 10 11 12 13 extern "C" int __cdecl _fileno(FILE* const public_stream) 14 { 15 __crt_stdio_stream const stream(public_stream); 16 17 _VALIDATE_RETURN(stream.valid(), EINVAL, -1); 18 return stream.lowio_handle(); 19 } 20