new osproc implementation may work with mac os x

This commit is contained in:
Araq
2011-11-18 19:08:07 +01:00
parent 12bac28d23
commit c9b67f724d
3 changed files with 9 additions and 7 deletions

View File

@@ -1720,7 +1720,13 @@ when hasSpawnh:
POSIX_SPAWN_SETSCHEDULER* {.importc, header: "<spawn.h>".}: cint
POSIX_SPAWN_SETSIGDEF* {.importc, header: "<spawn.h>".}: cint
POSIX_SPAWN_SETSIGMASK* {.importc, header: "<spawn.h>".}: cint
POSIX_SPAWN_USEVFORK* {.importc, header: "<spawn.h>".}: 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: "<spawn.h>".}: cint
when hasAioH:
proc aio_cancel*(a1: cint, a2: ptr Taiocb): cint {.importc, header: "<aio.h>".}

View File

@@ -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

View File

@@ -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
=============