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));
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));
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.
Thanks for any advice!
Not sure if there's a better way than copying the definitions from include/linux/ioprio.h
Use this Linux header below. adding the following settings in Application.mk. APP_LDFLAGS :=-Wl,--allow-shlib-undefined