I am working on a hardware device, where I have to do some GPIO operations.
At the start of my program, I invoke iopl(3). The executable is not root owned, but has capabilities set - cap_sys_rawio+eip. Though this works most of the times
sometimes the process fails with:
iopl: Operation not permitted
Is the capability insufficient ? I cannot run the program as root.
The device is running Ubuntu 14.04.2. dmesg / syslogs are not giving
any hints!
More details:
The start of my main has this:
if (iopl(3) != 0) {
perror("iopl");
assert(!"Failed to set privilege!");
}
Though this works most of the times, sometimes on the hardware platform
(Intel Atom based), this fails with perror printing iopl: Operation not permitted.