lkml.org 
[lkml]   [2000]   [Aug]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjectmapping from dev_t to device name
hi

i'm writing a program which needs to know the scsi-id of files it is
dealing with.
while geting the scsi-id can be done with the SCSI_IOCTL_GET_IDLUN
ioctl, it needs to be done on an open device.
the problem is how to figure out the device name from the file name/ fd
?
in BSD i can stat(2) the file and then call devname(2) to translate from
the dev_t field in the stat struct into device name in filesystem.

is there an api like this in linux, or that i have to scan /etc/fstab
with getmntent(3) loooking for mount-point which is the longest prefix
of filename( after getting rid of soft-links ) ?
this looks like a redundent work as the kernel must have done it while
opening the file

please CC me for answers as i'm not regitered to the mailing list

THX
/gabriel


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

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