boinc
boinc copied to clipboard
client (Unix): add support for idle detection in a separate process
The design is described here: https://github.com/BOINC/boinc/wiki/Linux-idle-detection
@davidpanderson do you mind making these signed 64 bit ints instead of unsigned so that we conform to the new time standard?
POSIX requires time to be a signed int. The complete spec in <time.h> is actually
struct timespec {
time_t tv_sec; /* seconds */
long tv_nsec; /* nanoseconds */
};
Where time_t is typedefd internally in the header file to a 64 bit signed integer type on that platform.
We obviously don't need the nanoseconds part for this so just using the 64 bit signed integer is perfectly fine.
Uh, sure.
This PR fails during the build for Android:
hostinfo_unix.cpp:567:52: warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare]
strlcpy(buf2, strchr(buf, ':') + 2, ((t<sizeof(buf2))?t:sizeof(buf2)));
~^~~~~~~~~~~~~
hostinfo_unix.cpp:2219:18: error: use of undeclared identifier 'shm_open'
int fd = shm_open("/idle_detect_shmem", O_RDONLY, 0);
^
1 warning and 1 error generated.
fixed (I hope)