Re: how to map "/dev/root" to "/proc/partitions" entry in user prog?

Miquel van Smoorenburg (miquels@cistron.nl)
Tue, 14 May 2002 21:26:47 +0000 (UTC)


In article <Pine.LNX.4.44.0205141554240.2160-100000@spaz.localdomain>,
Jeff Meininger <jeffm@boxybutgood.com> wrote:
>How can I reliably map /dev/root to the corresponding entry in
>/proc/partitions?

The first two lines in /proc/partitions are major/minor of the
device. Simply stat("/", &st) and use st.st_dev (and the major/minor
macros in glibc)

>Please Cc me in your response.

I'm reading and posting this on a mail2news gateway, sorry.

Mike.

-- 
"Insanity -- a perfectly rational adjustment to an insane world."
  - R.D. Lang

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/