Skip to content

Instantly share code, notes, and snippets.

@skreuzer
Last active August 30, 2015 15:35
Show Gist options
  • Save skreuzer/157427 to your computer and use it in GitHub Desktop.
Save skreuzer/157427 to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <sys/param.h>
#include <sys/sysctl.h>
int
main (int argc, char **argv)
{
int mp, mib[2] = { CTL_KERN, KERN_MAXPROC };
size_t len = sizeof(mp);
sysctl(mib, 2, &mp, &len, NULL, 0);
printf("%d\n", mp);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment