• 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: KUNCExectute and return values
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: KUNCExectute and return values


  • Subject: Re: KUNCExectute and return values
  • From: Brian Bergstrand <email@hidden>
  • Date: Thu, 22 Nov 2007 13:34:31 +0200

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:

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:
This email sent to email@hidden


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

  • Prev by Date: KUNCExectute and return values
  • Next by Date: Re: KUNCExectute and return values (really about something else I suspect)
  • Previous by thread: KUNCExectute and return values
  • Next by thread: Re: KUNCExectute and return values (really about something else I suspect)
  • Index(es):
    • Date
    • Thread