From aa908102bac765443931c14c836be3032ca4af4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= Date: Tue, 30 May 2006 20:47:57 +0000 Subject: [PATCH] dump driver name and device path to test some ioctls git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17659 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/bin/driveinfo.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/bin/driveinfo.c b/src/bin/driveinfo.c index 2e3ff7a4ff..048465f4a0 100644 --- a/src/bin/driveinfo.c +++ b/src/bin/driveinfo.c @@ -3,6 +3,7 @@ #include #include #include +#include static void dump_dev_size(int dev) { @@ -72,6 +73,20 @@ static void dump_geom(int dev, bool bios) puts(""); } +static void dump_other(int dev) +{ + char path[B_PATH_NAME_LENGTH]; + if (ioctl(dev, B_GET_DRIVER_FOR_DEVICE, path, sizeof(path)) >= 0) { + printf("driver:\t%s\n", path); + } +#ifdef __HAIKU__ + if (ioctl(dev, B_GET_PATH_FOR_DEVICE, path, sizeof(path)) >= 0) { + printf("device path:\t%s\n", path); + } +#endif + puts(""); +} + int main(int argc, char **argv) { int dev; @@ -89,5 +104,6 @@ int main(int argc, char **argv) dump_media_status(dev); dump_geom(dev, false); dump_geom(dev, true); + dump_other(dev); return 0; }