setpgid fails with RPERM
setpgid fails with RPERM
I want the child processes created with Cocoa's NSTask to be in the same process group as the caller.
However calling setpgid() seems to fail with RPERM - operation not allowed.
Is this an OS X POSIX process implementation detail or a consequence of the interior NSTask fork() implementation?
Process group code:
// launch the task
[task launch];
pid_t group = setsid();
if (group == -1) {
NSLog(@"setsid() == -1");
group = getpgrp();
}
if (setpgid([task processIdentifier], group) == -1) {
NSLog(@"unable to put task into same group as self: errno = %i", errno);
}
NSLog(@"new task process id = %i", [task processIdentifier]);
NSLog(@"pgid = %i", group);
Regards
Jonathan Mitchell
Developer
Mugginsoft LLP
http://www.mugginsoft.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden