Re: CD writing in future Linux try #2 [ was: Re: CD writing in future Linux (stirring up a hornets' nest) ]

From: Joerg Schilling
Date: Mon Jan 30 2006 - 11:35:39 EST


Albert Cahalan <acahalan@xxxxxxxxx> wrote:

> On 1/30/06, Joerg Schilling <schilling@xxxxxxxxxxxxxxxxxxx> wrote:
> > Albert Cahalan <acahalan@xxxxxxxxx> wrote:
> >
> > > Let's address the second bug first. Linux provides full
> > > bus number and LUN info for all block devices. You get it
> > > like this:
> > >
> > > 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.

Jörg

--
EMail:joerg@xxxxxxxxxxxxxxxxxxxxxxxxxxx (home) Jörg Schilling D-13353 Berlin
js@xxxxxxxxxxxxxxx (uni)
schilling@xxxxxxxxxxxxxxxxxxx (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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/