I assume you're getting a warning only in Visual Studio about this as _fileno() doesn't exist anywhere else except in VC++'s headers. This change isn't acceptable. Define `_CRT_SECURE_NO_WARNINGS` in your compiler's preprocessor settings to disable that non-sense.