In response to Garrett's reply...
> My guess is that you should investigate
> the ldi interfaces in sys/sunldi.h, but without more information about
> why you think you need the dev_t, its hard to be sure. (dev_t's are
> supposed to be mostly a private implementation detail.)
I'm actually trying to open a disk using ldi_open_by_name or ldi_open_by_dev.
All I have is the device's path. Both open calls require an dev_indent_t as an
input argument. I can get the dev_ident_t using ldi_ident_from_dev provided I
have the dev_t which I don't. This is why I'm trying to get the dev_t from the
path. See code below:
/* make a handle to be initialized by ldi_open_by_name */
ldi_handle_t raw_handle;
/* get the identity of the raw disk. */
ldi_ident_t raw_ident;
dev_t raw_dev; /* --HOW DO I SPECIFY THIS?-- */
ldi_ident_from_dev(raw_dev, &raw_ident);
/* open the raw disk */
int val = ldi_open_by_name("/dev/dsk/c4t20d0s0", FWRITE|FREAD|FEXCL, kcred,
&raw_handle, raw_ident);
I would be very happy to open the disk using just the path, but I don't see how
to do this. Is it right in front of me and I don't see it?
Any help would be greatly appreciated.
Duff
This message posted from opensolaris.org
_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code