summaryrefslogtreecommitdiffstats
path: root/mdk-stage1/dietlibc/lib/lseek64.c
blob: f39e779f9b2f81d8f7309e7ab356cea1b18d2224 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include "dietfeatures.h"

#ifdef WANT_LARGEFILE_BACKCOMPAT
#include <sys/stat.h>
#ifndef __NO_STAT64
#include <errno.h>
#include <unistd.h>

loff_t lseek64(int fildes, loff_t offset, int whence) {
  loff_t tmp;
  if (llseek(fildes,offset>>32,offset&0xffffffff,&tmp,whence)) {
#ifdef WANT_THREAD_SAFE
    if (*__errno_location()!=ENOSYS) return -1;
#else
    if (errno!=ENOSYS) return -1;
#endif
    return (loff_t)lseek(fildes,(off_t)offset,whence);
  }
  return tmp;
}
#endif
#endif