Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: KUNCExectute and return values



I believe the return val of KUNCExecute is whether the execute succeeded or not, not the return value of the binary being executed. So 0 would be correct - no error executing your binary.

I also believe Apple has stated the KUNC functions are not the way forward (IOW, they may disappear). Your best solution would be to have a userland program pass this value to your KEXT via a more supported (and efficient) means. There are many ways to achieve this: IOKit UserClient, BSD sockets or ioctl's, and mach ports or shared memory.

On Nov 22, 2007, at 1:05 PM, Andrew James wrote:

Hi,

I am developing a KEXT which requires the power source, now i have done lots of study into finding a way to access the power source information but there seems to be no obvious way for a KEXT to access this data.

Then it came to me, why not use a secondary binary which is ever so simple and all it does is return the value of the power source in a error code of the binary (10 for AC etc)

However i can not work out how to retrieve the return value all i get is 0


kern_return_t ret;
ret = KUNCExecute("/Users/jamesas/Projects/Build/Release/ PowerSource" , kOpenAppAsRoot, kOpenApplicationPath);
IOLog ("KUNC: %d", ret);
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/darwin-dev/email@hidden


This email sent to email@hidden

Brian Bergstrand <http://www.bergstrand.org/brian/> PGP Key ID: 0xB6C7B6A2

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/darwin-dev/email@hidden

This email sent to email@hidden
References: 
 >KUNCExectute and return values (From: "Andrew James" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.