diff options
author | Adam <you@example.com> | 2020-05-17 05:51:50 +0200 |
---|---|---|
committer | Adam <you@example.com> | 2020-05-17 05:51:50 +0200 |
commit | e611b132f9b8abe35b362e5870b74bce94a1e58e (patch) | |
tree | a5781d2ec0e085eeca33cf350cf878f2efea6fe5 /private/crt32/stdio/fileno.c | |
download | NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.gz NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.bz2 NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.lz NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.xz NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.zst NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.zip |
Diffstat (limited to 'private/crt32/stdio/fileno.c')
-rw-r--r-- | private/crt32/stdio/fileno.c | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/private/crt32/stdio/fileno.c b/private/crt32/stdio/fileno.c new file mode 100644 index 000000000..45b1e25e5 --- /dev/null +++ b/private/crt32/stdio/fileno.c @@ -0,0 +1,50 @@ +/*** +*fileno.c - defines _fileno() +* +* Copyright (c) 1989-1991, Microsoft Corporation. All rights reserved. +* +*Purpose: +* Defines fileno() - return the file handle for the specified stream +* +*Revision History: +* 03-13-89 GJF Module created +* 03-27-89 GJF Moved to 386 tree +* 02-15-90 GJF _file is now an int. Also, fixed copyright. +* 03-19-90 GJF Made calling type _CALLTYPE1 and added #include +* <cruntime.h>. +* 10-02-90 GJF New-style function declarator. +* 01-21-91 GJF ANSI naming. +* +*******************************************************************************/ + +#include <cruntime.h> +#include <stdio.h> + +/* remove macro definition for fileno() + */ +#undef _fileno + +/*** +*int _fileno(stream) - return the file handle for stream +* +*Purpose: +* Returns the file handle for the given stream is. Normally fileno() +* is a macro, but it is also available as a true function (for +* consistency with ANSI, though it is not required). +* +*Entry: +* FILE *stream - stream to fetch handle for +* +*Exit: +* returns the file handle for the given stream +* +*Exceptions: +* +*******************************************************************************/ + +int _CALLTYPE1 _fileno ( + FILE *stream + ) +{ + return( stream->_file ); +} |