posixc.library: use vfork_jmp consistenty to exit __vfork
[AROS.git] / compiler / posixc / fileno.c
blobfa3e90287253c104678410f8016d4d046468808e
1 /*
2 Copyright © 1995-2012, The AROS Development Team. All rights reserved.
3 $Id$
5 POSIX.1-2008 function fileno().
6 */
8 #include <errno.h>
9 #include "__stdio.h"
11 /*****************************************************************************
13 NAME */
14 #include <stdio.h>
16 int fileno (
18 /* SYNOPSIS */
19 FILE *stream)
21 /* FUNCTION
22 Returns the descriptor associated with the stream
24 INPUTS
25 strem - the stream to get the descriptor from
27 RESULT
28 The integer descriptor
30 NOTES
32 EXAMPLE
34 BUGS
36 SEE ALSO
37 open()
39 INTERNALS
41 ******************************************************************************/
43 if (!stream) /* safety check */
45 errno = EFAULT;
46 return -1;
48 return stream->fd;