staticint isRotational(charconst * path)
{ int ret = 1; #ifdef LINUX
FILE * fp = NULL; char fullpath[4096]; struct stat out; int major, minor; char type; if (stat(path , &out) == -1) return ret;
major = major(out.st_dev);
minor = 0; /* minor(out.st_dev); only the device itself has a queue */
sprintf(fullpath,"/sys/dev/block/%d:%d/queue/rotational",major,minor); if ((fp = fopen(fullpath, "r")) == NULL) return ret; if (fgets(&type, 1, fp))
ret = type == '1';
fclose(fp); #endif return ret;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.