Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 1/1] util-linux: Add an option to compile 'nsenter' binary.
Date: Fri, 26 Dec 2014 21:57:30 +0100	[thread overview]
Message-ID: <20141226215730.57250eab@free-electrons.com> (raw)
In-Reply-To: <549DC8F6.3080403@green-communications.fr>

Dear Nicolas Cavallari,

On Fri, 26 Dec 2014 21:45:42 +0100, Nicolas Cavallari wrote:

> I'm not so sure now ... The fallback uses SYS_netns, instead of the
> kernel's __NR_setns, so i assume that there must be some C library
> support ... uclibc does define SYS_netns to be __NR_setns, so i think
> the problem is still valid if the toolchain does not define SYS_setns.

I was also confused by this, but it's actually util-linux itself that
defines SYS_setns from __NR_setns.

From m4/ul.m4 in util-linux sources:

AC_DEFUN([UL_CHECK_SYSCALL], [
  dnl This macro uses host_cpu.
  AC_REQUIRE([AC_CANONICAL_HOST])
  AC_CACHE_CHECK([for syscall $1],
    [ul_cv_syscall_$1],
    [_UL_SYSCALL_CHECK_DECL([SYS_$1],
      [syscall=SYS_$1],
      [dnl Our libc failed use, so see if we can get the kernel
      dnl headers to play ball ...
      _UL_SYSCALL_CHECK_DECL([_NR_$1],
        [syscall=_NR_$1],
        [
          syscall=no
          if test "x$linux_os" = xyes; then
            case $host_cpu in
              _UL_CHECK_SYSCALL_FALLBACK(m4_shift($@))
            esac
          fi
        ])
      ])
    ul_cv_syscall_$1=$syscall
    ])
  AM_CONDITIONAL([HAVE_]m4_toupper($1), [test "x$ul_cv_syscall_$1" != xno])
  case $ul_cv_syscall_$1 in #(
  no) AC_MSG_WARN([Unable to detect syscall $1.]) ;;
  SYS_*) ;;
  *) AC_DEFINE_UNQUOTED([SYS_$1], [$ul_cv_syscall_$1],
        [Fallback syscall number for $1]) ;;
  esac
])

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

      reply	other threads:[~2014-12-26 20:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-23 10:44 [Buildroot] [PATCH 1/1] util-linux: Add an option to compile 'nsenter' binary Nicolas Cavallari
2014-12-23 11:20 ` Thomas Petazzoni
2014-12-23 12:33   ` Nicolas Cavallari
2014-12-26 20:02 ` Thomas Petazzoni
2014-12-26 20:45   ` Nicolas Cavallari
2014-12-26 20:57     ` Thomas Petazzoni [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20141226215730.57250eab@free-electrons.com \
    --to=thomas.petazzoni@free-electrons.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox