]> git.proxmox.com Git - mirror_lxcfs.git/blobdiff - src/bindings.c
cpuview: paththrough personality when reading cpuinfo
[mirror_lxcfs.git] / src / bindings.c
index fee7ede0dab672cf2a844fe3f0ccf3974f2f4b26..bbde48b2322350ca5e74fd59c7d3093616eb96ba 100644 (file)
@@ -45,6 +45,7 @@ static bool can_use_swap;
 static bool can_use_sys_cpu;
 static bool has_versioned_opts;
 static bool memory_is_cgroupv2;
+static __u32 host_personality;
 
 static volatile sig_atomic_t reload_successful;
 
@@ -73,6 +74,11 @@ bool liblxcfs_memory_is_cgroupv2(void)
        return memory_is_cgroupv2;
 }
 
+__u32 liblxcfs_personality(void)
+{
+       return host_personality;
+}
+
 /* Define pivot_root() if missing from the C library */
 #ifndef HAVE_PIVOT_ROOT
 static int pivot_root(const char *new_root, const char *put_old)
@@ -919,6 +925,11 @@ static void __attribute__((constructor)) lxcfs_init(void)
                goto broken_upgrade;
        }
 
+       if (get_task_personality(getpid(), &host_personality) < 0) {
+               lxcfs_info("Failed to retrieve host personality");
+               goto broken_upgrade;
+       }
+
        reload_successful = 1;
        return;