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

Commit

Permalink
More Solaris additions.
Browse files Browse the repository at this point in the history
Scanning through the sources I found some places where declarations for Solaris
are missing. This is not complete!
  • Loading branch information
redstar committed Nov 30, 2014
1 parent 85dd75b commit f6b012b
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 0 deletions.
27 changes: 27 additions & 0 deletions src/core/sys/posix/poll.d
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,33 @@ else version( FreeBSD )

int poll(pollfd*, nfds_t, int);
}
else version( Solaris )
{
alias c_ulong nfds_t;

struct pollfd
{
int fd;
short events;
short revents;
}

enum
{
POLLIN = 0x0001,
POLLPRI = 0x0002,
POLLOUT = 0x0004,
POLLRDNORM = 0x0040,
POLLWRNORM = POLLOUT,
POLLRDBAND = 0x0080,
POLLWRBAND = 0x0100,
POLLERR = 0x0008,
POLLHUP = 0x0010,
POLLNVAL = 0x0020,
}

int poll(pollfd*, nfds_t, int);
}
else version( Android )
{
struct pollfd
Expand Down
16 changes: 16 additions & 0 deletions src/core/sys/posix/pthread.d
Original file line number Diff line number Diff line change
Expand Up @@ -791,6 +791,22 @@ version( OSX )
int pthread_mutexattr_setprioceiling(pthread_mutexattr_t*, int);
int pthread_mutexattr_setprotocol(pthread_mutexattr_t*, int);
}
else version( Solaris )
{
enum
{
PTHREAD_PRIO_NONE = 0x00,
PTHREAD_PRIO_INHERIT = 0x10,
PTHREAD_PRIO_PROTECT = 0x20,
}

int pthread_mutex_getprioceiling(in pthread_mutex_t*, int*);
int pthread_mutex_setprioceiling(pthread_mutex_t*, int, int*);
int pthread_mutexattr_getprioceiling(in pthread_mutexattr_t*, int*);
int pthread_mutexattr_getprotocol(in pthread_mutexattr_t*, int*);
int pthread_mutexattr_setprioceiling(pthread_mutexattr_t*, int);
int pthread_mutexattr_setprotocol(pthread_mutexattr_t*, int);
}

//
// Scheduling (TPS)
Expand Down
14 changes: 14 additions & 0 deletions src/core/sys/posix/stdio.d
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,16 @@ version( linux )
int putc_unlocked(int, FILE*);
int putchar_unlocked(int);
}
else version( Solaris )
{
void flockfile(FILE*);
int ftrylockfile(FILE*);
void funlockfile(FILE*);
int getc_unlocked(FILE*);
int getchar_unlocked();
int putc_unlocked(int, FILE*);
int putchar_unlocked(int);
}

//
// XOpen (XSI)
Expand All @@ -244,3 +254,7 @@ version( FreeBSD )
{
enum P_tmpdir = "/var/tmp/";
}
version( Solaris )
{
enum P_tmpdir = "/var/tmp/";
}
4 changes: 4 additions & 0 deletions src/core/sys/posix/unistd.d
Original file line number Diff line number Diff line change
Expand Up @@ -975,6 +975,10 @@ version( linux )
{
int fdatasync(int) @trusted;
}
else version( Solaris )
{
int fdatasync(int) @trusted;
}
else version( Android )
{
int fdatasync(int) @trusted;
Expand Down

0 comments on commit f6b012b

Please sign in to comment.