• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: does sysctl.proc_exec_affinity affect grand-children processes?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: does sysctl.proc_exec_affinity affect grand-children processes?


  • Subject: Re: does sysctl.proc_exec_affinity affect grand-children processes?
  • From: Weissmann Markus <email@hidden>
  • Date: Wed, 8 Aug 2007 13:27:07 +0200

On 8 Aug 2007, at 01:16, Terry Lambert wrote:

On Aug 7, 2007, at 3:54 PM, Weissmann Markus wrote:
On 7 Aug 2007, at 21:52, Terry Lambert wrote:
On Aug 7, 2007, at 9:20 AM, Weissmann Markus wrote:
Hi folks,

does 'sysctlbyname("sysctl.proc_exec_affinity", ..' [1] affect the direct subprocesses only or is this inherited to child processes?

Yes, the flag is inherited; consider that if you are running a PPC binary under Rosetta on an Intel box, and it needs to execute something that talks to the main app using Mach messages, and that in turn needs to execute something else that does the same, and you haven't gone to the trouble to mdeal with the byte order issues (or one of them was a third party app).



Thanks - seems to work just fine! Though I have one problem left: Is there a way to force interpreters like the shell to execute ppc code, too? As long as I call a program directly, everything works just fine, but when called through a shell, child processes escape the enforced Rosetta emulation...

I'm not well enough informed on the intended behaviour to answer this. There's a skanky two step way to "make it work", which you may or may not be interested in:


(1)	Flag the shell as "Run under Rosetta" in the finder

(2)	Use launch services rather than exec to start the process

There are probably other/better approaches that I don't know. Maybe someone else can answer this, or you can contact DTS and ask.


The idea is to cross-compile OSS via Rosetta (on x86 for ppc); this way all tests for endian etc. would behave exactly like on ppc. (The idea is taken from scratchbox [1] which does exactly this with qemu on Linux)
As I would like to integrate this feature into port(1) [2], flagging the shell is not an ideal option, as we try not to touch the base OS. And as far as my tests told me, executing programs from a Rosetta- emulated shell does not necessarily run them in Rosetta-mode.


The problem seems to be that system(3) does reset/ignore/.. (?) the flag. Shouldn't it preserve the flag like all other forked child processes?


-Markus

[1] http://www.scratchbox.org/
[2] http://www.macports.org/

---
Markus W. Weissmann
http://www.mweissmann.de/


_______________________________________________ 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
References: 
 >does sysctl.proc_exec_affinity affect grand-children processes? (From: Weissmann Markus <email@hidden>)
 >Re: does sysctl.proc_exec_affinity affect grand-children processes? (From: Terry Lambert <email@hidden>)
 >Re: does sysctl.proc_exec_affinity affect grand-children processes? (From: Weissmann Markus <email@hidden>)
 >Re: does sysctl.proc_exec_affinity affect grand-children processes? (From: Terry Lambert <email@hidden>)

  • Prev by Date: Re: CPAN make problem on OS X 10.4
  • Next by Date: [darwin-dev] Setting kernel gdb to a frame address?
  • Previous by thread: Re: does sysctl.proc_exec_affinity affect grand-children processes?
  • Next by thread: [darwin-dev] Setting kernel gdb to a frame address?
  • Index(es):
    • Date
    • Thread