client (Unix): add support for idle detection in a separate process#6242
client (Unix): add support for idle detection in a separate process#6242davidpanderson wants to merge 7 commits intomasterfrom
Conversation
The design is described here: https://github.com/BOINC/boinc/wiki/Linux-idle-detection
client/hostinfo_unix.cpp
Outdated
| // (big mess, permssions problems, doesn't generally work) | ||
| // new approach: get last-input time from a separate daemon process, |
There was a problem hiding this comment.
Typo in the comment: 'permssions' should be corrected to 'permissions'.
| // (big mess, permssions problems, doesn't generally work) | |
| // new approach: get last-input time from a separate daemon process, | |
| // (big mess, permissions problems, doesn't generally work) |
client/hostinfo_unix.cpp
Outdated
|
|
||
| uint64_t input_time = seg_ptr[1]; | ||
| idle_time = gstate.now - input_time; | ||
| printf("idle time: %ld\n", idle_time); |
There was a problem hiding this comment.
[nitpick] Consider using the project's logging mechanism instead of printf for production logging to ensure consistency and proper log level management.
…ction. shm_open() and mmap() are the standard way to do this. This requires -lrt. I just added this to Makefile.am; probably not the right way.
|
@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 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: |
|
fixed (I hope) |
- include -lcrypto after -lssl - include -lrt only if it exists
The design is described here:
https://github.com/BOINC/boinc/wiki/Linux-idle-detection