title: Getting the process id of a current process without unistd.h
body: <p>I'm working on a deadlock detection algorithm and I'm only given kernel level libraries, i.e. <code>#include &lt;linux/somelibrary&gt;</code> and nothing else. Are there kernel-level facilities that will allow me to get the pid of the current process similar to <a href="http://www.kernel.org/doc/man-pages/online/pages/man2/getpid.2.html" rel="nofollow noreferrer"><code>getpid()</code></a> of <a href="http://en.wikipedia.org/wiki/Unistd.h" rel="nofollow noreferrer"><code>unistd.h</code></a>?</p>