Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Commit

Permalink
Merge pull request #310 from jpf91/lfs
Browse files Browse the repository at this point in the history
Some large file support enhancements
  • Loading branch information
alexrp committed Jan 12, 2013
2 parents 73ce4e1 + 830e077 commit 478450a
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/core/sys/posix/dirent.d
Expand Up @@ -69,7 +69,7 @@ version( linux )
// Managed by OS
}

static if( __USE_LARGEFILE64 )
static if( __USE_FILE_OFFSET64 )
{
dirent* readdir64(DIR*);
alias readdir64 readdir;
Expand Down
2 changes: 1 addition & 1 deletion src/core/sys/posix/fcntl.d
Expand Up @@ -126,7 +126,7 @@ version( linux )
pid_t l_pid;
}

static if( __USE_LARGEFILE64 )
static if( __USE_FILE_OFFSET64 )
{
int creat64(in char*, mode_t);
alias creat64 creat;
Expand Down
12 changes: 8 additions & 4 deletions src/core/sys/posix/stdio.d
Expand Up @@ -95,7 +95,12 @@ int vsscanf(in char*, in char*, va_list arg);

version( linux )
{
static if( __USE_LARGEFILE64 )
/*
* actually, if __USE_FILE_OFFSET64 && !_LARGEFILE64_SOURCE
* the *64 functions shouldn't be visible, but the aliases should
* still be supported
*/
static if( __USE_FILE_OFFSET64 )
{
int fgetpos64(FILE*, fpos_t *);
alias fgetpos64 fgetpos;
Expand All @@ -106,8 +111,7 @@ version( linux )
FILE* freopen64(in char*, in char*, FILE*);
alias freopen64 freopen;

int fseek64(FILE*, c_long, int);
alias fseek64 fseek;
int fseek(FILE*, c_long, int);

int fsetpos64(FILE*, in fpos_t*);
alias fsetpos64 fsetpos;
Expand Down Expand Up @@ -156,7 +160,7 @@ version( linux )
int fseeko(FILE*, off_t, int);
}

static if( __USE_LARGEFILE64 )
static if( __USE_FILE_OFFSET64 )
{
off_t ftello64(FILE*);
alias ftello64 ftello;
Expand Down
2 changes: 1 addition & 1 deletion src/core/sys/posix/sys/mman.d
Expand Up @@ -132,7 +132,7 @@ version( linux )
//void* mmap(void*, size_t, int, int, int, off_t);
int munmap(void*, size_t);

static if( __USE_LARGEFILE64 )
static if( __USE_FILE_OFFSET64 )
{
void* mmap64(void*, size_t, int, int, int, off_t);
alias mmap64 mmap;
Expand Down
15 changes: 13 additions & 2 deletions src/core/sys/posix/sys/statvfs.d
Expand Up @@ -93,5 +93,16 @@ else
}
}

int statvfs (const char * file, statvfs_t* buf);
int fstatvfs (int fildes, statvfs_t *buf);
static if( __USE_FILE_OFFSET64 )
{
int statvfs64 (const char * file, statvfs_t* buf);
alias statvfs64 statvfs;

int fstatvfs64 (int fildes, statvfs_t *buf);
alias fstatvfs64 fstatvfs;
}
else
{
int statvfs (const char * file, statvfs_t* buf);
int fstatvfs (int fildes, statvfs_t *buf);
}
2 changes: 1 addition & 1 deletion src/core/sys/posix/unistd.d
Expand Up @@ -548,7 +548,7 @@ version( linux )
int usleep(useconds_t);
pid_t vfork();

static if( __USE_LARGEFILE64 )
static if( __USE_FILE_OFFSET64 )
{
int lockf64(int, int, off_t);
alias lockf64 lockf;
Expand Down

0 comments on commit 478450a

Please sign in to comment.