Added missing properties.
[AROS.git] / compiler / clib / fgetpos.c
blobe6c0488ac6629df5843b8b9dd33a19add40954fa
1 /*
2 Copyright © 1995-2012, The AROS Development Team. All rights reserved.
3 $Id$
5 Get the position in a stream.
6 */
8 #include <errno.h>
10 /*****************************************************************************
12 NAME */
13 #include <stdio.h>
15 int fgetpos (
17 /* SYNOPSIS */
18 FILE * stream,
19 fpos_t * pos)
21 /* FUNCTION
22 Get the current position in a stream. This function is eqivalent
23 to ftell(). However, on some systems fpos_t may be a complex
24 structure, so this routine may be the only way to portably
25 get the position of a stream.
27 INPUTS
28 stream - The stream to get the position from.
29 pos - Pointer to the fpos_t position structure to fill.
31 RESULT
32 0 on success and -1 on error. If an error occurred, the global
33 variable errno is set.
35 NOTES
37 EXAMPLE
39 BUGS
41 SEE ALSO
42 fsetpos()
44 INTERNALS
46 ******************************************************************************/
48 if ( pos == NULL )
50 errno = EINVAL;
51 return -1;
54 *pos = ftell (stream);
56 if ( *pos < 0L )
58 return -1;
61 return 0;
62 } /* fgetpos */