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

David Smith david_smith at apple.com
Fri Dec 18 13:37:17 CST 2015


One issue that we ran into in the ObjC NSTask is setting the current working directory in the child process. We worked around the lack of an API for that by using per-thread working directories, which is kind of awful. I'm not up to date on what the best approach to use for this on Linux would be; it sounds like clone() can do it, but I don't know if that's exposed at the posix_spawn level at all.

	David

> 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