Changeset: 1aa1e8061ba0 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/1aa1e8061ba0
Modified Files:
        gdk/gdk_system.c
Branch: Dec2025
Log Message:

Read cgroupv2 cpuset info if v1 file cannot be found.


diffs (14 lines):

diff --git a/gdk/gdk_system.c b/gdk/gdk_system.c
--- a/gdk/gdk_system.c
+++ b/gdk/gdk_system.c
@@ -1214,7 +1214,9 @@ MT_check_nr_cores(void)
 
 #ifndef WIN32
        /* get the number of allocated cpus from the cgroup settings */
-       FILE *f = fopen("/sys/fs/cgroup/cpuset/cpuset.cpus", "r");
+       FILE *f = fopen("/sys/fs/cgroup/cpuset/cpuset.cpus", "r"); /* v1 */
+       if (f == NULL)
+               f = fopen("/sys/fs/cgroup/cpuset.cpus.effective", "r"); /* v2 */
        if (f != NULL) {
                char buf[512];
                char *p = fgets(buf, 512, f);
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to