title: How do 32-bit applications make system calls on 64-bit Linux?
body: <p>Some (many? all?) 64-bit<sup>1</sup> Linux distros allow running 32-bit applications by shipping parallel collections of 32-bit and 64-bit libraries (including libc). So a 32-bit application can link against 32-bit libs and be run by a 64-bit kernel.</p>
  
  <p>I'd like to know the <em>mechanics</em> of how 32-bit applications make system calls on a 64-bit kernel. I suspect the answer is somewhere in libc and/or the kernel source, but it would be time-consuming for me to dive into the source since I don't know where to look.</p>
  
  <p>And a more important question, <em>is there any performance overhead?</em><sup>2</sup> Logically, a call from a 32-bit app system call will have to translate to 64-bit internal kernel environment. How and where is this accomplished?</p>
  
  <p><sup><sup>1</sup> "32-bit" = IA-32, and "64-bit" = AMD64</sup><br>
  <sup><sup>2</sup> In your answer make an assumption that it matters :)</sup></p>