<div dir="ltr"><div>From the <a href="https://github.com/apple/swift-corelibs-foundation/blob/swift-3.1-branch/Foundation/Process.swift#L422">source</a> and from <a href="https://github.com/apple/swift-corelibs-foundation/blob/swift-3.1-branch/Docs/Status.md#entities">status document</a> (search "terminate()"), it seems like the answer is that terminate has not yet been implemented. </div><div><br></div><div>Take this with a grain of salt since I haven't tried it out myself, but it might look something like the following:<br><font face="monospace"><br>import Glibc</font></div><div><font face="monospace"><br></font></div><div><font face="monospace">kill(task.processIdentifier, SIGTERM)</font></div><div><br>Where <font face="monospace">task </font>is your <font face="monospace">Task</font> (soon to be renamed <font face="monospace">Process</font>). This isn't exactly the same as <font face="monospace">terminate()</font> which I think does some error checking but it gives you a start.</div><div><br></div><div>Good luck!</div><br><div class="gmail_quote"><div dir="ltr">On Tue, Jan 24, 2017 at 12:16 AM Mr Bee via swift-users <<a href="mailto:swift-users@swift.org">swift-users@swift.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_msg"><div style="color:#000;background-color:#fff;font-family:HelveticaNeue-Light,Helvetica Neue Light,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;font-size:16px" class="gmail_msg"><div id="m_6142618255096255505yui_3_16_0_ym19_1_1485237865804_2844" class="gmail_msg"><span class="gmail_msg">Hi,</span></div><div id="m_6142618255096255505yui_3_16_0_ym19_1_1485237865804_2845" class="gmail_msg"><span class="gmail_msg"><br class="gmail_msg"></span></div><div dir="ltr" id="m_6142618255096255505yui_3_16_0_ym19_1_1485237865804_2846" class="gmail_msg">I can't use terminate() function of (NS)Task on Linux because it's not yet implemented. I'm using Swift v.3.0.0 on 64-bit Ubuntu 14.04 LTS. Here's the error message upon calling the function:</div><div dir="ltr" id="m_6142618255096255505yui_3_16_0_ym19_1_1485237865804_2846" class="gmail_msg"><br class="gmail_msg"></div><div style="white-space:nowrap;margin:0px;padding:0px;line-height:14px;color:rgb(255,255,255);font-family:'PT Mono',monospace;font-size:12px;font-variant-ligatures:normal;background-color:rgb(31,27,27)" id="m_6142618255096255505yui_3_16_0_ym19_1_1485237865804_4844" class="gmail_msg">fatal error: terminate() is not yet implemented: file Foundation/NSTask.swift, line 407 </div><div style="white-space:nowrap;margin:0px;padding:0px;line-height:14px;color:rgb(255,255,255);font-family:'PT Mono',monospace;font-size:12px;font-variant-ligatures:normal;background-color:rgb(31,27,27)" dir="ltr" id="m_6142618255096255505yui_3_16_0_ym19_1_1485237865804_4845" class="gmail_msg">Illegal instruction</div><div dir="ltr" id="m_6142618255096255505yui_3_16_0_ym19_1_1485237865804_2846" class="gmail_msg"><br class="gmail_msg"></div><div dir="ltr" id="m_6142618255096255505yui_3_16_0_ym19_1_1485237865804_2846" class="gmail_msg">So, is there a way to terminate a process that is launched by (NS)Task on Linux? Or has it already implemented on Swift 3.0.2?</div><div dir="ltr" id="m_6142618255096255505yui_3_16_0_ym19_1_1485237865804_2846" class="gmail_msg"><br class="gmail_msg"></div><div dir="ltr" id="m_6142618255096255505yui_3_16_0_ym19_1_1485237865804_2846" class="gmail_msg">Thank you.</div><div dir="ltr" id="m_6142618255096255505yui_3_16_0_ym19_1_1485237865804_2846" class="gmail_msg"><br class="gmail_msg"></div><div dir="ltr" id="m_6142618255096255505yui_3_16_0_ym19_1_1485237865804_2846" class="gmail_msg">Regards,</div><div class="gmail_msg"></div><div id="m_6142618255096255505yui_3_16_0_ym19_1_1485237865804_2847" class="gmail_msg"> </div><div class="m_6142618255096255505signature gmail_msg" id="m_6142618255096255505yui_3_16_0_ym19_1_1485237865804_2640"><div id="m_6142618255096255505yui_3_16_0_ym19_1_1485237865804_2639" class="gmail_msg"><br class="gmail_msg"></div>–Mr Bee<div id="m_6142618255096255505yui_3_16_0_ym19_1_1485237865804_2848" class="gmail_msg"><br class="gmail_msg"></div></div></div></div>_______________________________________________<br class="gmail_msg">
swift-users mailing list<br class="gmail_msg">
<a href="mailto:swift-users@swift.org" class="gmail_msg" target="_blank">swift-users@swift.org</a><br class="gmail_msg">
<a href="https://lists.swift.org/mailman/listinfo/swift-users" rel="noreferrer" class="gmail_msg" target="_blank">https://lists.swift.org/mailman/listinfo/swift-users</a><br class="gmail_msg">
</blockquote></div></div>