Skip to content

Commit

Permalink
add compile time option for POSIX sigwait on Illumos/Solaris (nim-lan…
Browse files Browse the repository at this point in the history
…g#19296)

* add compile time option for POSIX sigwait on Illumos/Solaris

* fix link to documentation of `sigwait` on Illumos/Solaris
  • Loading branch information
BarrOff authored and PMunch committed Mar 28, 2022
1 parent bae116d commit fe58c5d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/posix/posix.nim
Original file line number Diff line number Diff line change
Expand Up @@ -772,6 +772,13 @@ else:
proc sigtimedwait*(a1: var Sigset, a2: var SigInfo,
a3: var Timespec): cint {.importc, header: "<signal.h>".}

when defined(sunos) or defined(solaris):
# The following compile time flag is needed on Illumos/Solaris to use the POSIX
# `sigwait` implementation. See the documentation here:
# https://docs.oracle.com/cd/E19455-01/806-5257/6je9h033k/index.html
# https://www.illumos.org/man/2/sigwait
{.passc: "-D_POSIX_PTHREAD_SEMANTICS".}

proc sigwait*(a1: var Sigset, a2: var cint): cint {.
importc, header: "<signal.h>".}
proc sigwaitinfo*(a1: var Sigset, a2: var SigInfo): cint {.
Expand Down

0 comments on commit fe58c5d

Please sign in to comment.