-
Notifications
You must be signed in to change notification settings - Fork 476
client (Unix): add support for idle detection in a separate process #6242
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
The design is described here: https://github.com/BOINC/boinc/wiki/Linux-idle-detection
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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) |
Copilot uses AI. Check for mistakes.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Consider using the project's logging mechanism instead of printf for production logging to ensure consistency and proper log level management.
Copilot uses AI. Check for mistakes.
…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