Update posix.nim

This commit is contained in:
Federico Ceratto 2016-04-11 12:07:45 +01:00
commit 6d256ba76e

View file

@ -2630,10 +2630,10 @@ proc utimes*(path: cstring, times: ptr array [2, Timeval]): int {.
proc handle_signal(sig: cint, handler: proc (a: cint) {.noconv.}) {.importc: "signal", header: "<signal.h>".} proc handle_signal(sig: cint, handler: proc (a: cint) {.noconv.}) {.importc: "signal", header: "<signal.h>".}
template onSignal*(signals: varargs[cint], body: stmt): stmt {.immediate.} = template onSignal*(signals: varargs[cint], body: untyped): stmt =
## Setup code to be executed when Unix signals are received. Example: ## Setup code to be executed when Unix signals are received. Example:
## from posix import SIGINT, SIGTERM ## from posix import SIGINT, SIGTERM
## onSignal([SIGINT, SIGTERM]): ## onSignal(SIGINT, SIGTERM):
## echo "bye" ## echo "bye"
for s in signals: for s in signals: