Messages in this thread | | | Date | Wed, 09 Aug 2000 10:47:18 +0300 | From | BenHanokh Gabriel <> | Subject | mapping 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/
| |