X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=src%2Fbindings.c;fp=src%2Fbindings.c;h=bbde48b2322350ca5e74fd59c7d3093616eb96ba;hb=096972f7a9a2a2347f1ce6b701872eac7b35371f;hp=fee7ede0dab672cf2a844fe3f0ccf3974f2f4b26;hpb=474491c40b8e61a3352daa217ec2231eb3b84112;p=mirror_lxcfs.git diff --git a/src/bindings.c b/src/bindings.c index fee7ede..bbde48b 100644 --- a/src/bindings.c +++ b/src/bindings.c @@ -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;