summaryrefslogtreecommitdiff
path: root/lib/libc/stdio/ftell.c
blob: c28fe143afe0eb9e88b31112c068eb32cafd602a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include <stdio.h>
#include <limits.h>
#include <errno.h>

long ftell(FILE *stream)
{
	off_t pos;

	if ((pos = ftello(stream)) > LONG_MAX) {
		errno = EOVERFLOW;
		return -1;
	}

	return pos;
}