boinc icon indicating copy to clipboard operation
boinc copied to clipboard

client (Unix): add support for idle detection in a separate process

Open davidpanderson opened this issue 7 months ago • 4 comments

The design is described here: https://github.com/BOINC/boinc/wiki/Linux-idle-detection

davidpanderson avatar Apr 11 '25 21:04 davidpanderson

@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.

jamescowens avatar Apr 12 '25 15:04 jamescowens

Uh, sure.

davidpanderson avatar Apr 12 '25 22:04 davidpanderson

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.

AenBleidd avatar Apr 14 '25 09:04 AenBleidd

fixed (I hope)

davidpanderson avatar Apr 14 '25 20:04 davidpanderson