xref: /aosp_15_r20/external/musl/src/stdio/fgetpos.c (revision c9945492fdd68bbe62686c5b452b4dc1be3f8453)
1*c9945492SAndroid Build Coastguard Worker #include "stdio_impl.h"
2*c9945492SAndroid Build Coastguard Worker 
fgetpos(FILE * restrict f,fpos_t * restrict pos)3*c9945492SAndroid Build Coastguard Worker int fgetpos(FILE *restrict f, fpos_t *restrict pos)
4*c9945492SAndroid Build Coastguard Worker {
5*c9945492SAndroid Build Coastguard Worker 	off_t off = __ftello(f);
6*c9945492SAndroid Build Coastguard Worker 	if (off < 0) return -1;
7*c9945492SAndroid Build Coastguard Worker 	*(long long *)pos = off;
8*c9945492SAndroid Build Coastguard Worker 	return 0;
9*c9945492SAndroid Build Coastguard Worker }
10