Exemple #1
0
int fgetpos(FILE *f, fpos_t *pos)
{
	off_t off = __ftello(f);
	if (off < 0) return -1;
	*(off_t *)pos = off;
	return 0;
}
Exemple #2
0
long ftell(FILE *f)
{
    off_t pos = __ftello(f);
    if (pos > LONG_MAX) {
        errno = EOVERFLOW;
        return -1;
    }
    return pos;
}
Exemple #3
0
#include "stdio_impl.h"

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