Matthias Andree <matthias.andree@gmx.de> wrote: > > > > > struct stat sbuf; > > > > > stat("/dev/hdc", &sbuf); > > > > > int bus = sbuf.st_mode>>12; > > > > > int target = major(sbuf.st_rdev); > > > > > int lun = minor(sbuf.st_rdev); > > > > > > > > Now tell me how to match this with information from /dev/sg* > > > > > > You do the obvious, scanning /dev to find the device file. > > > > I am sorry, but you obviously did not understand the problem. > > Stop offending people who are trying to be helpful just because they > suggest different solutions than you expect. You - again - elided > Albert's crucial part, which even included an offer to fix things: I am sorry to see your recent dicussion style. I was asking a question and I did get a completely useless answer as any person who has some basic know how Linux SCSI would know that doing a stat("/dev/sg*", ...) will not return anything useful. If people give useful answers, it makes sense to continue a discussion but it turns out that "joe average" on KLML replies before thinking about the problem. Let me ask again: Is there a way to get (or construct) a closed view on the namespace for all SCSI devices? And IMPORTANT: don't answer unless you have a real answer for the problem. Jörg -- EMail:joerg@schily.isdn.cs.tu-berlin.de (home) Jörg Schilling D-13353 Berlin js@cs.tu-berlin.de (uni) schilling@fokus.fraunhofer.de (work) Blog: http://schily.blogspot.com/ URL: http://cdrecord.berlios.de/old/private/ ftp://ftp.berlios.de/pub/schily - 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/
- Follow-Ups:
- Re: CD writing in future Linux try #2 [ was: Re: CD writing in future Linux (stirring up a hornets' nest) ]
- From: Phillip Susi <psusi@cfl.rr.com>
- Re: CD writing in future Linux try #2 [ was: Re: CD writing in future Linux (stirring up a hornets' nest) ]
- From: Matthias Andree <matthias.andree@gmx.de>
- Re: CD writing in future Linux try #2 [ was: Re: CD writing in future Linux (stirring up a hornets' nest) ]
- References:
- CD writing in future Linux try #2 [ was: Re: CD writing in future Linux (stirring up a hornets' nest) ]
- From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
- Re: CD writing in future Linux try #2 [ was: Re: CD writing in future Linux (stirring up a hornets' nest) ]
- From: Joerg Schilling <schilling@fokus.fraunhofer.de>
- Re: CD writing in future Linux try #2 [ was: Re: CD writing in future Linux (stirring up a hornets' nest) ]
- From: Matthias Andree <matthias.andree@gmx.de>
- Re: CD writing in future Linux try #2 [ was: Re: CD writing in future Linux (stirring up a hornets' nest) ]
- From: Jan Engelhardt <jengelh@linux01.gwdg.de>
- Re: CD writing in future Linux try #2 [ was: Re: CD writing in future Linux (stirring up a hornets' nest) ]
- From: Joerg Schilling <schilling@fokus.fraunhofer.de>
- Re: CD writing in future Linux try #2 [ was: Re: CD writing in future Linux (stirring up a hornets' nest) ]
- From: Albert Cahalan <acahalan@gmail.com>
- Re: CD writing in future Linux try #2 [ was: Re: CD writing in future Linux (stirring up a hornets' nest) ]
- From: Joerg Schilling <schilling@fokus.fraunhofer.de>
- Re: CD writing in future Linux try #2 [ was: Re: CD writing in future Linux (stirring up a hornets' nest) ]
- From: Albert Cahalan <acahalan@gmail.com>
- Re: CD writing in future Linux try #2 [ was: Re: CD writing in future Linux (stirring up a hornets' nest) ]
- From: Joerg Schilling <schilling@fokus.fraunhofer.de>
- Re: CD writing in future Linux try #2 [ was: Re: CD writing in future Linux (stirring up a hornets' nest) ]
- From: Matthias Andree <matthias.andree@gmx.de>
- CD writing in future Linux try #2 [ was: Re: CD writing in future Linux (stirring up a hornets' nest) ]
- Prev by Date: Re: [Openipmi-developer] [PATCH 0/5] ia64 ioremap, DMI, EFI system table
- Next by Date: Re: [Xen-devel] Re: [PATCH 2.6.12.6-xen] sysfs attributes for xen
- Previous by thread: Re: CD writing in future Linux try #2 [ was: Re: CD writing in future Linux (stirring up a hornets' nest) ]
- Next by thread: Re: CD writing in future Linux try #2 [ was: Re: CD writing in future Linux (stirring up a hornets' nest) ]
- Index(es):
![]() |