]> git.proxmox.com Git - mirror_lxc.git/commitdiff
utils: define __NR_setns if missing on old glibcs
authorChristian Brauner <christian.brauner@ubuntu.com>
Tue, 10 Apr 2018 10:27:39 +0000 (12:27 +0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Tue, 10 Apr 2018 10:27:39 +0000 (12:27 +0200)
Closes #2248.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/utils.h

index bc0402c63d7e61fdfc5359a1036be1cc668d7c5d..141d27012d19946f7b5c35fd86ffaa033db8a323 100644 (file)
@@ -115,6 +115,22 @@ extern char *get_rundir(void);
 #endif
 #endif
 
+#if !defined(__NR_setns) && !defined(__NR_set_ns)
+       #if defined(__x86_64__)
+               #define __NR_setns 308
+       #elif defined(__i386__)
+               #define __NR_setns 346
+       #elif defined(__arm__)
+               #define __NR_setns 375
+       #elif defined(__aarch64__)
+               #define __NR_setns 375
+       #elif defined(__powerpc__)
+               #define __NR_setns 350
+       #elif defined(__s390__)
+               #define __NR_setns 339
+       #endif
+#endif
+
 /* Define setns() if missing from the C library */
 #ifndef HAVE_SETNS
 static inline int setns(int fd, int nstype)