在c ++中使用ioprio_set [英] Using ioprio_set in c++
问题描述
我试图使用 ioprio_set 为调度线程提供更高的IO调度程序优先级。这是在c ++程序中完成的。我想要这样调用:
I am trying to use ioprio_set to give a calling thread a higher priority for the IO scheduler. This is done within a c++ program. I want the call to look like this:
ioprio_set(IOPRIO_WHO_PROCESS, 0, IOPRIO_PRIO_VALUE(IO_PRIO_CLASS_BE,0));
手册页说ioprio_set没有Glibc包装,因此应该使用syscall调用。我尝试以下:
The man page says ioprio_set does not have Glibc wrapper, so they should be called using syscall. I tried the following:
syscall(SYS_ioprio_set, IOPRIO_WHO_PROCESS, 0, IOPRIO_PRIO_VALUE(IO_PRIO_CLASS_BE,0));
问题是找不到宏IOPRIO_WHO_PROCESS,IOPRIO_PRIO_VALUE和IO_PRIO_CLASS_BE,我不知道如何用int值替换它们。
The problem is that the macros IOPRIO_WHO_PROCESS, IOPRIO_PRIO_VALUE and IO_PRIO_CLASS_BE cannot be found, and I don't know how to replace them by int values.
感谢您的任何建议!
推荐答案
。它包含所有宏 http: //www.cs.fsu.edu/~baker/devices/lxr/http/source/linux/include/linux/ioprio.h
这篇关于在c ++中使用ioprio_set的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!