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 #859 from jasonbking/lf64
Browse files Browse the repository at this point in the history
Multiple Solaris fixes
  • Loading branch information
WalterBright committed Jul 4, 2014
2 parents b48fd52 + fbbd1ba commit f1c9e11
Show file tree
Hide file tree
Showing 4 changed files with 463 additions and 33 deletions.
57 changes: 47 additions & 10 deletions src/core/sys/posix/fcntl.d
Expand Up @@ -363,17 +363,26 @@ else version (Solaris)
enum F_GETFL = 3;
enum F_SETFL = 4;

static if (__USE_FILE_OFFSET64)
version (D_LP64)
{
enum F_GETLK = 14;
enum F_SETLK = 6;
enum F_SETLKW = 7;
}
else
{
enum F_GETLK = 33;
enum F_SETLK = 34;
enum F_SETLKW = 35;
static if (__USE_FILE_OFFSET64)
{
enum F_GETLK = 14;
enum F_SETLK = 6;
enum F_SETLKW = 7;
}
else
{
enum F_GETLK = 33;
enum F_SETLK = 34;
enum F_SETLKW = 35;
}
}

enum F_GETOWN = 23;
Expand Down Expand Up @@ -417,16 +426,44 @@ else version (Solaris)

static if (__USE_LARGEFILE64)
{
int creat64(in char*, mode_t);
alias creat64 creat;

int open64(in char*, int, ...);
alias open64 open;
struct flock64
{
short l_type;
short l_whence;
off64_t l_start;
off64_t l_len;
int l_sysid;
pid_t l_pid;
c_long[4] l_pad;
}
}
else

version (D_LP64)
{
int creat(in char*, mode_t);
int open(in char*, int, ...);

static if (__USE_LARGEFILE64)
{
alias creat creat64;
alias open open64;
}
}
else
{
static if (__USE_LARGEFILE64)
{
int creat64(in char*, mode_t);
alias creat64 creat;

int open64(in char*, int, ...);
alias open64 open;
}
else
{
int creat(in char*, mode_t);
int open(in char*, int, ...);
}
}
}
else version( Android )
Expand Down
25 changes: 20 additions & 5 deletions src/core/sys/posix/signal.d
Expand Up @@ -108,14 +108,26 @@ version( Posix )
void* sival_ptr;
}

private extern (C) nothrow @nogc
version( Solaris )
{
int __libc_current_sigrtmin();
int __libc_current_sigrtmax();
import core.sys.posix.unistd;
private int _sigrtmin() { return cast(int) sysconf(_SC_SIGRT_MIN); }
private int _sigrtmax() { return cast(int) sysconf(_SC_SIGRT_MAX); }

alias _sigrtmin SIGRTMIN;
alias _sigrtmax SIGRTMAX;
}
else
{
private extern (C) nothrow @nogc
{
int __libc_current_sigrtmin();
int __libc_current_sigrtmax();
}

alias __libc_current_sigrtmin SIGRTMIN;
alias __libc_current_sigrtmax SIGRTMAX;
alias __libc_current_sigrtmin SIGRTMIN;
alias __libc_current_sigrtmax SIGRTMAX;
}
}

version( linux )
Expand Down Expand Up @@ -437,6 +449,9 @@ else version (Solaris)
}

sigset_t sa_mask;
version (D_LP64) {}
else
int[2] sa_resv;
}
}
else version (Android)
Expand Down
57 changes: 39 additions & 18 deletions src/core/sys/posix/sys/stat.d
Expand Up @@ -725,7 +725,7 @@ else version (Solaris)

version (D_LP64)
{
struct stat64_t
struct stat_t
{
dev_t st_dev;
ino_t st_ino;
Expand All @@ -743,7 +743,7 @@ else version (Solaris)
char[_ST_FSTYPSZ] st_fstype;
}

alias stat64_t stat32_t;
static if (__USE_LARGEFILE64) alias stat_t stat64_t;
}
else
{
Expand Down Expand Up @@ -790,12 +790,13 @@ else version (Solaris)
char[_ST_FSTYPSZ] st_fstype;
c_long[8] st_pad4;
}
}

static if (__USE_FILE_OFFSET64)
alias stat64_t stat_t;
else
alias stat32_t stat_t;
static if (__USE_FILE_OFFSET64)
alias stat64_t stat_t;
else
alias stat32_t stat_t;

}

enum S_IRUSR = 0x100;
enum S_IWUSR = 0x080;
Expand Down Expand Up @@ -831,6 +832,8 @@ else version (Solaris)
extern (D) bool S_ISREG(mode_t mode) { return S_ISTYPE(mode, S_IFREG); }
extern (D) bool S_ISLNK(mode_t mode) { return S_ISTYPE(mode, S_IFLNK); }
extern (D) bool S_ISSOCK(mode_t mode) { return S_ISTYPE(mode, S_IFSOCK); }
extern (D) bool S_ISDOOR(mode_t mode) { return S_ISTYPE(mode, S_IFDOOR); }
extern (D) bool S_ISPORT(mode_t mode) { return S_ISTYPE(mode, S_IFPORT); }
}
else version( Android )
{
Expand Down Expand Up @@ -936,22 +939,38 @@ version( linux )
}
else version (Solaris)
{
static if (__USE_LARGEFILE64)
version (D_LP64)
{
int fstat64(int, stat_t*);
alias fstat64 fstat;

int lstat64(in char*, stat_t*);
alias lstat64 lstat;
int fstat(int, stat_t*);
int lstat(in char*, stat_t*);
int stat(in char*, stat_t*);

int stat64(in char*, stat_t*);
alias stat64 stat;
static if (__USE_LARGEFILE64)
{
alias fstat fstat64;
alias lstat lstat64;
alias stat stat64;
}
}
else
{
int fstat(int, stat_t*);
int lstat(in char*, stat_t*);
int stat(in char*, stat_t*);
static if (__USE_LARGEFILE64)
{
int fstat64(int, stat_t*);
alias fstat64 fstat;

int lstat64(in char*, stat_t*);
alias lstat64 lstat;

int stat64(in char*, stat_t*);
alias stat64 stat;
}
else
{
int fstat(int, stat_t*);
int lstat(in char*, stat_t*);
int stat(in char*, stat_t*);
}
}
}
else version( Posix )
Expand Down Expand Up @@ -1033,6 +1052,8 @@ else version (Solaris)
enum S_IFDIR = 0x4000;
enum S_IFLNK = 0xA000;
enum S_IFSOCK = 0xC000;
enum S_IFDOOR = 0xD000;
enum S_IFPORT = 0xE000;

int mknod(in char*, mode_t, dev_t);
}
Expand Down

0 comments on commit f1c9e11

Please sign in to comment.