I want to obtain status information for a disk using C code from within the 
OpenSolaris kernel. What function do I use?

I can get the information using the command line by entering “stat 
/dev/dsk/c4t10d0s0”. So, I tried the following C code:

/* The include below should have angle brackets, but */
/* they caused the included text to be stripped in this post??? */
#include sys/stat.h   
…
struct stat fstatus;
int rc = stat(“/dev/c4t10d0s0”, &fstatus);

When I build the code above using the nightly script, I receive the compilation 
message “warning: implicit function declaration: stat 
(E_NO_IMPLICIT_DECL_ALLOWED).”

I really just want to obtain the disk’s device number (dev_t). Is there a 
better way to do this from within the kernel code?

Duff
 
 
This message posted from opensolaris.org
_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to