Small cleanup of extensions code
[AROS.git] / compiler / clib / fileno.c
blob218699a4d8cf62aac6c1a3abb8e47d4ebe703279
1 /*
2 Copyright © 1995-2003, The AROS Development Team. All rights reserved.
3 $Id$
5 ANSI C function fileno().
6 */
8 #include <errno.h>
10 /*****************************************************************************
12 NAME */
13 #include <stdio.h>
15 int fileno (
17 /* SYNOPSIS */
18 FILE *stream)
20 /* FUNCTION
21 Returns the descriptor associated with the stream
23 INPUTS
24 strem - the stream to get the descriptor from
26 RESULT
27 The integer descriptor
29 NOTES
31 EXAMPLE
33 BUGS
35 SEE ALSO
36 open()
38 INTERNALS
40 ******************************************************************************/
42 if (!stream) /* safety check */
44 errno = EFAULT;
45 return -1;
47 return stream->fd;