Nepomuk-Core
Go to the documentation of this file.
28 #include <QtCore/QDebug>
31 #include <sys/resource.h>
35 #include <sys/syscall.h>
43 #ifndef IOPRIO_CLASS_IDLE
52 #ifndef IOPRIO_WHO_PROCESS
54 IOPRIO_WHO_PROCESS = 1,
60 #ifndef IOPRIO_CLASS_SHIFT
61 const int IOPRIO_CLASS_SHIFT = 13;
70 if ( syscall( SYS_ioprio_set, IOPRIO_WHO_PROCESS, 0, IOPRIO_CLASS_IDLE<<IOPRIO_CLASS_SHIFT ) < 0 ) {
71 qDebug(
"cannot set io scheduling to idle (%s). Trying best effort.\n", strerror( errno ));
72 if ( syscall( SYS_ioprio_set, IOPRIO_WHO_PROCESS, 0, 7|IOPRIO_CLASS_BE<<IOPRIO_CLASS_SHIFT ) < 0 ) {
73 qDebug(
"cannot set io scheduling to best effort.\n");
87 return !setpriority( PRIO_PROCESS, 0, 19 );
98 struct sched_param param;
99 memset( ¶m, 0,
sizeof(param) );
100 param.sched_priority = 0;
101 return !sched_setscheduler( 0, SCHED_BATCH, ¶m );
bool lowerSchedulingPriority()
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:48:08 by
doxygen 1.8.7 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.