For a given Ubuntu machine how can I figure out the system call number and its corresponding system call function name? Also, would these differ across a 32 bit and a 64 bit machine of the same release?
I'm trying this specifically for "Precise".
Take a look at /usr/include/x86_64-linux-gnu/asm/unistd.h
(64-bit Ubuntu). I assume that's what you are looking for.
This file in turn includes other files in /usr/include/x86_64-linux-gnu/asm/
, like unistd_32.h
or unistd_64.h
, where you will find the actual system call numbers. So to answer your second question - yes, these numbers may differ across 32-bit and 64-bit flavors of a particular Ubuntu version.
Edit: Note that the above paths refer to 64-bit Ubuntu. This would be slightly different for a 32-bit Ubuntu. I don't have one here to check, but /usr/include/asm/unistd.h
may be a good guess. If all fails, run locate unistd.h
.