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

Commit

Permalink
Bug 15073: only Solaris and Linux support realtime signals
Browse files Browse the repository at this point in the history
  • Loading branch information
tomer-weka committed Sep 17, 2015
1 parent a6e3f93 commit bc54d80
Showing 1 changed file with 30 additions and 18 deletions.
48 changes: 30 additions & 18 deletions src/core/sys/posix/signal.d
Original file line number Diff line number Diff line change
Expand Up @@ -108,36 +108,48 @@ union sigval
version( Solaris )
{
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); }

@property int SIGRTMIN() nothrow @nogc {
static int sig = -1;
if (sig == -1) {
sig = cast(int)sysconf(_SC_SIGRT_MIN);
}
return sig;
}

@property int SIGRTMAX() nothrow @nogc {
static int sig = -1;
if (sig == -1) {
sig = cast(int)sysconf(_SC_SIGRT_MAX);
}
return sig;
}
}
else version( Posix )
else version( linux )
{
private extern (C) nothrow @nogc
{
int __libc_current_sigrtmin();
int __libc_current_sigrtmax();
}

alias __libc_current_sigrtmin _sigrtmin;
alias __libc_current_sigrtmax _sigrtmax;
}

@property int SIGRTMIN() {
static int sig = -1;
if (sig == -1) {
sig = _sigrtmin();
@property int SIGRTMIN() nothrow @nogc {
static int sig = -1;
if (sig == -1) {
sig = __libc_current_sigrtmin();
}
return sig;
}
return sig;
}

@property int SIGRTMAX() {
static int sig = -1;
if (sig == -1) {
sig = _sigrtmax();
@property int SIGRTMAX() nothrow @nogc {
static int sig = -1;
if (sig == -1) {
sig = __libc_current_sigrtmax();
}
return sig;
}
return sig;
}
// Note: it appears that FreeBSD/OSX do not support realtime signals

version( linux )
{
Expand Down

0 comments on commit bc54d80

Please sign in to comment.