summaryrefslogtreecommitdiffstats
path: root/mdk-stage1/dietlibc/lib/lseek64.c
blob: 62acf4a2bb655db7d4c2be6ff4359cfce0ef4862 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <errno.h>
#include "dietfeatures.h"

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

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