From c9b67f724d039437ea72f666018d2a80266b8a2b Mon Sep 17 00:00:00 2001 From: Araq Date: Fri, 18 Nov 2011 19:08:07 +0100 Subject: [PATCH] new osproc implementation may work with mac os x --- lib/posix/posix.nim | 8 +++++++- lib/pure/osproc.nim | 5 ----- todo.txt | 3 ++- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/lib/posix/posix.nim b/lib/posix/posix.nim index c1cf819b73..aa073ec89b 100755 --- a/lib/posix/posix.nim +++ b/lib/posix/posix.nim @@ -1720,7 +1720,13 @@ when hasSpawnh: POSIX_SPAWN_SETSCHEDULER* {.importc, header: "".}: cint POSIX_SPAWN_SETSIGDEF* {.importc, header: "".}: cint POSIX_SPAWN_SETSIGMASK* {.importc, header: "".}: cint - POSIX_SPAWN_USEVFORK* {.importc, header: "".}: cint + + when defined(macosx): + # macosx lacks this, so we define the constant to be 0 to not affect + # OR'ing of flags: + const POSIX_SPAWN_USEVFORK* = cint(0) + else: + var POSIX_SPAWN_USEVFORK* {.importc, header: "".}: cint when hasAioH: proc aio_cancel*(a1: cint, a2: ptr Taiocb): cint {.importc, header: "".} diff --git a/lib/pure/osproc.nim b/lib/pure/osproc.nim index 03880e72e1..b1b22f0b82 100755 --- a/lib/pure/osproc.nim +++ b/lib/pure/osproc.nim @@ -547,10 +547,6 @@ elif not defined(useNimRtl): var a = toCStringArray(["sh", "-c"], [x]) chck posix_spawn(pid, "/bin/sh", fops, attr, a, e) - if {poEchoCmd, poUseShell} * options == {poEchoCmd}: - # shell echos already, so ... - echo(command, " ", join(args, " ")) - chck posix_spawn_file_actions_destroy(fops) chck posix_spawnattr_destroy(attr) @@ -593,7 +589,6 @@ elif not defined(useNimRtl): quit("execve call failed: " & $strerror(errno)) # Parent process. Copy process information. if poEchoCmd in options: - # shell with no redirects echos already, so ... echo(command, " ", join(args, " ")) result.id = pid diff --git a/todo.txt b/todo.txt index 8415973b93..a85a0c5c32 100755 --- a/todo.txt +++ b/todo.txt @@ -2,7 +2,8 @@ Version 0.8.14 ============== - optimize unused constants away (affected by HLO) -- fix actors.nim: fix thread local storage emulation +- fix actors.nim: fix thread local storage emulation; + add thread tests to test suite version 0.9.0 =============