[swift-corelibs-dev] Recommended posix_spawnattr_t for NSTask's implementation

Philippe Hausler phausler at apple.com
Fri Dec 18 13:14:03 CST 2015


I would definitely say that posix_spawn is the correct path to implement this; that will keep pretty close to the way the one on darwin works;

Couple of suggestions:

posix_spawnattr_setsigmask should be set to the empty signal set

the attribute flags should probably be POSIX_SPAWN_CLOEXEC_DEFAULT | POSIX_SPAWN_SETSIGMASK | POSIX_SPAWN_SETSIGDEF

You can probably skip QoS since it won’t exist on linux.

There may be some issue with not having libdispatch to use for a source to watch a DISPATCH_PROC_EXIT but this perhaps could be done via a pthread (not certain on exactly how but perhaps it can be done)

It also might be useful in this case to drop down to C similarly as CFXMLInterface - but pick your poison on that one.


> On Dec 18, 2015, at 11:08 AM, Dan Stenmark via swift-corelibs-dev <swift-corelibs-dev at swift.org> wrote:
> 
> I hope to take a crack at implementing some of NSTask this weekend.  What are the recommended posix_spawnattr_t flags that should be set?  Do we also want to take the opportunity to expose the ability to override some of these flags (like POSIX_SPAWN_SETPGROUP) or do we want to avoid tying this with posix_spawn() too closely?
> 
> Dan
> _______________________________________________
> swift-corelibs-dev mailing list
> swift-corelibs-dev at swift.org
> https://lists.swift.org/mailman/listinfo/swift-corelibs-dev



More information about the swift-corelibs-dev mailing list