Re: fmount system call

Matthias Urlichs (smurf@work.smurf.noris.de)
29 Jul 1997 09:40:50 +0200


James Mastros <abszero@epix.net> writes:
> >
> Is there any way to get a fd to a device (not by the filename that points
> to it, but by a major/minor)? I don't see one, and you would need this to
> mount root.
>
We're talking about the userspace<->kernel interface here. Since by
definition, when the kernel mounts root there is no userspace program which
actually calls mount(2) or fmount(2) or whatever, this is no problem.

For remounting and such, simply pass -1 as the device and an open file or
directory somewhere under the mountpoint. (The mount point itself is a good
place since it accesses the mounted file system.)