Is this code outdated because I can't seem to get it to compile

http://developer.apple.com/mac/library/qa/qa2001/qa1123.html
Im trying to find a way to get all the processes on the system without parsing ps aux

Hi Eric -
I didn't have any problem compiling the code at the link you posted, so will review what I did in case it's useful to you:
iMac8,1, with OS X 10.5.8, Xcode 3.1.4, and the default gcc:
1) Start a new project with the Mac OS X->Command Line Utility->Standard Tool template;
2) Open main.c
3) Paste Listing 1 from Technical Q&A QA1123 directly into main.c above the main function
4) Add a call to GetBSDProcessList in main like this:
int main (int argc, const char * argv[]) {
kinfo_proc *procList = NULL;
size_t procCount;
// insert code here...
printf("Hello, World!
int err = GetBSDProcessList(&procList, &procCount);
printf("err=%d procCount=%d", err, procCount);
return 0;
// [Session started at 2010-04-05 03:32:02 -0700.]
// Hello, World!
// err=0 procCount=50
// The Debugger has exited with status 0.
I didn't attempt to print any of the values in the procList array, but the procCount was consistent with the output from 'ps -A' in several trials. The structs in the array are declared in sys/proc.h and sys/sysctl.h.
Hope that helps!
- Ray

Similar Messages

  • HT201365 I have brought a second hand phone and cant activate it because i can not seem to get in contact with the previous owner.

    I sold my iphone 4s and added some money to buy a second hand Iphone 5, i can't get into the phone because i need the previous owners apple Id and password and theres absolutely no way I can cintact the previous owner because i had thier number on my iphone 4s which was sold before i brought the 5.

    Only the previous owner can unlock your phone, either by providing you with the code or by removing it from his liste of devices. I'm afraid that if you cannot contact him your phone is useless.

  • How can I fix error code 131:4? Licensing for this product stopped working. I have windows vista home edition and CS4 Design Premium. I downloaded licensing zip file for windows but I can't seem to get it to launch. Look forward to help from anyone

    How can I fix error code 131:4? Licensing for this product stopped working. I have windows vista home edition and CS4 Design Premium. I downloaded licensing zip file for windows but I can't seem to get it to launch. Look forward to help from anyone

    Steve,
    I appreciate your answer.  While it might work, I'm a bit hesitant to remove the other programs as a possible solution since they are all currently working.
    With Acrobat 9 Pro failing with the OS 10.7 upgrade, I'm hoping that there is a less severe solution.
    Since the trigger appears to be 10.7 and may have something to do with the discontinued support of Rosetta, I could be spending a few hours working on a reinstall without a change.  Yes, it might work.  The "might" is the part that makes me hesitate.
    Is anyone else out there on OS 10.7 and running Acrobat 9 Pro?  Any issues with anyone else?
    Thanks Steve.  I do appreciate your offering a solution.  I may end up trying it if nothing else comes together.
    Mark

  • How d I find my IMEI on my Motorola Moto G because I can't seem to find it at all??

    How do I find my IMEI on my Motorola Moto G because I can't seem to find it at all??

        Hello mriley1989, no worries I am here to the rescue.  I will give you step by step instructions to find the IMEI.  If you are still abel to access the settings on the phone, these are the steps to follow: Settings>About Phone>Status>IMEI. You should then be able to see IMEI within settings in this page.  Hope this helped.  -Yareli

  • HT4623 I can't seem to get my keypad shortcuts to work on my iphone 4 after the ios6 update.  Anyone have a fix for this??  Apple???

    I can't seem to get my keypad shortcuts to work on my iphone 4 after the IOS 6 update.  Anyone have a resolution for this???  Apple???

    Unless Verizon has a special provision in this regard that ATT has never had, Apple handles all iPhone repairs and exchanges under Apple's warranty.
    There is a setting when capturing photos - Automatic, On, or Off for the flash when capturing photos.
    If there is no flash when set to On or Automatic in a dark setting and no change after the standard troubleshooting steps which in order are:
    Power your iPhone off and on.
    An iPhone reset.
    Restoring your iPhone with iTunes from the backup.
    Restoring your iPhone with iTunes as a new iPhone or not from the backup.
    Your iPhone has a hardware problem. You can call AppleCare or make an appointment at an Apple store if there is one nearby.

  • I can't seem to get my iPod touch (4th Gen) to play photo slideshows or videos through my TV.  Is this a design flaw?  Or is it me?  My old iPod used to do it no problem, but now I can't even find any video out options in the settings.

    I can't seem to get my iPod touch (4th Gen) to play photo slideshows or videos through my TV.  Is this a design flaw?  Or is it me?  My old iPod used to do it no problem, but now I can't even find any video out options in the settings.

    This cable And Im using a cable that has a headphone jack on one end and RCA cables on the other. does not work for iPod touches. See:
    http://support.apple.com/kb/HT1454

  • In fcp7 there is a "close gap" option so you don't have to highlight and move everything every time you delete a small section in the middle of a video. Is it possible to do this in fcpx? I can't seem to find it...Thanks!

    In fcp7 there is a "close gap" option so you don't have to highlight and move everything every time you delete a small section in the middle of a video. Is it possible to do this in fcpx? I can't seem to find it...Thanks!

    This isn't the actual clip, I fixed it by highlighting and moving everything over but it'd still be a good thing to know for the future. This is essentially the situation i'm talking about. I would never use it for something this simple, but when more complicated editing is being done it isn't so easy to just move all the clips over.

  • TS1814 I can't seem to get the drivers downloaded on my windows laptop for my iphone 5s, the info is coming up generic and im getting a code 1.  Please help

    I can't seem to get the drivers downloaded on my windows laptop for my iphone 5s, the info is coming up generic and im getting a code 1.  Please help

    All necessary drivers are included in the iTunes install package.
    Please clarify exactly what the problem is.
    the info is coming up generic and im getting a code 1
    That's not very informative.

  • I suddenly have BING as my search engine. I checked my settings and Google is my search engine. I can't seem to get rid of this BING any suggestions?

    I suddenly have BING as my search engine. I checked my settings and Google is my search engine. I can’t seem to get rid of this BING any suggestions on getting rid of it and getting back to Google?

    Hello
    I did remove Bing from the drop down menu, but it is still in Firefox as main search engine. I also did a back up and restore. Nothing has worked so far. I read a post that people were able to delete Bing from Explorer. I guess using Explorer will be my last resort.

  • I'm trying to update my software to iTunes 10.5.2.  I click on the install button, click the Accept button, the software checks for updates, and then I am back at the original download screen.  I can't seem to get past this loop.  Any suggestions?

    I'm trying to update my software to iTunes 10.5.2.  I click on the install button, click the Accept button, the software checks for updates, and then I am back at the original download screen.  I can't seem to get past this loop.  Any suggestions?

    If I go through the setup that you suggested, won't I screw up the existing software on my system?
    No. The iTunes installer will first uninstall the existing version of iTunes and then put in the new one. (That's actually also what happens when you use Apple Software Update to install a new version ... it just doesn't show the uninstall phase like the iTunes64Setup.exe or iTunesSetup.exe does.)

  • HT1420 i can't seem to get my iPad to synch with my new iMac.  The iTunes prompt says that this computer isn't authorised although i have registered it on iTunes.  Any other ideas for how to overcome this block?

    i can't seem to get my iPad to synch with my new iMac.  The iTunes prompt says that this computer isn't authorised although i have registered it on iTunes.  Any other ideas for how to overcome this block?

    What do you mean by 'registered it on iTunes' ? You've authorised your account on your Mac's iTunes via the Store > Authorise This Computer menu option ? And you've copied your library onto the Mac ?
    Copying content between computers : http://support.apple.com/kb/HT4527
    You may also find this page for syncing to a new computer useful : https://discussions.apple.com/docs/DOC-3141

  • HT3180 Ok, I got the Apple TV all hooked up. Im pretty handy and have a lot of experience putting electronics together, but this one has got me. I can not seem to get it to connect to my iTunes. Probably something running in the background.

    Having problems with Home Sharing with the WiFi. Can not seem to get the Apple TV to connect to my iTunes. Must be something running in the background of the router or laptop. Need help.

    Yes to all, however ive noticed when I turn on the itues Home Sharing, and it says it is on in the File pull down, it disapears from the Livrary pull down. I attempt to view my Library on my iPhone or iPad under the Remote app and it states i have no songs or content. Although it will let me mirror my device on the TV screen.

  • I can't seem to get the iTS to update the description of my podcast, nor refresh to show new episodes?

    I recently launched a podcast series (http://itunes.apple.com/ca/podcast/notes-from-northwest-passage/id449063851) but its still showing an older description text with some typos and an incorrect link in it, as I registered it with a pre-edited file so it would be in line for review while I finalized the details, and now I can't seem to get it to refresh and show the new texts at all, even though I edited the description texts in the xml file well over 2-3 weeks ago.
    I've tried redoing this file several times.  It always validates but changes never get picked up by the iTunes store.I can manually subscribe to the feed using iTunes' advanced menu, with no problems. The feed is at:
    http://a4.g.akamai.net/7/4/66750/v1/smb2.download.akamai.com/66750/http/podcasts /archaeology2011/arcticarchaeology2011_eng.xml
    I recently (about 3-4 days ago) tried redirecting the feed to a new version of the xml file stored in a new folder, just to see if that would somehow jolt it back into reading it, but again after 3-4 days it hasn't done anything.
    It's also not showing any of the most recent episodes even though they have all been there about a week, so the store should have picked them up by now, no?
    Any suggestions?

    If you look at the feed, and look at the entry 'The end to an exciting field season in Aulavik National Park' you will see the line:
    <pubDateFri, 29 Jul 2011 04:00:00 GMT</pubDate>
    You have not closed the 'pubdate' tag - there should be a '>' as the 9th character. Because the tag has been left open, it invalidates everything which follows it, and thus the entire feed. iTunes therefore cannot read it, which is why the Store has not updated. Add the '>' and republish, and all should be well.
    It's always worth checking your feed by subscribing manually, from the 'Advanced' menu, or by clicking the 'subscribe free' button on the Store page (both do the same thing) - if you can subscribe to the feed it should be OK.

  • HT3500 I have a MacBook Pro and an HP ENVY 110 SERIES All-In-One .  I can't seem to get a network set up or either one to locate or connect to the other one.

    I've spent hours, actually probably days, trying to do this but it's not working. I've had the ENVY since Nov
    and have not been able to print - much less do anything else with it.
    My internet is CLEAR wireless. I use the little USB 4G Mobil Modem. This new HP ENVY is also wireless.
    I know I can't be online and print at the same time unless I get a router.
    I also know that I can go offline and change the network pref  to "airport" so I can print. Meaning I'll have to change
    back and forth but for my uses,  that's ok..at least for right now.
    What I can't seem to get set-up correctly is my own local network.
    I'm pretty sure it's suppose to be done using "Airport".
    Obviously, I'm doing something wrong in establishing my network.
    The printer is listed on my printer preferences and shown as  "offline"  "default". I assume that means the ENVY
    is my default printer.  Great! At least my Pro knows it's suppose to connect to the ENVY once everything's set-up correctly.
    Now, if someone could just tell me exactly, step-by-step what to do to get that done....
    I'd be soooo very happy!
    Thank you!
    Ricki

    Well... no help was found here.. so I abandoned the wireless- ness of my printer.  I bought a
    small 10 port hub because only 2 USB ports really isn't enough with wireless mouse, wireless internet
    and any kind of printer.   I also bought a long USB cable.  I now print--wired since this can be done
    as an alternative to wireless with this printer.   Because I don't want a cable "hanging around"
    when the printer is not in use, I simple disconnect it and reconnect when I want to print.
    It's a temporary solution others may find helpful as well. Apparently there's been a lot of
    confusion and problems getting this printer set up wirelessly with our MacBooks.
    Shame on HP for not helping us out!

  • I have powerpoint for Mac on my imac.  I can't seem to get the active text box function to work like it did on my PC.  How can I insert an active textbox into a presentation that will allow me to type while presenting?

    I have powerpoint for Mac on my imac.  I can't seem to get the active text box function to work like it did on my PC.  How can I insert an active textbox into a presentation that will allow me to type while presenting?

    I've gotten a little further on this. The dynamic select is
    working fine. It's the "a href" code that isn't. I'm wondering if
    someone can look at this line and tell me if it's okay to build the
    query string this way. The storeid comes through fine but I'm still
    not getting the employeeid value to pass. Here's line that's not
    working:
    td><a href="registerStoreCust.php?storeid=<?php echo
    $row_storeRS['storeid']; echo "&employeeid="; echo
    $_GET['employeeLM']; ?>">Register
    Customer</a></td>

Maybe you are looking for

  • Second-hand G5 iMac and warranty extension

    I bought a second-hand imac G5 on eBay and it has all the symptoms of needing logic board and or power supply replacement, i.e. high revving fans, very loud high pitch whine. I've done all resets and cleaning. Is a second-hand machine eligible for th

  • MIRO-Un planned cost

    Hi,   what is impact of following scenario. GR date and qty 20/05/2008 and material A:qty: 100 material B:qty: 100 MIRO: on 30/05/2008 qty: 100 during miro creation in that particular plant there was only 50 qty of material A ( rest of the stock is c

  • Please Help Me With My JVC Everio

    I am trying to import my footage from my JVC Everio GZ-HD3U to iMovie HD. Apparently I had to change the quality to 1440 CBR. Unfortunately, I did not do this and already recorded half of my project. Is there any possible way to simply put the **** f

  • How do I delete updates displayed on skype home pa...

    There are updates on my skype home page that are years old, and serve no purpose. There doesn't seem to be a way to delete them. There is a selection to hide them, but none to delete. Mac OSX 10.6.8 skype 6.15 (335) Thanks JLS

  • Transfer from IPT to ITunes

    I reloaded my computer OS and of course lost my Itunes stuff on the hard drive. Now I want to save what is on my IPT 2g to the newly reloaded Itunes. The sync messages indicate they will erase the (music, videos, etc) on the IPT and replace with what