[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: why does NSTask setpgrp on sub processes?
From: |
Richard Frith-Macdonald |
Subject: |
Re: why does NSTask setpgrp on sub processes? |
Date: |
Wed, 20 Jan 2010 06:37:53 +0000 |
On 20 Jan 2010, at 06:14, Derek Zhou wrote:
> On Tuesday 19 January 2010 12:59:28 am Derek Zhou wrote:
>> hi all,
>> it seems NSTask setpgrp after the fork:
>> ...
>> /*
>>
>> * Make sure task is run in it's own process group.
>>
>> */
>> #ifdef HAVE_SETPGRP
>> #ifdef SETPGRP_VOID
>> setpgrp();
>> #else
>> setpgrp(getpid(), getpid());
>> #endif
>>
>> Why is it doing that? Is it simply what Apple is doing?
I don't know.
Can you provide a test program which will check the behavior of NSTask on OSX?
>> I am trying to call $EDITOR (normally a TTY process) in my program which has
>> no gui either.
>> However I suspect the setpgrp mess up the terminal setting so the EDITOR
>> does not have the tty. I can tcsetpgrp from my process but then my process
>> is stopped. Can we do this:
>> 0, just don't setpgrp, or
>> 1, don't setpgrp if the parent's stdin is a tty and not setting the child's
>> stdin, or
>> 2, add an option not to setpgrp. (it is an additional API though)
>> I think 1 is the safest route and I can easily make a patch. I can do either
>> 0 or 1 if that's what people want.
We should try to do whatever OSX does (for compatibility).
- Re: why does NSTask setpgrp on sub processes?, Derek Zhou, 2010/01/20
- Re: why does NSTask setpgrp on sub processes?,
Richard Frith-Macdonald <=
- Re: why does NSTask setpgrp on sub processes?, Derek Zhou, 2010/01/20
- Re: why does NSTask setpgrp on sub processes?, Richard Frith-Macdonald, 2010/01/20
- Re: why does NSTask setpgrp on sub processes?, Derek Zhou, 2010/01/20
- Re: why does NSTask setpgrp on sub processes?, Derek Zhou, 2010/01/20
- Re: why does NSTask setpgrp on sub processes?, David Chisnall, 2010/01/20
- Re: why does NSTask setpgrp on sub processes?, Richard Frith-Macdonald, 2010/01/20
- Re: why does NSTask setpgrp on sub processes?, Derek Zhou, 2010/01/21
- Re: why does NSTask setpgrp on sub processes?, Richard Frith-Macdonald, 2010/01/20
- Re: why does NSTask setpgrp on sub processes?, Derek Zhou, 2010/01/20
- Re: why does NSTask setpgrp on sub processes?, Derek Fawcus, 2010/01/20