在 Mac App Store 上的一个应用程序中,我正在执行以下操作:
system("/usr/bin/nice -n 20 /usr/bin/purge &> /dev/null &");
这工作得很好,但现在我正在尝试提交一个新版本,他们强迫我启用沙盒。但是,使用沙盒时,该调用会失败,并在控制台中显示如下消息:
7/20/13 12:58:59.000 AM kernel[0]: Sandbox: sh(28537) deny file-read-data /dev/ttys000
7/20/13 12:58:59.968 AM purge[28538]: bootstrap_look_up(): Permission denied
7/20/13 12:59:00.000 AM kernel[0]: Sandbox: purge(28538) deny mach-lookup com.apple.appleprofilepolicyd
7/20/13 12:59:00.521 AM purge[28538]: <CPDevice.m:3813> Unable to create new counter client.
7/20/13 12:59:00.523 AM purge[28538]: <CPOSX.m:1188> Unable to get user client so as to poke the kernel.
7/20/13 12:59:00.000 AM kernel[0]: Sandbox: purge(28538) deny iokit-open ApplePerformanceCounterManagerUserClient
7/20/13 12:59:00.000 AM kernel[0]: Sandbox: purge(28538) deny iokit-open AppleProfileUtilitiesUserClient
7/20/13 12:59:00.000 AM kernel[0]: AppleProfileUtilitiesUserClient: bad busy count (0,-1)
7/20/13 12:59:00.000 AM kernel[0]: Backtrace 0xffffff802d22d4d2 0xffffff802d231fc9 0xffffff802ceb3137 0 0 0 0
有没有办法解决这个问题?