Re: Util-linux mount function source code
On Thu, Jan 03, 2008 at 08:54:00AM -0800, Dennis Nguyen wrote:
> I would like to see the mount source code. I saw the mount.c module in
> the util-linux called mount function. It linked to the libc-2.6.so (I
> using kernel 188.8.131.52) I got the GNU libc source code but
> I could not find the called mount function.
util-linux/mount/mount.c calls the mount function in glibc, but that's
just a trivial wrapper for the kernel system call. In fact it's so
trivial that the glibc source code doesn't have an explicit
implementation for it, but just automatically generates a syscall stub.
The actual mount syscall implementation is in fs/namespace.c in the
kernel source, and I suspect it's this you're interested in rather than
the fiddly details of how a userspace function call turns into a
syscall. Start at the sys_mount function.
Colin Watson [email@example.com]