Tobias Exner wrote:
> Is somebody able to post a little example how to get such a pm-info for one 
> disk?
> I don't need a detailed comment for everything, just some lines of code to 
> play with.
>
> for example i would like to know the idle time ( PM_GET_TIME_IDLE ) of disk  
> "/dev/dsk/c0t1d0" ..
Very loosely, ls -l /dev/dsk/c0t1d0, and use the resulting string (minus 
the "/devices" initial substring
and the minor string (everything starting with ":"), example below:
> Very loosely:  you provide variable declarations, error checking, etc ...
>   
#include "sys/pm.h"

...
struct pm_req_t req;

fd = open("/dev/pm", ...); /* man open for details */
/*
 * ls -l  /dev/dsk/c0t1d0 strip off "/devices", minor
 * on my ferrari, ls -l of /dev/dsk/c0t0d0 yields
 * "/devices/[EMAIL PROTECTED],0/pci1025,[EMAIL PROTECTED],2/[EMAIL 
PROTECTED]/[EMAIL PROTECTED],0:a
 * minus the initial "/devices" and ending ":.a"
 */
req.physpath="/[EMAIL PROTECTED],0/pci1025,[EMAIL PROTECTED],2/[EMAIL 
PROTECTED]/[EMAIL PROTECTED],0";

req.component = 0;
idle = ioctl(fd,  PM_GET_TIME_IDLE, &req);
>  
>  
> This message posted from opensolaris.org
> _______________________________________________
> opensolaris-code mailing list
> [email protected]
> http://mail.opensolaris.org/mailman/listinfo/opensolaris-code
>   

_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to