Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <mach/mach.h>
- int main( int argc, char** argv )
- {
- kern_return_t kern_return = 0;
- mach_port_t task = 0;
- for (int i=0; i<100000; i++) {
- for (int pid=0; pid<100000; pid++) {
- kern_return = task_for_pid( mach_task_self(), pid, &task );
- if( kern_return != KERN_SUCCESS ) {
- continue;
- }
- printf("success for %d: %u\n", pid, task );
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment