[lkml]   [2002]   [May]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: _reliable_ way to get the dev for a mount point?
On Mon May 06, 2002 at 11:55:38AM +0200, Pozsar Balazs wrote:
> So, my question is there a way to get back the device for a directory,
> _reliably_. (I want to know which devices holds the files my process sees
> under an arbitrary /path/to/somewhere).

stat(mnt_point, &statbuf); then walk through /dev and stat each
device, check that it is a block device and that st_rdev matches
the statbuf.st_rdev. When you get a match, you know a device
name for the directory.


Erik B. Andersen
--This message was written using 73% post-consumer electrons--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:25    [W:0.081 / U:2.808 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site