title: Command line program for jailbroken iOS dies in iPad but not in iPhone 3G
body: <p>I'm trying to build a command line program to run in the terminal of jailbroken iOS devices. </p>
  
  <p>To keep it simple I tested with a simple hello world:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  int main(int argc, char *argv[]) {
    printf("Hello world!\n");
  }
  </code></pre>
  
  <p>Which I build with:</p>
  
  <pre><code>/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc -arch armv6 -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk/ main.c -o hello
  </code></pre>
  
  <p>The generated executable works fine in an iPhone 3G running iOS 4.2.1, but in an iPad running 4.3.5 it outputs:</p>
  
  <pre><code>Killed: 9
  </code></pre>
  
  <p>Both are jailbroken, and can run apps from Cydia just fine.</p>
  
  <p>I tried debugging directly on the iPad with gdb from Cydia, but gdb exits when the program receives the kill signal.</p>
  
  <p>For what it's worth, the program I'm really trying to build is <a href="http://ledger-cli.org/" rel="nofollow">Ledger</a>. I have it running on my iPhone 3G, but when I tried it on the iPad it fails as above.</p>
  
  <p>Any ideas?</p>