| int __fseeko_unlocked(FILE* f, off_t off, int whence) { |
| /* Adjust relative offset for unread data in buffer, if any. */ |
| off -= f->rend - f->rpos; |
| /* Flush write buffer, and report error on failure. */ |
| if (f->wpos > f->wbase) { |
| f->wpos = f->wbase = f->wend = 0; |
| /* Perform the underlying seek. */ |
| if (f->seek(f, off, whence) < 0) |
| /* If seek succeeded, file is seekable and we discard read buffer. */ |
| int __fseeko(FILE* f, off_t off, int whence) { |
| result = __fseeko_unlocked(f, off, whence); |
| int fseek(FILE* f, long off, int whence) { |
| return __fseeko(f, off, whence); |
| weak_alias(__fseeko, fseeko); |
| weak_alias(__fseeko, fseeko64); |