Skip to content

Commit

Permalink
utils: define __NR_setns if missing on old glibcs
Browse files Browse the repository at this point in the history
Closes lxc#2248.

Signed-off-by: Christian Brauner <[email protected]>
  • Loading branch information
Christian Brauner committed Apr 10, 2018
1 parent 2492733 commit 9e32062
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/lxc/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 9e32062

Please sign in to comment.