 <p>I think the reason you found it difficult to find the source code is that <code>getcontext</code> and <code>setcontext</code> are (generally?) <strong>implemented in assembly</strong> than in C. Here are the source codes</p> <p><a href="http://www.koders.com/noncode/fid466DE9347BF79B388783D3F5D94BAF6748F618C9.aspx?s=readdir64" rel="nofollow">setcontext</a> and <a href="http://www.koders.com/noncode/fid62EE9446C4DEED004E74CD6D61D7C81435E413FE.aspx?s=queue" rel="nofollow">getcontext</a></p> <p>However, these assembly codes are not so easy to read. I think <code>man getcontext</code> is better. Anyways, good luck :)</p>