Created
September 18, 2012 15:57
-
-
Save jeffniblack/3743902 to your computer and use it in GitHub Desktop.
fork check for jailbroken iOS devices
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static inline int | |
fork_check(void) | |
__attribute__((always_inline)); | |
int fork_check(void) { | |
int result = fork(); | |
if (!result) { | |
exit(0); | |
} | |
if (result >= 0) { | |
#if TARGET_IPHONE_SIMULATOR | |
NSLog(@"fork_check -> Running on the simulator!"); | |
return 0; | |
#else | |
return 1; | |
#endif | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment