summaryrefslogtreecommitdiff
path: root/src/stdio/fgetpos.c
blob: 6b45f57f38a540eda6a0f65b85bc341a77e50f68 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
#include "stdio_impl.h"
#include "libc.h"

int fgetpos(FILE *restrict f, fpos_t *restrict pos)
{
	off_t off = __ftello(f);
	if (off < 0) return -1;
	*(long long *)pos = off;
	return 0;
}

LFS64(fgetpos);